vulkan/wsi: Signal semaphores and fences from the dma-buf
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 15 Mar 2021 17:06:53 +0000 (12:06 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 10 Jun 2022 01:33:12 +0000 (01:33 +0000)
commit30b57f10b36d9824a3de8285c667cdd240e61465
tree38be97b98e675d073b51f415d895ccfddc340410
parent18bd05827d175b1a37bac2db560ae65ad7d71d3f
vulkan/wsi: Signal semaphores and fences from the dma-buf

Instead of attempting to signal based on the memory object, use the new
DMA_BUF_IOCTL_EXPORT_SYNC_FILE to get a sync_file for the dma-buf and
use that to signal the semaphore or fence.  Because this happens before
we transfer ownership back to the driver, the resulting sync_file should
only contain dma_fences from the compositor and/or display and shouldn't
be mixed up with the driver in any way.  This gives us a real semaphore
and fence (as opposed to the dummy objects we've used int the past)
without over-synchronization.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
src/vulkan/wsi/wsi_common.c
src/vulkan/wsi/wsi_common.h
src/vulkan/wsi/wsi_common_drm.c
src/vulkan/wsi/wsi_common_private.h