From 755fb7a262d1139ccb6230d09e24bf6fa0fa3bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 30 Oct 2024 10:51:33 -0400 Subject: [PATCH] amd: move Tonga and Iceland TC-compat HTILE workarounds to ac_gpu_info.c Reviewed-by: Samuel Pitoiset Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/amd/common/ac_gpu_info.c | 10 ++++++++-- src/amd/vulkan/radv_image.c | 6 ------ src/gallium/drivers/radeonsi/si_texture.c | 14 +++----------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index be71b2849ed..6f86565ffa4 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -1240,8 +1240,14 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, info->has_dcc_constant_encode = info->family == CHIP_RAVEN2 || info->family == CHIP_RENOIR || info->gfx_level >= GFX10; - /* TC-compat HTILE is only available for GFX8-GFX11.5. */ - info->has_tc_compatible_htile = info->gfx_level >= GFX8 && info->gfx_level < GFX12; + /* TC-compat HTILE is only available on GFX8-GFX11.5. + * + * There are issues with TC-compatible HTILE on Tonga (and Iceland is the same design), and + * documented bug workarounds don't help. For example, this fails: + * piglit/bin/tex-miplevel-selection 'texture()' 2DShadow -auto + */ + info->has_tc_compatible_htile = info->gfx_level >= GFX8 && info->gfx_level < GFX12 && + info->family != CHIP_TONGA && info->family != CHIP_ICELAND; info->has_etc_support = info->family == CHIP_STONEY || info->family == CHIP_VEGA10 || info->family == CHIP_RAVEN || info->family == CHIP_RAVEN2; diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 24e6500d761..2a27f55f80c 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -75,12 +75,6 @@ radv_use_tc_compat_htile_for_image(struct radv_device *device, const VkImageCrea if (!pdev->info.has_tc_compatible_htile) return false; - /* TC-compat HTILE looks broken on Tonga (and Iceland is the same design) and the documented bug - * workarounds don't help. - */ - if (pdev->info.family == CHIP_TONGA || pdev->info.family == CHIP_ICELAND) - return false; - if (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR) return false; diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 6d8798d6124..d5d45108c97 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1394,17 +1394,9 @@ si_texture_create_with_modifier(struct pipe_screen *screen, */ bool tc_compatible_htile = is_zs && !is_flushed_depth && !(sscreen->debug_flags & DBG(NO_HYPERZ)) && - sscreen->info.has_tc_compatible_htile; - if (sscreen->info.gfx_level < GFX11) { - tc_compatible_htile &= - /* There are issues with TC-compatible HTILE on Tonga (and - * Iceland is the same design), and documented bug workarounds - * don't help. For example, this fails: - * piglit/bin/tex-miplevel-selection 'texture()' 2DShadow -auto - */ - sscreen->info.family != CHIP_TONGA && sscreen->info.family != CHIP_ICELAND && - templ->flags & PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY; - } + sscreen->info.has_tc_compatible_htile && + (sscreen->info.gfx_level >= GFX11 || + templ->flags & PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY); enum radeon_surf_mode tile_mode = si_choose_tiling(sscreen, templ, tc_compatible_htile);