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>
This commit is contained in:
Alyssa Rosenzweig
2019-12-09 11:18:47 -05:00
parent a337bf319c
commit bc887e8281
4 changed files with 22 additions and 0 deletions
@@ -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! */
+3
View File
@@ -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;