From f8424d3b9993d555115a82c7cea4931b89a94fea Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 30 Apr 2020 16:00:21 -0700 Subject: [PATCH] freedreno/a6xx: fix LRZ hang In detecting the case where we actually do need to re-emit LRZ state (due to new batch), we were checking `ctx->last.dirty` to detect when we cannot trust previous state. But this is cleared before we check it. Move where it is cleared to the end of the draw_vbo() path. Fixes: dfa702e94b9 ("freedreno/a6xx: limit LRZ state emit") Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 2 -- src/gallium/drivers/freedreno/freedreno_context.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index 5ce0f860511..78bd62051f6 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -137,8 +137,6 @@ fixup_draw_state(struct fd_context *ctx, struct fd6_emit *emit) ctx->dirty |= FD_DIRTY_RASTERIZER; ctx->last.primitive_restart = emit->primitive_restart; } - - ctx->last.dirty = false; } static bool diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index b3a0f212dd0..e756411d183 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -450,6 +450,7 @@ fd_context_all_dirty(struct fd_context *ctx) static inline void fd_context_all_clean(struct fd_context *ctx) { + ctx->last.dirty = false; ctx->dirty = 0; for (unsigned i = 0; i < PIPE_SHADER_TYPES; i++) { /* don't mark compute state as clean, since it is not emitted -- 2.30.2