From: Jason Ekstrand Date: Mon, 5 Mar 2018 23:06:58 +0000 (-0800) Subject: intel/isl: Add units to view dimensions in isl_surf_get_uncompressed_surf X-Git-Tag: upstream/22.3.5~19151 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ab2f7d489db67323bb0f7daf7062d23061a30a6;p=platform%2Fupstream%2Fmesa.git intel/isl: Add units to view dimensions in isl_surf_get_uncompressed_surf This makes things a bit more clear. Reviewed-by: Topi Pohjolainen Acked-by: Ivan Briano Reviewed-by: Kenneth Graunke Part-of: --- diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c index 53adb4d..40cdfbd 100644 --- a/src/intel/isl/isl.c +++ b/src/intel/isl/isl.c @@ -2847,13 +2847,14 @@ isl_surf_get_uncompressed_surf(const struct isl_device *dev, assert(isl_format_get_layout(view->format)->bpb == fmtl->bpb); assert(view->levels == 1); - const uint32_t view_width = + const uint32_t view_width_px = isl_minify(surf->logical_level0_px.width, view->base_level); - const uint32_t view_height = + const uint32_t view_height_px = isl_minify(surf->logical_level0_px.height, view->base_level); - const uint32_t ucompr_width = isl_align_div_npot(view_width, fmtl->bw); - const uint32_t ucompr_height = isl_align_div_npot(view_height, fmtl->bh); + assert(surf->samples == 1); + const uint32_t view_width_el = isl_align_div_npot(view_width_px, fmtl->bw); + const uint32_t view_height_el = isl_align_div_npot(view_height_px, fmtl->bh); /* If we ever enable 3D block formats, we'll need to re-think this */ assert(fmtl->bd == 1); @@ -2926,10 +2927,10 @@ isl_surf_get_uncompressed_surf(const struct isl_device *dev, /* We're making an uncompressed view here. The image dimensions * need to be scaled down by the block size. */ - assert(ucompr_surf->logical_level0_px.width == view_width); - assert(ucompr_surf->logical_level0_px.height == view_height); - ucompr_surf->logical_level0_px.width = ucompr_width; - ucompr_surf->logical_level0_px.height = ucompr_height; + assert(ucompr_surf->logical_level0_px.width == view_width_px); + assert(ucompr_surf->logical_level0_px.height == view_height_px); + ucompr_surf->logical_level0_px.width = view_width_el; + ucompr_surf->logical_level0_px.height = view_height_el; ucompr_surf->phys_level0_sa = isl_surf_get_phys_level0_el(surf); *x_offset_el = isl_assert_div(x_offset_sa, fmtl->bw);