From b1ebe7a19b8c587ab9c30e7e507dcb53ae1a6595 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 8 Jan 2021 22:55:54 -0500 Subject: [PATCH] panfrost: Allow waiting on slots 6/7 during preload I don't understand the underlying uarch details but ATEST needs to wait on slot 6 and BLEND needs to wait on both, so these bits are used if ATEST/BLEND are in the first clause, which happens if e.g. a constant colour is written, or if the input is preloaded. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_assemble.c | 6 ++++-- src/panfrost/util/pan_ir.h | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index af6129e6425..8e6620c33e8 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -62,9 +62,9 @@ pan_prepare_midgard_props(struct panfrost_shader_state *state, static void pan_prepare_bifrost_props(struct panfrost_shader_state *state, + panfrost_program *program, gl_shader_stage stage) { - switch (stage) { case MESA_SHADER_VERTEX: pan_prepare(&state->properties, RENDERER_PROPERTIES); @@ -91,6 +91,8 @@ pan_prepare_bifrost_props(struct panfrost_shader_state *state, } state->properties.uniform_buffer_count = state->ubo_count; state->properties.bifrost.shader_modifies_coverage = state->can_discard; + state->properties.bifrost.shader_wait_dependency_6 = program->wait_6; + state->properties.bifrost.shader_wait_dependency_7 = program->wait_7; pan_prepare(&state->preload, PRELOAD); state->preload.uniform_count = state->uniform_count; @@ -420,7 +422,7 @@ panfrost_shader_compile(struct panfrost_context *ctx, state->shader.sampler_count = s->info.num_textures; if (dev->quirks & IS_BIFROST) - pan_prepare_bifrost_props(state, stage); + pan_prepare_bifrost_props(state, program, stage); else pan_prepare_midgard_props(state, stage); diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index e299dcc656a..7dd01e63647 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -108,6 +108,10 @@ typedef struct { * (register spilling), or zero if no spilling is used */ unsigned tls_size; + /* For Bifrost, should the program wait on dependency slots 6/7 before + * starting? For ATEST/BLEND in the first clause, which can occur with + * extremely simple shaders */ + bool wait_6, wait_7; } panfrost_program; struct panfrost_compile_inputs {