From c435a71728f490ed4aff8cc4399018e0b8a561bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Tue, 15 Aug 2023 09:19:12 +0200 Subject: [PATCH] v3dv: re-enable sync_fd import/export on the simulator 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 Part-of: --- src/broadcom/vulkan/v3dv_device.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index ce66194..7e11b26 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -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. */ -- 2.7.4