summaryrefslogtreecommitdiff
path: root/lib/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c')
-rw-r--r--lib/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c b/lib/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
index 02aad3c81..dc596ff05 100644
--- a/lib/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
+++ b/lib/mesa/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
@@ -274,6 +274,19 @@ static void radv_set_micro_tile_mode(struct radeon_surf *surf,
surf->micro_tile_mode = G_009910_MICRO_TILE_MODE(tile_mode);
}
+static unsigned cik_get_macro_tile_index(struct radeon_surf *surf)
+{
+ unsigned index, tileb;
+
+ tileb = 8 * 8 * surf->bpe;
+ tileb = MIN2(surf->tile_split, tileb);
+
+ for (index = 0; tileb > 64; index++)
+ tileb >>= 1;
+
+ assert(index < 16);
+ return index;
+}
static int radv_amdgpu_winsys_surface_init(struct radeon_winsys *_ws,
struct radeon_surf *surf)
@@ -435,6 +448,7 @@ static int radv_amdgpu_winsys_surface_init(struct radeon_winsys *_ws,
AddrSurfInfoIn.tileIndex = 10; /* 2D displayable */
else
AddrSurfInfoIn.tileIndex = 14; /* 2D non-displayable */
+ AddrSurfInfoOut.macroModeIndex = cik_get_macro_tile_index(surf);
}
}