From 85192dcfc6e57c4d0e5e0a45208481618747e63a Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 12 Sep 2023 14:31:14 +0200 Subject: [PATCH] wsi/x11: Don't allow signal_present_id to rewind. If present ID is 0, we should consider it to be ignored. Avoids a theoretical problem when using IMMEDIATE mode with present ID where some images don't set present ID. Signed-off-by: Hans-Kristian Arntzen Reviewed-by: Mike Blumenkrantz Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 0b0a0a3764c..cba1d1c5e7c 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -1146,7 +1146,8 @@ static void x11_notify_pending_present(struct x11_swapchain *swapchain, /* It is possible that an IDLE is observed before PRESENT_COMPLETE when * not flipping. In this case, reading image->present_id might be a race * in the FIFO management thread. */ - image->signal_present_id = image->present_id; + if (image->present_id) + image->signal_present_id = image->present_id; } static void x11_swapchain_notify_error(struct x11_swapchain *swapchain, VkResult result)