summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2018-11-02 13:01:58 -0700
committerMarge Bot <eric+marge@anholt.net>2021-08-25 22:39:30 +0000
commit4309012774872357cb791050db2a113723543fa9 (patch)
tree99501c35b4a129091af9e5c0346b2b3dd97b4165
parent8fd76782415b7498e4da29b477843cab1daeac76 (diff)
intel/isl: Size Tile64 surfaces with 4 dimensions
In order to size Tile64 surfaces correctly, make sure that the total physical extent is arrayed. The code should handle 3D surfaces as well, but is untested for now. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12132>
-rw-r--r--src/intel/isl/isl.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index a116834ddee..3b62d7bb4a2 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -1260,13 +1260,23 @@ isl_calc_phys_total_extent_el_gfx4_2d(
image_align_sa, phys_level0_sa,
array_pitch_span,
&phys_slice0_sa);
- *phys_total_el = (struct isl_extent4d) {
- .w = isl_align_div_npot(phys_slice0_sa.w, fmtl->bw),
- .h = *array_pitch_el_rows * (phys_level0_sa->array_len - 1) +
- isl_align_div_npot(phys_slice0_sa.h, fmtl->bh),
- .d = 1,
- .a = 1,
- };
+
+ if (tile_info->tiling == ISL_TILING_64) {
+ *phys_total_el = (struct isl_extent4d) {
+ .w = isl_align_div_npot(phys_slice0_sa.w, fmtl->bw),
+ .h = isl_align_div_npot(phys_slice0_sa.h, fmtl->bh),
+ .d = isl_align_div_npot(phys_level0_sa->d, fmtl->bd),
+ .a = phys_level0_sa->array_len,
+ };
+ } else {
+ *phys_total_el = (struct isl_extent4d) {
+ .w = isl_align_div_npot(phys_slice0_sa.w, fmtl->bw),
+ .h = *array_pitch_el_rows * (phys_level0_sa->array_len - 1) +
+ isl_align_div_npot(phys_slice0_sa.h, fmtl->bh),
+ .d = 1,
+ .a = 1,
+ };
+ }
}
/**