diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index 498e8864f95..c2d360aa757 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -1803,7 +1803,7 @@ wsi_create_buffer_blit_context(const struct wsi_swapchain *chain, .sType = VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA, .pNext = NULL, .implicit_sync = info->image_type == WSI_IMAGE_TYPE_DRM && - !info->explicit_sync, + !info->explicit_sync && !chain->dma_buf_semaphore, }; VkMemoryDedicatedAllocateInfo buf_mem_dedicated_info = { .sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h index e3764939292..5b6b4e8c4fd 100644 --- a/src/vulkan/wsi/wsi_common.h +++ b/src/vulkan/wsi/wsi_common.h @@ -71,6 +71,12 @@ struct wsi_image_create_info { struct wsi_memory_allocate_info { VkStructureType sType; const void *pNext; + /** + * If set, then the driver needs to do implicit synchronization on this BO. + * + * For DRM drivers, this flag will only get set before linux 6.0, at which + * point DMA_BUF_IOCTL_IMPORT_SYNC_FILE was added. + */ bool implicit_sync; }; diff --git a/src/vulkan/wsi/wsi_common_drm.c b/src/vulkan/wsi/wsi_common_drm.c index 0419e7d2ea8..b366169f17f 100644 --- a/src/vulkan/wsi/wsi_common_drm.c +++ b/src/vulkan/wsi/wsi_common_drm.c @@ -746,7 +746,10 @@ wsi_create_native_image_mem(const struct wsi_swapchain *chain, const struct wsi_memory_allocate_info memory_wsi_info = { .sType = VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA, .pNext = NULL, - .implicit_sync = !info->explicit_sync, + /* Ask for the driver to add implicit sync to the image if we're not + * handling implict sync ourselves. + */ + .implicit_sync = !info->explicit_sync && !chain->dma_buf_semaphore, }; const VkExportMemoryAllocateInfo memory_export_info = { .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,