v3dv: re-enable sync_fd import/export on the simulator

On commit 29588fe116 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:
717c051d4b

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>
This commit is contained in:
Alejandro Piñeiro
2023-08-15 09:19:12 +02:00
committed by Marge Bot
parent 3f517ff947
commit c435a71728

View 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.
*/