Skip to content

WIP: vulkan/wsi: Avoid the dummy vkQueueSubmit when possible

Faith Ekstrand requested to merge gfxstrand/mesa:wip/anv-dma-buf-sync-file2 into main

In order to handle the implicit synchronization needs of X11 and Wayland, we currently do a dummy vkQueueSubmit on whatever queue and pass in the set of semaphores. We also set a flag via an internal vkQueueSubmit extension to tell the driver to "signal the image". Instead of this, with the new DMA_BUF_IOCTL_IMPORT_SYNC_FILE, we can pull sync_files out of all of the semaphores, merge them, and signal the dma-buf directly.

This not only saves an vkQueueSubmit(), which is likely heavier-weight than a few import/export ops, but it also avoids over-synchronization in the case where multiple frames may be in flight. If the client has already started rendering to frame N+1 when they present frame N, the dummy vkQueuePresent causes us to end up waiting on that rendering before frame N can be presented.

In the case where we have to do a prime blit, the vkQueueSubmit call from vkQueuePresent is not a dummy and can't be avoided.

Merge request reports