From: Jordan Justen Date: Wed, 6 Jan 2016 23:43:11 +0000 (-0800) Subject: isl: Fix image alignment calculation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be91f23e3b9381711c21978001862a6edb0bb2fd;p=mesa.git isl: Fix image alignment calculation The previous code was resulting in an alignment of 0. Signed-off-by: Jordan Justen --- 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,