From ad158b0beec97dae8042a16f529425dd67f4d6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 5 Jan 2024 07:42:23 -0800 Subject: [PATCH] anv: Call anv_measure_submit() before anv_cmd_buffer_chain_command_buffers() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Lionel Landwerlin Part-of: --- 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;