v3dv: re-enable sync_fd import/export on the simulator
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 15 Aug 2023 07:19:12 +0000 (09:19 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 29 Aug 2023 08:45:31 +0000 (08:45 +0000)
On commit 29588fe11667 we re-enable sync_fd import/export. But only
with the real hw, because at that time there were wrong CTS tests
(that were calling vkSetEvent after submission) that needed to be
fixed.

Since this commit:
https://github.com/KhronosGroup/VK-GL-CTS/commit/717c051d4bcc9b71f13bc6b223e9926dcf9b7bd5

Those tests are fixed. That fix has been on CTS releases for some
time. So we can enable it on the simulator too.

With this change the pattern dEQP-VK.api.external.semaphore.sync_fd*
goes from 2 Passed/10 Not Supported to 12 Passed on the simulator.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24688>

src/broadcom/vulkan/v3dv_device.c

index ce66194..7e11b26 100644 (file)
@@ -1156,36 +1156,6 @@ create_physical_device(struct v3dv_instance *instance,
     */
    device->drm_syncobj_type.features &= ~VK_SYNC_FEATURE_TIMELINE;
 
-#if using_v3d_simulator
-   /* There are CTS tests which do the following:
-    *
-    *  1. Create a command buffer with a vkCmdWaitEvents()
-    *  2. Submit the command buffer
-    *  3. vkGetSemaphoreFdKHR() to try to get a sync_file
-    *  4. vkSetEvent()
-    *
-    * This deadlocks in the simulator because we have to wait for the syncobj
-    * to get a real fence in vkGetSemaphoreFdKHR(). This will never happen
-    * though because the simulator, unlike real hardware, executes ioctls
-    * synchronously in the same thread, which means that it will try to
-    * execute the wait for event immediately and never get to emit the
-    * signaling job that comes after the compute job that implements the wait
-    * in the command buffer, which would be responsible for creating the fence
-    * for the signaling semaphore.
-    *
-    * This behavior was seemingly allowed in previous Vulkan versions, however,
-    * this was fixed in Vulkan the 1.3.228 spec. From commit 355367640f2e:
-    *
-    *    "Clarify that vkCmdWaitEvents must not execute before a vkSetEvent it
-    *     waits on (internal issue 2971)"
-    *
-    * Either way, we disable sync file support in the simulator for now, until
-    * the CTS is fixed.
-    */
-   device->drm_syncobj_type.import_sync_file = NULL;
-   device->drm_syncobj_type.export_sync_file = NULL;
-#endif
-
    /* Multiwait is required for emulated timeline semaphores and is supported
     * by the v3d kernel interface.
     */