From 2bfb87048c8407aa995956df04d574aaa7279a03 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: (cherry picked from commit cfc1be959026f15db32fe68a4d96568921ec401b) --- .pick_status.json | 2 +- src/gallium/drivers/etnaviv/etnaviv_rs.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 89a5917b13f..65361b2aa04 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2902,7 +2902,7 @@ "description": "etnaviv: rs: flush TS cache before making configuration changes", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c b/src/gallium/drivers/etnaviv/etnaviv_rs.c index 83dc49fed98..4d15200d90f 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);