diff options
author | Lucas Stach <[email protected]> | 2020-02-06 17:11:03 +0100 |
---|---|---|
committer | Lucas Stach <[email protected]> | 2020-05-12 16:13:31 +0200 |
commit | dc6c42dc77e4bf0cb07037e038c4a50afa5a8143 (patch) | |
tree | c18e915a7890667480b7e9db547e023968c47b68 /src | |
parent | 8e5fc97be63e4c4296f16fe34523b68d39776fad (diff) |
etnaviv: generalize FE stall before loading shader and sampler states
It seems that some of the new shader and sampler states added with
Halti0 are not self-synchronizing anymore. Make sure to stall the FE
before loading those new states to avoid corruption of the in-flight
draw state.
Signed-off-by: Lucas Stach <[email protected]>
Reviewed-by: Jonathan Marek <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3963>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_emit.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c index cb55b2eb497..de36aeb7f9b 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c @@ -534,18 +534,18 @@ etna_emit_state(struct etna_context *ctx) else emit_pre_halti5_state(ctx); - ctx->emit_texture_state(ctx); - - /* Insert a FE/PE stall as changing the shader instructions (and maybe - * the uniforms) can corrupt the previous in-progress draw operation. - * Observed with amoeba on GC2000 during the right-to-left rendering - * of PI, and can cause GPU hangs immediately after. - * I summise that this is because the "new" locations at 0xc000 are not - * properly protected against updates as other states seem to be. Hence, - * we detect the "new" vertex shader instruction offset to apply this. */ - if (ctx->dirty & (ETNA_DIRTY_SHADER | ETNA_DIRTY_CONSTBUF) && screen->specs.vs_offset > 0x4000) + /* Beginning from Halti0 some of the new shader and sampler states are not + * self-synchronizing anymore. Thus we need to stall the FE on PE completion + * before loading the new states to avoid corrupting the state of the + * in-flight draw. + */ + if (screen->specs.halti >= 0 && + (ctx->dirty & (ETNA_DIRTY_SHADER | ETNA_DIRTY_CONSTBUF | + ETNA_DIRTY_SAMPLERS | ETNA_DIRTY_SAMPLER_VIEWS))) etna_stall(ctx->stream, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); + ctx->emit_texture_state(ctx); + /* We need to update the uniform cache only if one of the following bits are * set in ctx->dirty: * - ETNA_DIRTY_SHADER |