From 2f7a2ffde8dddbe5a8516def07ea3e8a05c87695 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Thu, 13 Oct 2022 23:21:44 +0200 Subject: [PATCH] etnaviv: disable PE_COLOR_FORMAT_OVERWRITE with MSAA This breaks MSAA, even when compression is not activated. The issue is mostly theoretical, as we always enable color compression with MSAA, but I ran into some GPU hangs when I disabled compression to run some tests. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_state.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index 856608dafd3..c02c06e329b 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -167,8 +167,12 @@ etna_set_framebuffer_state(struct pipe_context *pctx, cs->PE_COLOR_FORMAT |= VIVS_PE_COLOR_FORMAT_COMPONENTS__MASK | - VIVS_PE_COLOR_FORMAT_OVERWRITE | COND(color_supertiled, VIVS_PE_COLOR_FORMAT_SUPER_TILED); + + nr_samples_color = cbuf->base.texture->nr_samples; + if (nr_samples_color <= 1) + cs->PE_COLOR_FORMAT |= VIVS_PE_COLOR_FORMAT_OVERWRITE; + if (VIV_FEATURE(screen, chipMinorFeatures6, CACHE128B256BPERLINE)) cs->PE_COLOR_FORMAT |= COND(color_supertiled, VIVS_PE_COLOR_FORMAT_SUPER_TILED_NEW); /* VIVS_PE_COLOR_FORMAT_COMPONENTS() and @@ -225,8 +229,6 @@ etna_set_framebuffer_state(struct pipe_context *pctx, } } - nr_samples_color = cbuf->base.texture->nr_samples; - if (util_format_is_srgb(cbuf->base.format)) pe_logic_op |= VIVS_PE_LOGIC_OP_SRGB;