ac/surface: disallow 256KB swizzle modes on gfx11 APUs
authorMarek Olšák <marek.olsak@amd.com>
Mon, 29 Aug 2022 04:21:44 +0000 (00:21 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 5 Sep 2022 08:59:59 +0000 (08:59 +0000)
It doesn't work.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18340>

src/amd/common/ac_surface.c

index e00716e..6673d5c 100644 (file)
@@ -414,6 +414,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) |
@@ -1432,8 +1436,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;