From f4550c6442dc2289a5cffd25a29486a0b925a947 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 28 Jul 2021 18:44:07 +0300 Subject: [PATCH] anv: fix submission batching with perf queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we have 2 command buffers back to back, one with a query pool, one without, we don't want to retain the second query pool value (NULL). Signed-off-by: Lionel Landwerlin Fixes: 0a7224f3ff7542 ("anv: group as many command buffers into a single execbuf") Reviewed-by: Tapani Pälli Part-of: (cherry picked from commit b8e29e89366a5264391dc7c10e778330b7add66a) --- .pick_status.json | 2 +- src/intel/vulkan/anv_queue.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 49886b81955..d89e852c52b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1507,7 +1507,7 @@ "description": "anv: fix submission batching with perf queries", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "0a7224f3ff7542f1560f06759dbdc375e298e853" }, diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index 19abe993140..f271d5c8e5c 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -1220,7 +1220,12 @@ anv_queue_submit_add_cmd_buffer(struct anv_queue_submit *submit, } submit->cmd_buffers[submit->cmd_buffer_count++] = cmd_buffer; - submit->perf_query_pool = cmd_buffer->perf_query_pool; + /* Only update the perf_query_pool if there is one. We can decide to batch + * 2 command buffers if the second one doesn't use a query pool, but we + * can't drop the already chosen one. + */ + if (cmd_buffer->perf_query_pool) + submit->perf_query_pool = cmd_buffer->perf_query_pool; submit->perf_query_pass = perf_pass; return VK_SUCCESS;