From ab18d0709a408d307de92147c5ad051c9cb10a2c Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 14 Nov 2023 14:05:52 +0100 Subject: [PATCH] panfrost: Count the number of compute jobs at the batch level We will use this information to make some helpers HW-agnostic so they can work on CSF hardware. Signed-off-by: Boris Brezillon Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 2 ++ src/gallium/drivers/panfrost/pan_job.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 5b334131f57..7ebcb255ceb 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -3505,6 +3505,7 @@ panfrost_launch_xfb(struct panfrost_batch *batch, #endif panfrost_add_job(&batch->pool.base, &batch->scoreboard, job_type, true, false, 0, 0, &t, false); + batch->compute_count++; ctx->uncompiled[PIPE_SHADER_VERTEX] = vs_uncompiled; ctx->prog[PIPE_SHADER_VERTEX] = vs; @@ -3917,6 +3918,7 @@ panfrost_launch_grid_on_batch(struct pipe_context *pipe, panfrost_add_job(&batch->pool.base, &batch->scoreboard, MALI_JOB_TYPE_COMPUTE, true, false, indirect_dep, 0, &t, false); + batch->compute_count++; } static void diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h index d362b5ba1fc..e6e3387e982 100644 --- a/src/gallium/drivers/panfrost/pan_job.h +++ b/src/gallium/drivers/panfrost/pan_job.h @@ -195,6 +195,9 @@ struct panfrost_batch { * jobs present in the batch. */ uint32_t draw_count; + + /* Number of compute jobs in the batch. */ + uint32_t compute_count; }; /* Functions for managing the above */