Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Fixes: 44e961381354 ("drm/tegra: Implement syncpoint wait UAPI")
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Mikko Perttunen and committed by
Thierry Reding
184b58fa 22d7ee32

+2 -17
+2 -17
drivers/gpu/host1x/syncpt.c
··· 234 234 void *ref; 235 235 struct host1x_waitlist *waiter; 236 236 int err = 0, check_count = 0; 237 - u32 val; 238 237 239 238 if (value) 240 - *value = 0; 239 + *value = host1x_syncpt_load(sp); 241 240 242 - /* first check cache */ 243 - if (host1x_syncpt_is_expired(sp, thresh)) { 244 - if (value) 245 - *value = host1x_syncpt_load(sp); 246 - 241 + if (host1x_syncpt_is_expired(sp, thresh)) 247 242 return 0; 248 - } 249 - 250 - /* try to read from register */ 251 - val = host1x_hw_syncpt_load(sp->host, sp); 252 - if (host1x_syncpt_is_expired(sp, thresh)) { 253 - if (value) 254 - *value = val; 255 - 256 - goto done; 257 - } 258 243 259 244 if (!timeout) { 260 245 err = -EAGAIN;