aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-02-24 16:30:13 -0800
committerChad Versace <[email protected]>2017-03-28 09:44:44 -0700
commite9017d58dcd0117c67788f7e2084b09f5d47a279 (patch)
tree936363f5b519543121051095777d56049f455e0c /src/intel/isl/isl.c
parent23802dafc2d5e04e6d2d444855961082b5887400 (diff)
isl: Let isl_surf_init's caller set the exact row pitch (v2)
The caller does so by setting the new field isl_surf_init_info::row_pitch. v2: Validate the requested row_pitch. Reviewed-by: Jason Ekstrand <[email protected]> (v2)
Diffstat (limited to 'src/intel/isl/isl.c')
-rw-r--r--src/intel/isl/isl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 749fcdf46b0..98a1152c282 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -1118,10 +1118,22 @@ isl_calc_row_pitch(const struct isl_device *dev,
const uint32_t alignment =
isl_calc_row_pitch_alignment(surf_info, tile_info);
- const uint32_t row_pitch =
+ const uint32_t min_row_pitch =
isl_calc_min_row_pitch(dev, surf_info, tile_info, phys_slice0_sa,
alignment);
+ uint32_t row_pitch = min_row_pitch;
+
+ if (surf_info->row_pitch != 0) {
+ row_pitch = surf_info->row_pitch;
+
+ if (row_pitch < min_row_pitch)
+ return false;
+
+ if (row_pitch % alignment != 0)
+ return false;
+ }
+
const uint32_t row_pitch_tiles = row_pitch / tile_info->phys_extent_B.width;
if (row_pitch == 0)