From 79f960cb1d503efcd8a19bf50287bd3003c3d15e Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 24 Mar 2025 16:40:53 -0500 Subject: [PATCH] vulkan/wsi: Signal buffer memory object when blitting When we're using the PRIME path and using vkCmdCopyImageToBuffer to copy to a linear image, the buffer memory is what's shared with the window system. For legacy drivers that depend on memory signaling via wsi_memory_signal_submit_info, we need to tell the driver to signal the buffer memory, not the image memory or else the window system may wait on a driver-internal buffer and not wait for the copy to complete. Cc: mesa-stable Reviewed-by: Yiwei Zhang Part-of: (cherry picked from commit cf23ffcbae9d3a420a633509440fbe0483b7efb2) --- .pick_status.json | 2 +- src/vulkan/wsi/wsi_common.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 840c8e0a9e6..13087e0eb98 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1464,7 +1464,7 @@ "description": "vulkan/wsi: Signal buffer memory object when blitting", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index d18ca4d9ebd..120aa063b33 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -1527,7 +1527,8 @@ wsi_common_queue_present(const struct wsi_device *wsi, has_signal_dma_buf = false; mem_signal = (struct wsi_memory_signal_submit_info) { .sType = VK_STRUCTURE_TYPE_WSI_MEMORY_SIGNAL_SUBMIT_INFO_MESA, - .memory = image->memory, + .memory = swapchain->blit.type == WSI_SWAPCHAIN_NO_BLIT ? + image->memory : image->blit.memory, }; __vk_append_struct(&submit_info, &mem_signal); }