From 83c72cab7a13e2ce44e996bcf19a7e2af65daf50 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Sun, 1 Nov 2020 16:46:23 +0100 Subject: [PATCH] etnaviv: flush depth cache when changing depth config Some depth config states changes require the depth cache to be flushed, leading to a GPU hang if not done. As the conditions that require the flush are not toally clear, better be safe than sorry and always flush the cache on depth state changes. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_emit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c index 70ee9aed05f..db9a484fc06 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c @@ -233,6 +233,8 @@ etna_emit_state(struct etna_context *ctx) uint32_t to_flush = 0; if (unlikely(dirty & (ETNA_DIRTY_BLEND))) to_flush |= VIVS_GL_FLUSH_CACHE_COLOR; + if (unlikely(dirty & ETNA_DIRTY_ZSA)) + to_flush |= VIVS_GL_FLUSH_CACHE_DEPTH; if (unlikely(dirty & (ETNA_DIRTY_TEXTURE_CACHES))) to_flush |= VIVS_GL_FLUSH_CACHE_TEXTURE; if (unlikely(dirty & (ETNA_DIRTY_FRAMEBUFFER))) /* Framebuffer config changed? */