From 54f583738ee1bae44e124b83ea072e14458204cc Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Tue, 10 Jan 2023 12:11:35 +0100 Subject: [PATCH] etnaviv: hide TS sharing behind debug option TS sharing isn't fully stable yet. There are some fixes pending, but they don't take care of all reported issues. Hide TS sharing behind a debug switch until all the known issues are resolved. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_debug.h | 1 + src/gallium/drivers/etnaviv/etnaviv_resource.c | 3 ++- src/gallium/drivers/etnaviv/etnaviv_screen.c | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_debug.h b/src/gallium/drivers/etnaviv/etnaviv_debug.h index e520dcf2fe7..61543f07e1e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_debug.h +++ b/src/gallium/drivers/etnaviv/etnaviv_debug.h @@ -56,6 +56,7 @@ #define ETNA_DBG_NOCACHE 0x1000000 /* Disable shader cache */ #define ETNA_DBG_LINEAR_PE 0x2000000 /* Enable linear PE */ #define ETNA_DBG_MSAA 0x4000000 /* Enable MSAA */ +#define ETNA_DBG_SHARED_TS 0x8000000 /* Enable TS sharing */ extern int etna_mesa_debug; /* set in etnaviv_screen.c from ETNA_MESA_DEBUG */ diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c index ecb62e7d3aa..cffa43aa52b 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c @@ -519,7 +519,8 @@ select_best_modifier(const struct etna_screen * screen, best_modifier = base_modifier = priority_to_modifier[prio]; - if (!VIV_FEATURE(screen, chipFeatures, FAST_CLEAR)) + if (!DBG_ENABLED(ETNA_DBG_SHARED_TS) || + !VIV_FEATURE(screen, chipFeatures, FAST_CLEAR)) return best_modifier; /* Make a second pass to try and find the best TS modifier if any. */ diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 76c962742f7..ec4f9b0e948 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -74,6 +74,7 @@ static const struct debug_named_value etna_debug_options[] = { {"nocache", ETNA_DBG_NOCACHE, "Disable shader cache"}, {"linear_pe", ETNA_DBG_LINEAR_PE, "Enable linear PE"}, {"msaa", ETNA_DBG_MSAA, "Enable MSAA support"}, + {"shared_ts", ETNA_DBG_SHARED_TS, "Enable TS sharing"}, DEBUG_NAMED_VALUE_END }; @@ -653,7 +654,8 @@ etna_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, int mods_multiplier = 1; int i, j; - if (VIV_FEATURE(screen, chipFeatures, FAST_CLEAR)) { + if (DBG_ENABLED(ETNA_DBG_SHARED_TS) && + VIV_FEATURE(screen, chipFeatures, FAST_CLEAR)) { /* If TS is supported expose the TS modifiers. GPUs with feature * CACHE128B256BPERLINE have both 128B and 256B color tile TS modes, * older cores support exactly one TS layout.