From 6adab12fb10cfdc45e31fe6d677b8be956b28e1a Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Fri, 3 Sep 2021 11:45:05 +0300 Subject: [PATCH] gpu: host1x: Always return syncpoint value when waiting The new TegraDRM UAPI uses syncpoint waiting with timeout set to zero to indicate reading the syncpoint value. To support that we need to return the syncpoint value always when waiting. JIRA LS-128 Change-Id: I9bcb19e71cef30175994447d5409b621b5e58a07 Signed-off-by: Mikko Perttunen Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653094 Tested-by: Jonathan Hunter Reviewed-by: Jonathan Hunter Reviewed-by: svc_kernel_abi GVS: Gerrit_Virtual_Submit --- drivers/gpu/host1x/syncpt.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index d198a108..a89a4081 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -225,27 +225,12 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, void *ref; struct host1x_waitlist *waiter; int err = 0, check_count = 0; - u32 val; if (value) - *value = 0; - - /* first check cache */ - if (host1x_syncpt_is_expired(sp, thresh)) { - if (value) - *value = host1x_syncpt_load(sp); + *value = host1x_syncpt_load(sp); + if (host1x_syncpt_is_expired(sp, thresh)) return 0; - } - - /* try to read from register */ - val = host1x_hw_syncpt_load(sp->host, sp); - if (host1x_syncpt_is_expired(sp, thresh)) { - if (value) - *value = val; - - goto done; - } if (!timeout) { err = -EAGAIN;