ac/surface: unset RADEON_SURF_TC_COMPATIBLE_HTILE if HTILE hasn't been computed
authorMarek Olšák <marek.olsak@amd.com>
Sat, 2 May 2020 20:19:00 +0000 (16:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 5 May 2020 16:27:29 +0000 (16:27 +0000)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4866>

src/amd/common/ac_surface.c

index 64bfa4198390e583d8ee7b3a2bed632b85247430..b3c4c99486dc0401ef59a4adb661f5f173337c9d 100644 (file)
@@ -946,6 +946,9 @@ static int gfx6_compute_surface(ADDR_HANDLE addrlib,
                surf->htile_size = (total_pixels / htile_block_size) *
                                   htile_element_size;
                surf->htile_size = align(surf->htile_size, surf->htile_alignment);
+       } else if (!surf->htile_size) {
+               /* Unset this if HTILE is not present. */
+               surf->flags &= ~RADEON_SURF_TC_COMPATIBLE_HTILE;
        }
 
        surf->is_linear = surf->u.legacy.level[0].mode == RADEON_SURF_MODE_LINEAR_ALIGNED;
@@ -1775,6 +1778,11 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
                        assert(surf->num_dcc_levels);
        }
 
+       if (!surf->htile_size) {
+               /* Unset this if HTILE is not present. */
+               surf->flags &= ~RADEON_SURF_TC_COMPATIBLE_HTILE;
+       }
+
        switch (surf->u.gfx9.surf.swizzle_mode) {
                /* S = standard. */
                case ADDR_SW_256B_S: