mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
radeonsi: fix syncobj wait timeout
syncobj wait takes absolute timeout value.
Fixes: 162502370c "winsys/amdgpu: implement sync_file import/export"
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/6579>
This commit is contained in:
parent
be2818387d
commit
c638301b42
1 changed files with 6 additions and 11 deletions
|
|
@ -191,26 +191,21 @@ bool amdgpu_fence_wait(struct pipe_fence_handle *fence, uint64_t timeout,
|
||||||
if (afence->signalled)
|
if (afence->signalled)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (absolute)
|
||||||
|
abs_timeout = timeout;
|
||||||
|
else
|
||||||
|
abs_timeout = os_time_get_absolute_timeout(timeout);
|
||||||
|
|
||||||
/* Handle syncobjs. */
|
/* Handle syncobjs. */
|
||||||
if (amdgpu_fence_is_syncobj(afence)) {
|
if (amdgpu_fence_is_syncobj(afence)) {
|
||||||
/* Absolute timeouts are only be used by BO fences, which aren't
|
|
||||||
* backed by syncobjs.
|
|
||||||
*/
|
|
||||||
assert(!absolute);
|
|
||||||
|
|
||||||
if (amdgpu_cs_syncobj_wait(afence->ws->dev, &afence->syncobj, 1,
|
if (amdgpu_cs_syncobj_wait(afence->ws->dev, &afence->syncobj, 1,
|
||||||
timeout, 0, NULL))
|
abs_timeout, 0, NULL))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
afence->signalled = true;
|
afence->signalled = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absolute)
|
|
||||||
abs_timeout = timeout;
|
|
||||||
else
|
|
||||||
abs_timeout = os_time_get_absolute_timeout(timeout);
|
|
||||||
|
|
||||||
/* The fence might not have a number assigned if its IB is being
|
/* The fence might not have a number assigned if its IB is being
|
||||||
* submitted in the other thread right now. Wait until the submission
|
* submitted in the other thread right now. Wait until the submission
|
||||||
* is done. */
|
* is done. */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue