Mesa (main): panfrost: Make panfrost_batch_get_bifrost_tiler per-gen

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 23 20:28:03 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue Jul 13 13:58:10 2021 -0400

panfrost: Make panfrost_batch_get_bifrost_tiler per-gen

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

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 29 ++++++++++++++++++++++++++++
 src/gallium/drivers/panfrost/pan_job.c       | 28 ---------------------------
 src/gallium/drivers/panfrost/pan_job.h       |  3 ---
 3 files changed, 29 insertions(+), 31 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 4b9e3cd7d7e..23f6544c191 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -2598,6 +2598,35 @@ panfrost_update_state_fs(struct panfrost_batch *batch)
         panfrost_update_state_tex(batch, st);
 }
 
+#if PAN_ARCH >= 6
+static mali_ptr
+panfrost_batch_get_bifrost_tiler(struct panfrost_batch *batch, unsigned vertex_count)
+{
+        struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
+
+        if (!vertex_count)
+                return 0;
+
+        if (batch->tiler_ctx.bifrost)
+                return batch->tiler_ctx.bifrost;
+
+        struct panfrost_ptr t =
+                pan_pool_alloc_desc(&batch->pool.base, BIFROST_TILER_HEAP);
+
+        pan_emit_bifrost_tiler_heap(dev, t.cpu);
+
+        mali_ptr heap = t.gpu;
+
+        t = pan_pool_alloc_desc(&batch->pool.base, BIFROST_TILER);
+        pan_emit_bifrost_tiler(dev, batch->key.width, batch->key.height,
+                               util_framebuffer_get_num_samples(&batch->key),
+                               heap, t.cpu);
+
+        batch->tiler_ctx.bifrost = t.gpu;
+        return batch->tiler_ctx.bifrost;
+}
+#endif
+
 #if PAN_ARCH >= 6
 #define TILER_JOB BIFROST_TILER_JOB
 #else
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 3fdcfde755c..f940557a113 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -484,34 +484,6 @@ panfrost_batch_get_shared_memory(struct panfrost_batch *batch,
         return batch->shared_memory;
 }
 
-mali_ptr
-panfrost_batch_get_bifrost_tiler(struct panfrost_batch *batch, unsigned vertex_count)
-{
-        struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
-        assert(pan_is_bifrost(dev));
-
-        if (!vertex_count)
-                return 0;
-
-        if (batch->tiler_ctx.bifrost)
-                return batch->tiler_ctx.bifrost;
-
-        struct panfrost_ptr t =
-                pan_pool_alloc_desc(&batch->pool.base, BIFROST_TILER_HEAP);
-
-        pan_emit_bifrost_tiler_heap(dev, t.cpu);
-
-        mali_ptr heap = t.gpu;
-
-        t = pan_pool_alloc_desc(&batch->pool.base, BIFROST_TILER);
-        pan_emit_bifrost_tiler(dev, batch->key.width, batch->key.height,
-                               util_framebuffer_get_num_samples(&batch->key),
-                               heap, t.cpu);
-
-        batch->tiler_ctx.bifrost = t.gpu;
-        return batch->tiler_ctx.bifrost;
-}
-
 static void
 panfrost_batch_to_fb_info(const struct panfrost_batch *batch,
                           struct pan_fb_info *fb,
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index 11b2cf38cf0..6b613aa6543 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -208,7 +208,4 @@ panfrost_batch_intersection_scissor(struct panfrost_batch *batch,
                                     unsigned minx, unsigned miny,
                                     unsigned maxx, unsigned maxy);
 
-mali_ptr
-panfrost_batch_get_bifrost_tiler(struct panfrost_batch *batch, unsigned vertex_count);
-
 #endif



More information about the mesa-commit mailing list