mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
wsi/drm: Don't request implicit sync if we're doing implicit sync ourselves.
This will avoid kernel overhead on tu (implicit syncs every BO) and radv (implicit syncs the swapchain BOs) for doing implicit synchronization on non-explicit-sync WSI backends (old X11 and Wayland, KHR_display without !36591, and headless). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19309>
This commit is contained in:
parent
8f67d59725
commit
4dcf32c56e
3 changed files with 11 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue