radeonsi: fix max syncobj wait timeout

syncobj wait takes int64_t timeout and won't clamp it
in kernel code, so we have to pass in INT64_MAX instead
of OS_TIMEOUT_INFINITE which is UINT64_MAX. Otherwise
syncobj wait with OS_TIMEOUT_INFINITE case just return
fail.

Fixes: c638301b42 "radeonsi: fix syncobj wait timeout"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6676>
(cherry picked from commit ef980ac0c1)
This commit is contained in:
Qiang Yu 2020-09-10 10:08:41 +08:00 committed by Eric Engestrom
parent 8e6f14e611
commit e3fe502bfe
2 changed files with 4 additions and 1 deletions

View file

@ -598,7 +598,7 @@
"description": "radeonsi: fix max syncobj wait timeout",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "c638301b42bc6ea1a623c2a53646047197fb8030"
},

View file

@ -206,6 +206,9 @@ bool amdgpu_fence_wait(struct pipe_fence_handle *fence, uint64_t timeout,
/* Handle syncobjs. */
if (amdgpu_fence_is_syncobj(afence)) {
if (abs_timeout == OS_TIMEOUT_INFINITE)
abs_timeout = INT64_MAX;
if (amdgpu_cs_syncobj_wait(afence->ws->dev, &afence->syncobj, 1,
abs_timeout, 0, NULL))
return false;