summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2019-04-23 15:28:18 -0700
committerNanley Chery <[email protected]>2019-10-28 10:47:05 -0700
commit07e16221d975bbc286e89bffadf60f36afcddb7f (patch)
tree5022369f5c58b8c41897e2aed66ecf4cd3ec2c80
parentf6aefa94cc83c92e0ed18aea16e63254a0ba4c30 (diff)
isl: Round up some pitches to 512B for Gen12's CCS
Gen12's CCS requires that the main surface have a pitch aligned to 512B. v2. Provide a BSpec citation. (Ken) Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/intel/isl/isl.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 850e5b1ee95..39e5dca5307 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -1386,18 +1386,26 @@ isl_calc_row_pitch(const struct isl_device *dev,
isl_calc_min_row_pitch(dev, surf_info, tile_info, phys_total_el,
alignment_B);
- uint32_t row_pitch_B = min_row_pitch_B;
-
if (surf_info->row_pitch_B != 0) {
- row_pitch_B = surf_info->row_pitch_B;
-
- if (row_pitch_B < min_row_pitch_B)
+ if (surf_info->row_pitch_B < min_row_pitch_B)
return false;
- if (row_pitch_B % alignment_B != 0)
+ if (surf_info->row_pitch_B % alignment_B != 0)
return false;
}
+ const uint32_t row_pitch_B =
+ surf_info->row_pitch_B != 0 ?
+ surf_info->row_pitch_B :
+ /* According to BSpec: 44930, Gen12's CCS-compressed surface pitches
+ * must be 512B-aligned.
+ */
+ ISL_DEV_GEN(dev) >= 12 &&
+ isl_format_supports_ccs_e(dev->info, surf_info->format) ?
+ isl_align(min_row_pitch_B, 512) :
+ /* Else */
+ min_row_pitch_B;
+
const uint32_t row_pitch_tl = row_pitch_B / tile_info->phys_extent_B.width;
if (row_pitch_B == 0)