<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 12, 2016 at 11:50 AM, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@intel.com" target="_blank">chad.versace@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat 09 Jul 2016, Jason Ekstrand wrote:<br>
> ---<br>
>  src/intel/isl/isl.c | 52 +++++++++++++++++++++++++---------------------------<br>
>  1 file changed, 25 insertions(+), 27 deletions(-)<br>
><br>
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
> index decba3d..6f57ac2 100644<br>
> --- a/src/intel/isl/isl.c<br>
> +++ b/src/intel/isl/isl.c<br>
<br>
<br>
<br>
</span><span class="">>  bool<br>
> @@ -1108,10 +1103,13 @@ isl_surf_init_s(const struct isl_device *dev,<br>
>                                     array_pitch_span, &image_align_sa,<br>
>                                     &phys_level0_sa, &phys_slice0_sa);<br>
><br>
> -   const uint32_t total_h_el =<br>
> -      isl_calc_total_height_el(dev, info, &tile_info,<br>
> -                               phys_level0_sa.array_len, row_pitch,<br>
> -                               array_pitch_el_rows);<br>
> +   uint32_t total_h_el = phys_level0_sa.array_len * array_pitch_el_rows;<br>
> +<br>
<br>
</span>Here...<br>
<span class=""><br>
> +   uint32_t pad_bytes;<br>
> +   isl_apply_surface_padding(dev, info, &tile_info, &total_h_el, &pad_bytes);<br>
> +<br>
> +   /* Be sloppy. Align any leftover padding to a row boundary. */<br>
> +   total_h_el += isl_align_div_npot(pad_bytes, row_pitch);<br>
<br>
</span>...to here feels weird. isl_apply_surface_padding() applies some<br>
padding, but not all of it. It expects the caller to apply additional<br>
padding itself using pad_bytes. But isl_apply_surface_padding() has<br>
already calculated pad_bytes, so why doesn't the function apply the<br>
pad_bytes padding for the caller?<br></blockquote><div><br></div><div>Keep reading.  I think the correct thing would probably be to have it simply compute padding and make the caller do all the adding.<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
><br>
>     const uint32_t size =<br>
>        row_pitch * isl_align(total_h_el, tile_info.height);<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</span><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>