[Mesa-dev] [PATCH 03/14] isl: Rework the way we handle surface padding

Chad Versace chad.versace at intel.com
Tue Jul 12 18:50:12 UTC 2016


On Sat 09 Jul 2016, Jason Ekstrand wrote:
> ---
>  src/intel/isl/isl.c | 52 +++++++++++++++++++++++++---------------------------
>  1 file changed, 25 insertions(+), 27 deletions(-)
> 
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> index decba3d..6f57ac2 100644
> --- a/src/intel/isl/isl.c
> +++ b/src/intel/isl/isl.c



>  bool
> @@ -1108,10 +1103,13 @@ isl_surf_init_s(const struct isl_device *dev,
>                                     array_pitch_span, &image_align_sa,
>                                     &phys_level0_sa, &phys_slice0_sa);
>  
> -   const uint32_t total_h_el =
> -      isl_calc_total_height_el(dev, info, &tile_info,
> -                               phys_level0_sa.array_len, row_pitch,
> -                               array_pitch_el_rows);
> +   uint32_t total_h_el = phys_level0_sa.array_len * array_pitch_el_rows;
> +

Here...

> +   uint32_t pad_bytes;
> +   isl_apply_surface_padding(dev, info, &tile_info, &total_h_el, &pad_bytes);
> +
> +   /* Be sloppy. Align any leftover padding to a row boundary. */
> +   total_h_el += isl_align_div_npot(pad_bytes, row_pitch);

...to here feels weird. isl_apply_surface_padding() applies some
padding, but not all of it. It expects the caller to apply additional
padding itself using pad_bytes. But isl_apply_surface_padding() has
already calculated pad_bytes, so why doesn't the function apply the
pad_bytes padding for the caller?

>  
>     const uint32_t size =
>        row_pitch * isl_align(total_h_el, tile_info.height);
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list