From 4f5e59d1146a6d14f57d4f215a08a149bb8bf40c Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Sat, 19 Nov 2022 17:49:34 +0100 Subject: [PATCH] etnaviv: Hide MSAA support behind debug flag With the current level of MSAA support we have some real world rendering problems in Chromium/Skia (issue #7678). Convert the MSAA support to an explicit opt-in by settings ETNA_MESA_DEBUG=msaa. Cc: 22.3 mesa-stable Signed-off-by: Christian Gmeiner Reviewed-by: Lucas Stach Part-of: --- src/gallium/drivers/etnaviv/etnaviv_debug.h | 1 + src/gallium/drivers/etnaviv/etnaviv_screen.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/gallium/drivers/etnaviv/etnaviv_debug.h b/src/gallium/drivers/etnaviv/etnaviv_debug.h index 693c36fd237..298f2ddb2e4 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_debug.h +++ b/src/gallium/drivers/etnaviv/etnaviv_debug.h @@ -55,6 +55,7 @@ #define ETNA_DBG_DEQP 0x800000 /* Hacks to run dEQP GLES3 tests */ #define ETNA_DBG_NOCACHE 0x1000000 /* Disable shader cache */ #define ETNA_DBG_NO_LINEAR_PE 0x2000000 /* Disable linear PE */ +#define ETNA_DBG_MSAA 0x4000000 /* Enable MSAA */ extern int etna_mesa_debug; /* set in etnaviv_screen.c from ETNA_MESA_DEBUG */ diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index dadd57d7fac..965dd337efd 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -73,6 +73,7 @@ static const struct debug_named_value etna_debug_options[] = { {"deqp", ETNA_DBG_DEQP, "Hacks to run dEQP GLES3 tests"}, /* needs MESA_GLES_VERSION_OVERRIDE=3.0 */ {"nocache", ETNA_DBG_NOCACHE, "Disable shader cache"}, {"no_linear_pe", ETNA_DBG_NO_LINEAR_PE, "Disable linear PE"}, + {"msaa", ETNA_DBG_MSAA, "Enable MSAA support"}, DEBUG_NAMED_VALUE_END }; @@ -496,6 +497,10 @@ gpu_supports_render_format(struct etna_screen *screen, enum pipe_format format, return false; if (sample_count > 1) { + /* Explicitly enabled. */ + if (!DBG_ENABLED(ETNA_DBG_MSAA)) + return false; + /* The hardware supports it. */ if (!VIV_FEATURE(screen, chipFeatures, MSAA)) return false;