summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-04-26 18:30:07 +0200
committerMarek Olšák <[email protected]>2016-05-02 22:49:25 +0200
commitef45825708e653daa232a9542187b534470e738a (patch)
tree42ddc2d41d99e6a1338ce9d67f0a0f8568ddcbe9 /src/gallium/winsys/radeon
parented4fd542de73a03946f033a2150616423245b4e5 (diff)
gallium/radeon: add radeon_surf::macro_tile_index
for indexing cik_macrotile_mode_array Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_surface.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
index 29d34672765..6fb877490ea 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
@@ -31,6 +31,20 @@
#include <radeon_surface.h>
+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 void surf_level_winsys_to_drm(struct radeon_surface_level *level_drm,
const struct radeon_surf_level *level_ws)
{
@@ -129,6 +143,8 @@ static void surf_drm_to_winsys(struct radeon_surf *surf_ws,
surf_ws->stencil_tile_split = surf_drm->stencil_tile_split;
surf_ws->stencil_offset = surf_drm->stencil_offset;
+ surf_ws->macro_tile_index = cik_get_macro_tile_index(surf_ws);
+
for (i = 0; i < RADEON_SURF_MAX_LEVEL; i++) {
surf_level_drm_to_winsys(&surf_ws->level[i], &surf_drm->level[i]);
surf_level_drm_to_winsys(&surf_ws->stencil_level[i],