From 4309012774872357cb791050db2a113723543fa9 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 2 Nov 2018 13:01:58 -0700 Subject: [PATCH] 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 Part-of: --- src/intel/isl/isl.c | 24 +++++++++++++++++------- 1 file 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, + }; + } } /**