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

Author: José Roberto de Souza <jose.so...@intel.com>
Date:   Fri Jan  5 07:42:23 2024 -0800

anv: Call anv_measure_submit() before anv_cmd_buffer_chain_command_buffers()

Otherwise the measurement instructions will be placed after the
MI_BATCH_BUFFER_START calling the next cmd_buffer.

Signed-off-by: José Roberto de Souza <jose.so...@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>

---

 src/intel/vulkan/i915/anv_batch_chain.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/i915/anv_batch_chain.c 
b/src/intel/vulkan/i915/anv_batch_chain.c
index c5d791ba77a..5920f92f4bd 100644
--- a/src/intel/vulkan/i915/anv_batch_chain.c
+++ b/src/intel/vulkan/i915/anv_batch_chain.c
@@ -372,13 +372,17 @@ setup_execbuf_for_cmd_buffers(struct anv_execbuf *execbuf,
    struct anv_device *device = queue->device;
    VkResult result;
 
+   if (unlikely(device->physical->measure_device.config)) {
+      for (uint32_t i = 0; i < num_cmd_buffers; i++)
+         anv_measure_submit(cmd_buffers[i]);
+   }
+
    /* Edit the tail of the command buffers to chain them all together if they
     * can be.
     */
    anv_cmd_buffer_chain_command_buffers(cmd_buffers, num_cmd_buffers);
 
    for (uint32_t i = 0; i < num_cmd_buffers; i++) {
-      anv_measure_submit(cmd_buffers[i]);
       result = setup_execbuf_for_cmd_buffer(execbuf, cmd_buffers[i]);
       if (result != VK_SUCCESS)
          return result;

Reply via email to