From cfc1be959026f15db32fe68a4d96568921ec401b Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Thu, 8 Jun 2023 21:58:19 +0200 Subject: [PATCH] etnaviv: rs: flush TS cache before making configuration changes Move the TS cache flush into the same conditional block where the TS setup is changed. TS cache always needs to be flushed before making any changes to the TS setup. CC: mesa-stable Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_rs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c b/src/gallium/drivers/etnaviv/etnaviv_rs.c index 83dc49f..4d15200 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_rs.c +++ b/src/gallium/drivers/etnaviv/etnaviv_rs.c @@ -745,9 +745,6 @@ etna_try_rs_blit(struct pipe_context *pctx, etna_set_state(ctx->stream, VIVS_GL_FLUSH_CACHE, VIVS_GL_FLUSH_CACHE_COLOR | VIVS_GL_FLUSH_CACHE_DEPTH); etna_stall(ctx->stream, SYNC_RECIPIENT_RA, SYNC_RECIPIENT_PE); - - if (src_lev->ts_size && src_lev->ts_valid) - etna_set_state(ctx->stream, VIVS_TS_FLUSH_CACHE, VIVS_TS_FLUSH_CACHE_FLUSH); } /* Set up color TS to source surface before blit, if needed */ @@ -758,6 +755,9 @@ etna_try_rs_blit(struct pipe_context *pctx, src_lev->ts_offset + blit_info->src.box.z * src_lev->ts_layer_stride; uint32_t ts_mem_config = 0; + /* flush TS cache before changing to another TS configuration */ + etna_set_state(ctx->stream, VIVS_TS_FLUSH_CACHE, VIVS_TS_FLUSH_CACHE_FLUSH); + if (src_lev->ts_compress_fmt >= 0) { ts_mem_config |= VIVS_TS_MEM_CONFIG_COLOR_COMPRESSION | VIVS_TS_MEM_CONFIG_COLOR_COMPRESSION_FORMAT(src_lev->ts_compress_fmt); -- 2.7.4