Mesa (main): v3dv: don't submit noop job if there is nothing to wait on or signal

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 1 07:49:33 UTC 2022


Module: Mesa
Branch: main
Commit: ce99b1a7467f4afb4d3910b3a39c599226b5ea6e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce99b1a7467f4afb4d3910b3a39c599226b5ea6e

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Mon Jan 31 13:07:32 2022 +0100

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 <mwen at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14802>

---

 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++) {



More information about the mesa-commit mailing list