From ce99b1a7467f4afb4d3910b3a39c599226b5ea6e Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 31 Jan 2022 13:07:32 +0100 Subject: [PATCH] v3dv: don't submit noop job if there is nothing to wait on or signal Also, do not unconditionally flag signaling for submits without any command buffers. Reviewed-by: Melissa Wen Part-of: --- src/broadcom/vulkan/v3dv_queue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/broadcom/vulkan/v3dv_queue.c b/src/broadcom/vulkan/v3dv_queue.c index e87e133f694..8194f80ec84 100644 --- a/src/broadcom/vulkan/v3dv_queue.c +++ b/src/broadcom/vulkan/v3dv_queue.c @@ -1176,6 +1176,9 @@ queue_submit_noop_job(struct v3dv_queue *queue, struct v3dv_submit_info_semaphores *sems_info, bool do_sem_signal, bool serialize) { + if (!do_sem_signal && !serialize && !sems_info->wait_sem_count) + return VK_SUCCESS; + /* VkQueue host access is externally synchronized so we don't need to lock * here for the static variable. */ @@ -1382,7 +1385,8 @@ queue_submit_cmd_buffer_batch(struct v3dv_queue *queue, * to do anything special, it should not be a common case anyway. */ if (pSubmit->commandBufferCount == 0) { - result = queue_submit_noop_job(queue, &sems_info, true, false); + result = queue_submit_noop_job(queue, &sems_info, + sems_info.signal_sem_count > 0, false); } else { const uint32_t last_cmd_buffer_idx = pSubmit->commandBufferCount - 1; for (uint32_t i = 0; i < pSubmit->commandBufferCount; i++) {