From c44422287ba3afddba725e19c26fcc34a06bb0a7 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 1 Sep 2023 14:56:55 +0200 Subject: [PATCH 40/64] panfrost: introduce and use PAN_USE_CSF --- src/gallium/drivers/panfrost/pan_cmdstream.c | 25 ++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 84128289246..ae926d7dc11 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -52,6 +52,7 @@ #include "drm-uapi/panthor_drm.h" #define PAN_GPU_INDIRECTS (PAN_ARCH == 7) +#define PAN_USE_CSF (PAN_ARCH >= 10) struct panfrost_rasterizer { struct pipe_rasterizer_state base; @@ -2656,7 +2657,7 @@ panfrost_initialize_surface(struct panfrost_batch *batch, static void panfrost_emit_heap_set(struct panfrost_batch *batch, u64 heap_ctx_gpu_va) { -#if PAN_ARCH >= 10 +#if PAN_USE_CSF ceu_builder *b = batch->ceu_builder; /* Setup the tiler heap */ @@ -2669,7 +2670,7 @@ panfrost_emit_heap_set(struct panfrost_batch *batch, u64 heap_ctx_gpu_va) static void panfrost_emit_batch_end(struct panfrost_batch *batch) { -#if PAN_ARCH >= 10 +#if PAN_USE_CSF ceu_builder *b = batch->ceu_builder; /* Barrier to let everything finish */ @@ -2726,7 +2727,7 @@ emit_fragment_job(struct panfrost_batch *batch, const struct pan_fb_info *pfb) assert(batch->maxx > batch->minx); assert(batch->maxy > batch->miny); -#if PAN_ARCH >= 10 +#if PAN_USE_CSF ceu_builder *b = batch->ceu_builder; if (batch->draw_count > 0) { @@ -3047,7 +3048,7 @@ panfrost_batch_get_bifrost_tiler(struct panfrost_batch *batch, mali_ptr heap, geom_buf = t.gpu; -#if PAN_ARCH >= 10 +#if PAN_USE_CSF heap = batch->ctx->heap.desc_bo->ptr.gpu; #else t = pan_pool_alloc_desc(&batch->pool.base, TILER_HEAP); @@ -3215,7 +3216,7 @@ panfrost_emit_shader(struct panfrost_batch *batch, } #endif -#if PAN_ARCH >= 10 +#if PAN_USE_CSF static void panfrost_emit_shader_regs(struct panfrost_batch *batch, enum pipe_shader_type stage, mali_ptr shader) @@ -3540,7 +3541,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch, } #endif -#if PAN_ARCH <= 9 +#if !PAN_USE_CSF static void panfrost_launch_xfb(struct panfrost_batch *batch, const struct pipe_draw_info *info, mali_ptr attribs, @@ -3696,7 +3697,7 @@ panfrost_update_point_sprite_shader(struct panfrost_context *ctx, } } -#if PAN_ARCH >= 10 +#if PAN_USE_CSF /* * Entrypoint for draws with CSF Mali. This is split out from JM as the handling * of indirect draws is completely different, now that we can use the CEU, and @@ -5021,7 +5022,7 @@ static void preload(struct panfrost_batch *batch, struct pan_fb_info *fb) { GENX(pan_preload_fb) - (&batch->pool.base, PAN_ARCH < 10 ? &batch->scoreboard : NULL, fb, + (&batch->pool.base, !PAN_USE_CSF ? &batch->scoreboard : NULL, fb, batch->tls.gpu, PAN_ARCH >= 6 ? batch->tiler_ctx.bifrost.ctx : 0, NULL); } @@ -5056,7 +5057,7 @@ init_batch(struct panfrost_batch *batch) #endif #endif -#if PAN_ARCH >= 10 +#if PAN_USE_CSF /* Allocate and bind the command queue */ struct ceu_queue queue = ceu_alloc_queue(batch); @@ -5086,7 +5087,7 @@ panfrost_sampler_view_destroy(struct pipe_context *pctx, ralloc_free(view); } -#if PAN_ARCH >= 10 +#if PAN_USE_CSF static void panfrost_csf_init_context(struct panfrost_context *ctx) { @@ -5189,7 +5190,7 @@ context_populate_vtbl(struct pipe_context *pipe) static void context_init(struct panfrost_context *ctx) { -#if PAN_ARCH >= 10 +#if PAN_USE_CSF panfrost_csf_init_context(ctx); #endif } @@ -5197,7 +5198,7 @@ context_init(struct panfrost_context *ctx) static void context_cleanup(struct panfrost_context *ctx) { -#if PAN_ARCH >= 10 +#if PAN_USE_CSF panfrost_csf_cleanup_context(ctx); #endif } -- 2.42.0