From 252485b0e20e8295a11922f176b9d607a19f1ff4 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 12 Jul 2024 20:11:09 +0200 Subject: [PATCH] radeonsi: fix si_get_dmabuf_modifier_planes for gfx12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DCC_RETILE/DCC only makes sense if TILE_VERSION is lower than AMD_FMT_MOD_TILE_VER_GFX12. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_texture.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 94bfc7ec0ad..d1b11f1ed99 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1588,13 +1588,15 @@ si_get_dmabuf_modifier_planes(struct pipe_screen *pscreen, uint64_t modifier, { unsigned planes = util_format_get_num_planes(format); - if (IS_AMD_FMT_MOD(modifier) && planes == 1) { - if (AMD_FMT_MOD_GET(DCC_RETILE, modifier)) - return 3; - else if (AMD_FMT_MOD_GET(DCC, modifier)) - return 2; - else - return 1; + if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) < AMD_FMT_MOD_TILE_VER_GFX12) { + if (IS_AMD_FMT_MOD(modifier) && planes == 1) { + if (AMD_FMT_MOD_GET(DCC_RETILE, modifier)) + return 3; + else if (AMD_FMT_MOD_GET(DCC, modifier)) + return 2; + else + return 1; + } } return planes;