That's part of our attempt to sanitize panfrost_queue_draw(),
panfrost_draw_vbo() and panfrost_emit_for_draw(). The new
panfrost_batch_adjust_stack_size() helper is placed in pan_job.c, where
all batch related functions live.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4083>
panfrost_new_job(batch, JOB_TYPE_TILER, false, vertex, tiler_payload, sizeof(*tiler_payload), false);
}
- for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i) {
- struct panfrost_shader_state *ss = panfrost_get_shader_state(ctx, i);
-
- if (!ss)
- continue;
-
- batch->stack_size = MAX2(batch->stack_size, ss->stack_size);
- }
+ panfrost_batch_adjust_stack_size(batch);
}
/* The entire frame is in memory -- send it off to the kernel! */
batch->requirements |= PAN_REQ_DEPTH_WRITE;
}
+void
+panfrost_batch_adjust_stack_size(struct panfrost_batch *batch)
+{
+ struct panfrost_context *ctx = batch->ctx;
+
+ for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i) {
+ struct panfrost_shader_state *ss;
+
+ ss = panfrost_get_shader_state(ctx, i);
+ if (!ss)
+ continue;
+
+ batch->stack_size = MAX2(batch->stack_size, ss->stack_size);
+ }
+}
+
/* Helper to smear a 32-bit color across 128-bit components */
static void
void
panfrost_batch_set_requirements(struct panfrost_batch *batch);
+void
+panfrost_batch_adjust_stack_size(struct panfrost_batch *batch);
+
struct panfrost_bo *
panfrost_batch_get_scratchpad(struct panfrost_batch *batch, unsigned shift, unsigned thread_tls_alloc, unsigned core_count);