panfrost: Make panfrost_batch_get_bifrost_tiler per-gen
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 13 Jul 2021 17:58:10 +0000 (13:58 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 23 Jul 2021 20:12:18 +0000 (20:12 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11851>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_job.c
src/gallium/drivers/panfrost/pan_job.h

index 4b9e3cd..23f6544 100644 (file)
@@ -2599,6 +2599,35 @@ panfrost_update_state_fs(struct panfrost_batch *batch)
 }
 
 #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
 #define TILER_JOB MIDGARD_TILER_JOB
index 3fdcfde..f940557 100644 (file)
@@ -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,
index 11b2cf3..6b613aa 100644 (file)
@@ -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