summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-12-29 08:23:58 +1000
committerDave Airlie <airlied@redhat.com>2020-12-30 06:06:33 +1000
commit5692e2dda5cac0d8042bc7637b8d201acdc7e2f8 (patch)
tree68666141b51b344ee9c908a931d1f7b09136efd4 /src/mesa/drivers/dri/i965/intel_mipmap_tree.c
parent02328637c1af9a4dce8d6743641241344b17d606 (diff)
intel/isl: move get_tile dims/masks to common isl header
Both classic and iris have the same code for this, but none of it is dependent on drivers, so just add inline helpers to isl. Acked-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8253>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 0a65c9f9b14..680723c0741 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1156,52 +1156,6 @@ intel_miptree_get_image_offset(const struct intel_mipmap_tree *mt,
*y = y_offset_sa;
}
-
-/**
- * This function computes the tile_w (in bytes) and tile_h (in rows) of
- * different tiling patterns. If the BO is untiled, tile_w is set to cpp
- * and tile_h is set to 1.
- */
-void
-intel_get_tile_dims(enum isl_tiling tiling, uint32_t cpp,
- uint32_t *tile_w, uint32_t *tile_h)
-{
- switch (tiling) {
- case ISL_TILING_X:
- *tile_w = 512;
- *tile_h = 8;
- break;
- case ISL_TILING_Y0:
- *tile_w = 128;
- *tile_h = 32;
- break;
- case ISL_TILING_LINEAR:
- *tile_w = cpp;
- *tile_h = 1;
- break;
- default:
- unreachable("not reached");
- }
-}
-
-
-/**
- * This function computes masks that may be used to select the bits of the X
- * and Y coordinates that indicate the offset within a tile. If the BO is
- * untiled, the masks are set to 0.
- */
-void
-intel_get_tile_masks(enum isl_tiling tiling, uint32_t cpp,
- uint32_t *mask_x, uint32_t *mask_y)
-{
- uint32_t tile_w_bytes, tile_h;
-
- intel_get_tile_dims(tiling, cpp, &tile_w_bytes, &tile_h);
-
- *mask_x = tile_w_bytes / cpp - 1;
- *mask_y = tile_h - 1;
-}
-
/**
* Compute the offset (in bytes) from the start of the BO to the given x
* and y coordinate. For tiled BOs, caller must ensure that x and y are
@@ -1249,7 +1203,7 @@ intel_miptree_get_tile_offsets(const struct intel_mipmap_tree *mt,
uint32_t x, y;
uint32_t mask_x, mask_y;
- intel_get_tile_masks(mt->surf.tiling, mt->cpp, &mask_x, &mask_y);
+ isl_get_tile_masks(mt->surf.tiling, mt->cpp, &mask_x, &mask_y);
intel_miptree_get_image_offset(mt, level, slice, &x, &y);
*tile_x = x & mask_x;