etnaviv: add debug option to disable linear PE feature
authorLucas Stach <l.stach@pengutronix.de>
Thu, 25 Aug 2022 12:16:37 +0000 (14:16 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 26 Aug 2022 07:47:09 +0000 (07:47 +0000)
Linear PE has already shown to have some rough corner cases in the hardware
and also has performance implications. Add a debug option to allow to disable
the feature, so users can more easily check if some issue is caused by this
feature.

CC: mesa-stable #22.2
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18232>

src/gallium/drivers/etnaviv/etnaviv_debug.h
src/gallium/drivers/etnaviv/etnaviv_screen.c

index 925d50d..92315b1 100644 (file)
@@ -56,6 +56,7 @@
 #define ETNA_DBG_NO_SINGLEBUF    0x1000000 /* disable single buffer feature */
 #define ETNA_DBG_DEQP            0x2000000 /* Hacks to run dEQP GLES3 tests */
 #define ETNA_DBG_NOCACHE         0x4000000 /* Disable shader cache */
+#define ETNA_DBG_NO_LINEAR_PE    0x8000000 /* Disable linear PE */
 
 extern int etna_mesa_debug; /* set in etnaviv_screen.c from ETNA_MESA_DEBUG */
 
index 34f7833..6627a8c 100644 (file)
@@ -74,6 +74,7 @@ static const struct debug_named_value etna_debug_options[] = {
    {"no_singlebuffer",ETNA_DBG_NO_SINGLEBUF, "Disable single buffer feature"},
    {"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"},
    DEBUG_NAMED_VALUE_END
 };
 
@@ -1116,6 +1117,8 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu,
       screen->specs.can_supertile = 0;
    if (DBG_ENABLED(ETNA_DBG_NO_SINGLEBUF))
       screen->specs.single_buffer = 0;
+   if (DBG_ENABLED(ETNA_DBG_NO_LINEAR_PE))
+      screen->features[viv_chipMinorFeatures2] &= ~chipMinorFeatures2_LINEAR_PE;
 
    pscreen->destroy = etna_screen_destroy;
    pscreen->get_param = etna_screen_get_param;