From be91f23e3b9381711c21978001862a6edb0bb2fd Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 6 Jan 2016 15:43:11 -0800 Subject: [PATCH] isl: Fix image alignment calculation The previous code was resulting in an alignment of 0. Signed-off-by: Jordan Justen --- src/isl/isl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/isl/isl.c b/src/isl/isl.c index 1fd7d01d1c3..edc540b7ad2 100644 --- a/src/isl/isl.c +++ b/src/isl/isl.c @@ -1071,8 +1071,9 @@ isl_surf_init_s(const struct isl_device *dev, const uint32_t size = row_pitch * isl_align(total_h_sa, tile_info.height); /* Alignment of surface base address, in bytes */ - uint32_t base_alignment = info->min_alignment; - base_alignment = isl_align(base_alignment, tile_info.size); + uint32_t base_alignment = MAX(1, info->min_alignment); + assert(isl_is_pow2(base_alignment) && isl_is_pow2(tile_info.size)); + base_alignment = MAX(base_alignment, tile_info.size); *surf = (struct isl_surf) { .dim = info->dim, -- 2.30.2