Mesa (main): panfrost: Make panfrost_scoreboard_initialize_tiler() return the job pointer

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 22 14:31:36 UTC 2021


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

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Thu May  6 08:43:00 2021 +0200

panfrost: Make panfrost_scoreboard_initialize_tiler() return the job pointer

In the vulkan driver we need to patch job headers when re-submitting
an already submitted batch. Change panfrost_scoreboard_initialize_tiler()
prototype to allow that.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11139>

---

 src/panfrost/lib/pan_scoreboard.c | 18 ++++++++++--------
 src/panfrost/lib/pan_scoreboard.h |  8 ++++----
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/panfrost/lib/pan_scoreboard.c b/src/panfrost/lib/pan_scoreboard.c
index 3fb87c8079b..5589b4da584 100644
--- a/src/panfrost/lib/pan_scoreboard.c
+++ b/src/panfrost/lib/pan_scoreboard.c
@@ -189,22 +189,23 @@ panfrost_add_job(
 /* Generates a write value job, used to initialize the tiler structures. Note
  * this is called right before frame submission. */
 
-void
+struct panfrost_ptr
 panfrost_scoreboard_initialize_tiler(struct pan_pool *pool,
-                struct pan_scoreboard *scoreboard,
-                mali_ptr polygon_list)
+                                     struct pan_scoreboard *scoreboard,
+                                     mali_ptr polygon_list)
 {
+        struct panfrost_ptr transfer = { 0 };
+
         /* Check if we even need tiling */
         if (pan_is_bifrost(pool->dev) || !scoreboard->first_tiler)
-                return;
+                return transfer;
 
         /* Okay, we do. Let's generate it. We'll need the job's polygon list
          * regardless of size. */
 
-        struct panfrost_ptr transfer =
-                panfrost_pool_alloc_aligned(pool,
-                                            MALI_WRITE_VALUE_JOB_LENGTH,
-                                            64);
+        transfer = panfrost_pool_alloc_aligned(pool,
+                                               MALI_WRITE_VALUE_JOB_LENGTH,
+                                               64);
 
         pan_section_pack(transfer.cpu, WRITE_VALUE_JOB, HEADER, header) {
                 header.type = MALI_JOB_TYPE_WRITE_VALUE;
@@ -218,4 +219,5 @@ panfrost_scoreboard_initialize_tiler(struct pan_pool *pool,
         }
 
         scoreboard->first_job = transfer.gpu;
+        return transfer;
 }
diff --git a/src/panfrost/lib/pan_scoreboard.h b/src/panfrost/lib/pan_scoreboard.h
index 44a3456db4d..c7854733cc9 100644
--- a/src/panfrost/lib/pan_scoreboard.h
+++ b/src/panfrost/lib/pan_scoreboard.h
@@ -64,9 +64,9 @@ panfrost_add_job(
                 const struct panfrost_ptr *job,
                 bool inject);
 
-void panfrost_scoreboard_initialize_tiler(
-                struct pan_pool *pool,
-                struct pan_scoreboard *scoreboard,
-                mali_ptr polygon_list);
+struct panfrost_ptr
+panfrost_scoreboard_initialize_tiler(struct pan_pool *pool,
+                                     struct pan_scoreboard *scoreboard,
+                                     mali_ptr polygon_list);
 
 #endif



More information about the mesa-commit mailing list