v3dv: implement external semaphore/fence extensions

This provides most of the implementation, but there are some
things we cannot enable until we improve of kernel submit
interface, namely:

We don't expose capacity to export SYNC_FD, although we do
have the implementation in place. This requires that we
improve our kernel interface and event wait implementation
first so we can cover the corner case where the application
submits a command buffer that includes a VkCmdWaitForEvents
and tries to export a SYNC_FD from its signal semaphores or
fence before it the event is signaled and the command buffer
is sent to the kernel for execution in full.

Likewise, we can't currently import semaphores. This is because
our current kernel submit interface can only take one syncobj.
We have been working around this so far by waiting on the last
syncobj produced from the device whenever we had to wait on any
semaphores (which is obviously suboptimal already), but this
won't work as soon as we allow importing external semaphores,
as those could (and would typically) be produced from a
different device.

Once we address the kernel bits, we should come back and enable
SYNC_FD exports as well as semaphore imports.

Relevant CTS tests:
dEQP-VK.api.external.fence.*
dEQP-VK.api.external.semaphore.*
dEQP-VK.synchronization.cross_instance.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11105>
This commit is contained in:
Iago Toral Quiroga
2021-06-01 09:41:48 +02:00
committed by Marge Bot
parent cfb4d109a7
commit 1f7d2b4994
4 changed files with 365 additions and 13 deletions

View File

@@ -427,12 +427,12 @@ Vulkan 1.1 -- all DONE: anv, lvp, radv, tu, vn
VK_KHR_descriptor_update_template DONE (anv, lvp, radv, tu, vn)
VK_KHR_device_group DONE (lvp, tu, v3dv, vn)
VK_KHR_device_group_creation DONE (lvp, tu, v3dv, vn)
VK_KHR_external_fence DONE (anv, lvp, radv, tu, vn)
VK_KHR_external_fence_capabilities DONE (anv, lvp, radv, tu, vn)
VK_KHR_external_fence DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_external_fence_capabilities DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_external_memory DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_external_memory_capabilities DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_external_semaphore DONE (anv, lvp, radv, tu, vn)
VK_KHR_external_semaphore_capabilities DONE (anv, lvp, radv, tu, vn)
VK_KHR_external_semaphore DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_external_semaphore_capabilities DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_get_memory_requirements2 DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_get_physical_device_properties2 DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_maintenance1 DONE (anv, lvp, radv, tu, v3dv, vn)
@@ -479,11 +479,11 @@ Khronos extensions that are not part of any Vulkan version:
VK_KHR_deferred_host_operations DONE (anv, radv)
VK_KHR_display DONE (anv, lvp, radv, tu, v3dv)
VK_KHR_display_swapchain not started
VK_KHR_external_fence_fd DONE (anv, radv, tu)
VK_KHR_external_fence_fd DONE (anv, radv, tu, v3dv)
VK_KHR_external_fence_win32 not started
VK_KHR_external_memory_fd DONE (anv, radv, tu, v3dv)
VK_KHR_external_memory_win32 not started
VK_KHR_external_semaphore_fd DONE (anv, radv, tu)
VK_KHR_external_semaphore_fd DONE (anv, radv, tu, v3dv)
VK_KHR_external_semaphore_win32 not started
VK_KHR_fragment_shading_rate not started
VK_KHR_get_display_properties2 DONE (anv, lvp, radv, tu)