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

Jason Ekstrand jason at jlekstrand.net
Tue Jul 12 19:28:33 UTC 2016


On Tue, Jul 12, 2016 at 11:50 AM, Chad Versace <chad.versace at intel.com>
wrote:

> 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?
>

Keep reading.  I think the correct thing would probably be to have it
simply compute padding and make the caller do all the adding.
--Jason


>
> >
> >     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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160712/aac12e3f/attachment-0001.html>


More information about the mesa-dev mailing list