summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-12-09 11:18:47 -0500
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-12-13 10:26:35 -0500
commitbc887e82818ac2c8f2011da70d7bddb8975b66c3 (patch)
treefc013b5bae1030548baeab72236a5eae5110d1e2 /src/gallium/drivers/panfrost
parenta337bf319c9cb1dc9a9f10aa43626efdc6f6171d (diff)
panfrost: Calculate maximum stack_size per batch
We'll need this so we can allocate a stack for the batch large enough for all the jobs within it. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c10
-rw-r--r--src/gallium/drivers/panfrost/pan_job.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 8bfa6de476e..54ce6f81c71 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1265,6 +1265,16 @@ panfrost_queue_draw(struct panfrost_context *ctx)
panfrost_scoreboard_queue_fused_job_prepend(batch, vertex, tiler);
else
panfrost_scoreboard_queue_fused_job(batch, vertex, tiler);
+
+ for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i) {
+ struct panfrost_shader_variants *all = ctx->shader[i];
+
+ if (!all)
+ continue;
+
+ struct panfrost_shader_state *ss = &all->variants[all->active_variant];
+ batch->stack_size = MAX2(batch->stack_size, ss->stack_size);
+ }
}
/* The entire frame is in memory -- send it off to the kernel! */
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index a9fb863d6a2..aa4966f0633 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -83,6 +83,9 @@ struct panfrost_batch {
float clear_depth;
unsigned clear_stencil;
+ /* Amount of thread local storage required per thread */
+ unsigned stack_size;
+
/* Whether this job uses the corresponding requirement (PAN_REQ_*
* bitmask) */
unsigned requirements;