mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
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>
This commit is contained in:
parent
e2c0eac5bf
commit
5e39b52e6a
1 changed files with 4 additions and 1 deletions
|
|
@ -647,11 +647,14 @@ tu_timeline_sync_reset(struct vk_device *vk_device,
|
||||||
static VkResult
|
static VkResult
|
||||||
drm_syncobj_wait(struct tu_device *device,
|
drm_syncobj_wait(struct tu_device *device,
|
||||||
uint32_t *handles, uint32_t count_handles,
|
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;
|
uint32_t syncobj_wait_flags = DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT;
|
||||||
if (wait_all) syncobj_wait_flags |= DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL;
|
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,
|
int err = drmSyncobjWait(device->fd, handles,
|
||||||
count_handles, timeout_nsec,
|
count_handles, timeout_nsec,
|
||||||
syncobj_wait_flags,
|
syncobj_wait_flags,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue