From e4e619d68532c882e6d1ececb8b4a6d3e5a48b0d Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 24 Nov 2025 14:02:25 -0500 Subject: [PATCH] vulkan/drm-syncobj: Stop returning early waiting for sync files In the WAIT_ALL case in spin_wait_for_sync_file(), we were returning the moment we saw the first success. However, this isn't a wait-all, it's a bad wait-any. We should instead just continue on to check the next sync until we've ensured that every sync in the array has a sync file. The only reason this wasn't blowing up in our face is because it only affects non-timeline drivers (pretty rare these days) and because most of the places where we use WAIT_PENDING on non-timeline drivers is to guard a sync file export and those typically have only a single sync in the array. Cc: mesa-stable Reviewed-by: Gurchetan Singh Reviewed-by: Emma Anholt Part-of: --- src/vulkan/runtime/vk_drm_syncobj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vulkan/runtime/vk_drm_syncobj.c b/src/vulkan/runtime/vk_drm_syncobj.c index 5945583d4b4..57de98eaffb 100644 --- a/src/vulkan/runtime/vk_drm_syncobj.c +++ b/src/vulkan/runtime/vk_drm_syncobj.c @@ -261,6 +261,9 @@ spin_wait_for_sync_file(struct vk_device *device, for (uint32_t i = 0; i < wait_count; i++) { while (1) { VkResult result = sync_has_sync_file(device, waits[i].sync); + if (result == VK_SUCCESS) + break; /* Break out of the inner while */ + if (result != VK_TIMEOUT) return result;