turnip: Fix busy-waiting on syncobjs with OS_TIMEOUT_INFINITE.
I noticed that glmark2's glFinish()es in its offscreen rendering tests under zink were spinning. When we passed -1 as the timeout for drmSyncobjWait(), the kernel would immediately return ETIME. Fixes:0a82a26a18
("turnip: Porting to common implementation for timeline semaphore") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18739> (cherry picked from commit5e39b52e6a
)
This commit is contained in:
@@ -1633,7 +1633,7 @@
|
||||
"description": "turnip: Fix busy-waiting on syncobjs with OS_TIMEOUT_INFINITE.",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "0a82a26a1854a63d8248e85c0e3b137d44ce7542"
|
||||
},
|
||||
|
@@ -487,11 +487,14 @@ tu_timeline_sync_reset(struct vk_device *vk_device,
|
||||
static VkResult
|
||||
drm_syncobj_wait(struct tu_device *device,
|
||||
uint32_t *handles, uint32_t count_handles,
|
||||
int64_t timeout_nsec, bool wait_all)
|
||||
uint64_t timeout_nsec, bool wait_all)
|
||||
{
|
||||
uint32_t syncobj_wait_flags = DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT;
|
||||
if (wait_all) syncobj_wait_flags |= DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL;
|
||||
|
||||
/* syncobj absolute timeouts are signed. clamp OS_TIMEOUT_INFINITE down. */
|
||||
timeout_nsec = MIN2(timeout_nsec, (uint64_t)INT64_MAX);
|
||||
|
||||
int err = drmSyncobjWait(device->fd, handles,
|
||||
count_handles, timeout_nsec,
|
||||
syncobj_wait_flags,
|
||||
|
Reference in New Issue
Block a user