From: Nanley Chery Date: Tue, 23 Apr 2019 22:28:18 +0000 (-0700) Subject: isl: Round up some pitches to 512B for Gen12's CCS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07e16221d975bbc286e89bffadf60f36afcddb7f;p=mesa.git 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 Reviewed-by: Kenneth Graunke --- 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)