mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
tu/drm/virtio: Fix tu_wait_fence timeout handling
Fixes two bugs in the WAIT_FENCE polling loop:
1. Break on timeout returned VK_SUCCESS because ret was read too late.
2. UINT64_MAX timeout_ns overflowed end_time, causing immediate exit.
Fix by reading rsp->ret before the timeout check and using
OS_TIMEOUT_INFINITE (like virtio_pipe_wait in freedreno) to avoid
overflow.
This prevents premature BO teardown during host-side fault recovery.
Fixes: f17c5297d7 ("tu: Add virtgpu support")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41108>
This commit is contained in:
parent
809bf45c12
commit
dad72b414b
1 changed files with 4 additions and 3 deletions
|
|
@ -430,10 +430,11 @@ tu_wait_fence(struct tu_device *dev,
|
|||
if (ret)
|
||||
goto out;
|
||||
|
||||
if (os_time_get_nano() >= end_time)
|
||||
break;
|
||||
|
||||
ret = rsp->ret;
|
||||
|
||||
if (timeout_ns != OS_TIMEOUT_INFINITE &&
|
||||
os_time_get_nano() >= end_time)
|
||||
break;
|
||||
} while (ret == -ETIMEDOUT);
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue