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

Author: Lionel Landwerlin <[email protected]>
Date:   Sat Mar 18 23:47:01 2023 +0200

anv: fixup locking for utrace submission increments

This is supposed to happen under the device lock.

Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: e760c5b37b ("anv: add perfetto source")
Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>

---

 src/intel/vulkan/anv_batch_chain.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c 
b/src/intel/vulkan/anv_batch_chain.c
index 79236469092..d32212ab4bd 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -1342,17 +1342,17 @@ anv_queue_submit(struct vk_queue *vk_queue,
       return VK_SUCCESS;
    }
 
-   uint64_t start_ts = intel_ds_begin_submit(&queue->ds);
-
    pthread_mutex_lock(&device->mutex);
+
+   uint64_t start_ts = intel_ds_begin_submit(&queue->ds);
    result = anv_queue_submit_locked(queue, submit);
    /* Take submission ID under lock */
-   pthread_mutex_unlock(&device->mutex);
-
    intel_ds_end_submit(&queue->ds, start_ts);
 
    u_trace_context_process(&device->ds.trace_context, true);
 
+   pthread_mutex_unlock(&device->mutex);
+
    return result;
 }
 

Reply via email to