From a5d34f85f83da516af5c72fcbfadc6bf98b43754 Mon Sep 17 00:00:00 2001 From: jyotiranjan Date: Tue, 19 May 2026 08:41:10 +0000 Subject: [PATCH] radv/sqtt: forward zero-submit-count vkQueueSubmit2 for SQTT capture Vulkan applications use vkQueueSubmit2(submitCount=0) to signal throttle fences (e.g. per-image frame-pacing fences). When SQTT is enabled, sqtt_QueueSubmit2() skips both the bypass path and the submit loop, so the call is never forwarded and the fence remains unsignaled. This causes hangs in drmSyncobjWait (WAIT_FOR_SUBMIT) after capture. Forward submitCount==0 calls directly to the underlying QueueSubmit2 to ensure the fence is signaled. Signed-off-by: jyotiranjan Reviewed-by: Samuel Pitoiset Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/amd/vulkan/layers/radv_sqtt_layer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/layers/radv_sqtt_layer.c b/src/amd/vulkan/layers/radv_sqtt_layer.c index 33c3350940f..4807306c912 100644 --- a/src/amd/vulkan/layers/radv_sqtt_layer.c +++ b/src/amd/vulkan/layers/radv_sqtt_layer.c @@ -751,8 +751,6 @@ radv_sqtt_wsi_submit(VkQueue _queue, uint32_t submitCount, const VkSubmitInfo2 * FREE(new_cmdbufs); } - if (submitCount == 0 && _fence != VK_NULL_HANDLE) - result = device->layer_dispatch.rgp.QueueSubmit2(_queue, 0, NULL, _fence); return result; @@ -773,6 +771,14 @@ sqtt_QueueSubmit2(VkQueue _queue, uint32_t submitCount, const VkSubmitInfo2 *pSu VkCommandBufferSubmitInfo *new_cmdbufs = NULL; VkResult result = VK_SUCCESS; + /* Vulkan apps use vkQueueSubmit2(submitCount=0, fence) to signal per-image + * throttle fences. During SQTT capture, our wrap loop iterates 0 times + * and would never forward this call, leaving the fence unsignaled and + * hanging the next frame's vkWaitForFences. Always forward such calls. + */ + if (submitCount == 0 && _fence != VK_NULL_HANDLE) + return device->layer_dispatch.rgp.QueueSubmit2(_queue, 0, NULL, _fence); + /* Only consider queue events on graphics/compute when enabled. */ if (((!device->sqtt_enabled || !radv_sqtt_queue_events_enabled()) && !instance->vk.trace_per_submit) || !is_gfx_or_ace)