Mesa (main): panvk: Start a new batch when the job index gets above the limit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 13:54:43 UTC 2021


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

Author: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Date:   Tue Jul  6 11:45:56 2021 +0200

panvk: Start a new batch when the job index gets above the limit

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

---

 src/panfrost/vulkan/panvk_cmd_buffer.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/panfrost/vulkan/panvk_cmd_buffer.c b/src/panfrost/vulkan/panvk_cmd_buffer.c
index 3da978b4837..fc48e79338a 100644
--- a/src/panfrost/vulkan/panvk_cmd_buffer.c
+++ b/src/panfrost/vulkan/panvk_cmd_buffer.c
@@ -1340,6 +1340,15 @@ panvk_CmdDraw(VkCommandBuffer commandBuffer,
 
    struct panvk_batch *batch = cmdbuf->state.batch;
 
+   /* There are only 16 bits in the descriptor for the job ID, make sure all
+    * the 3 (2 in Bifrost) jobs in this draw are in the same batch.
+    */
+   if (batch->scoreboard.job_index >= (UINT16_MAX - 3)) {
+      panvk_cmd_close_batch(cmdbuf);
+      panvk_cmd_open_batch(cmdbuf);
+      batch = cmdbuf->state.batch;
+   }
+
    panvk_cmd_alloc_fb_desc(cmdbuf);
    panvk_cmd_alloc_tls_desc(cmdbuf);
    panvk_cmd_prepare_ubos(cmdbuf);



More information about the mesa-commit mailing list