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 <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23530>
(cherry picked from commit cfc1be9590)
This commit is contained in:
Lucas Stach 2023-06-08 21:58:19 +02:00 committed by Eric Engestrom
parent 38d9085b9f
commit 2bfb87048c
2 changed files with 4 additions and 4 deletions

View file

@ -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
},

View file

@ -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);