From 08fee190aa0b504c3730cc335b02d7bb86bf8208 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 12 Sep 2023 14:28:18 +0200 Subject: [PATCH] wsi/x11: Fix potential deadlock in present ID. If we observe IDLE before COMPLETE, another queued image may have presented with present ID 0 which would break the check fixed in this commit. The original fix for present_id / signal_present_id split forgot to take this into account. Fixes: 32f7ff2c204b ("Fix present ID signal when IDLE comes before COMPLETE"). Signed-off-by: Hans-Kristian Arntzen Reviewed-by: Mike Blumenkrantz Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 992a459..0b0a0a3 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -1115,7 +1115,7 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(x11_swapchain, base.base, VkSwapchainKHR, static void x11_present_complete(struct x11_swapchain *swapchain, struct x11_image *image) { - if (image->present_id) { + if (image->signal_present_id) { pthread_mutex_lock(&swapchain->present_progress_mutex); if (image->signal_present_id > swapchain->present_id) { swapchain->present_id = image->signal_present_id; -- 2.7.4