From d1e6c1b29bf45b807e298921e5b1386fec61669e Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Thu, 7 Jan 2016 11:00:29 -0800 Subject: [PATCH] isl/gen9: Fix array pitch of 3d surfaces For tiled 3D surfaces, the array pitch must aligned to the tile height. From the Skylake BSpec >> RENDER_SURFACE_STATE >> Surface QPitch: Tile Mode != Linear: This field must be set to an integer multiple of the tile height Fixes CTS tests 'dEQP-VK.pipeline.image.view_type.3d.format.r8g8b8a8_unorm.*'. Fixes Crucible tests 'func.miptree.r8g8b8a8-unorm.aspect-color.view-3d.*'. --- src/isl/isl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/isl/isl.c b/src/isl/isl.c index 67e2ff6fae9..0e6f1e31d12 100644 --- a/src/isl/isl.c +++ b/src/isl/isl.c @@ -785,7 +785,20 @@ isl_calc_array_pitch_el_rows(const struct isl_device *dev, } assert(pitch_sa_rows % fmtl->bh == 0); - return pitch_sa_rows / fmtl->bh; + uint32_t pitch_el_rows = pitch_sa_rows / fmtl->bh; + + if (ISL_DEV_GEN(dev) >= 9 && + info->dim == ISL_SURF_DIM_3D && + tile_info->tiling != ISL_TILING_LINEAR) { + /* From the Skylake BSpec >> RENDER_SURFACE_STATE >> Surface QPitch: + * + * Tile Mode != Linear: This field must be set to an integer multiple + * of the tile height + */ + pitch_el_rows = isl_align(pitch_el_rows, tile_info->height); + } + + return pitch_el_rows; } /** -- 2.30.2