Module: Mesa
Branch: staging/22.2
Commit: b47e856216e046b7e6571b2102df3fbc8600f353
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b47e856216e046b7e6571b2102df3fbc8600f353

Author: Marek Olšák <[email protected]>
Date:   Mon Aug 29 00:21:44 2022 -0400

ac/surface: disallow 256KB swizzle modes on gfx11 APUs

It doesn't work.

Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
(cherry picked from commit a6050a43cae57d4dcb8d3b7aaf05ce2b803bea26)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18500>

---

 src/amd/common/ac_surface.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 6383803bb89..a1b7a68adc7 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -410,6 +410,10 @@ bool ac_get_supported_modifiers(const struct radeon_info 
*info,
          else
             swizzle_r_x = !i ? AMD_FMT_MOD_TILE_GFX9_64K_R_X : 
AMD_FMT_MOD_TILE_GFX11_256K_R_X;
 
+         /* Disable 256K on APUs because it doesn't work with DAL. */
+         if (!info->has_dedicated_vram && swizzle_r_x == 
AMD_FMT_MOD_TILE_GFX11_256K_R_X)
+            continue;
+
          uint64_t modifier_r_x = AMD_FMT_MOD |
                                  AMD_FMT_MOD_SET(TILE_VERSION, 
AMD_FMT_MOD_TILE_VER_GFX11) |
                                  AMD_FMT_MOD_SET(TILE, swizzle_r_x) |
@@ -1428,8 +1432,15 @@ static int gfx9_get_preferred_swizzle_mode(ADDR_HANDLE 
addrlib, const struct rad
    /* TODO: We could allow some of these: */
    sin.forbiddenBlock.micro = 1; /* don't allow the 256B swizzle modes */
 
-   if (info->gfx_level < GFX11)
+   if (info->gfx_level >= GFX11) {
+      /* Disable 256K on APUs because it doesn't work with DAL. */
+      if (!info->has_dedicated_vram) {
+         sin.forbiddenBlock.gfx11.thin256KB = 1;
+         sin.forbiddenBlock.gfx11.thick256KB = 1;
+      }
+   } else {
       sin.forbiddenBlock.var = 1;   /* don't allow the variable-sized swizzle 
modes */
+   }
 
    sin.bpp = in->bpp;
    sin.width = in->width;

Reply via email to