<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 23, 2016 at 5:41 PM, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Aug 19, 2016 at 7:44 PM, Lionel Landwerlin<br>
<<a href="mailto:llandwerlin@gmail.com">llandwerlin@gmail.com</a>> wrote:<br>
> A few inline asserts in anv assume alignments are power of 2, but with<br>
> formats like R8G8B8 we have odd alignments.<br>
><br>
> Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
> ---<br>
> src/intel/isl/isl.c | 1 +<br>
> src/intel/isl/isl_priv.h | 6 ++++++<br>
> 2 files changed, 7 insertions(+)<br>
><br>
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
> index 18e95e2..dfe0fc1 100644<br>
> --- a/src/intel/isl/isl.c<br>
> +++ b/src/intel/isl/isl.c<br>
> @@ -1182,6 +1182,7 @@ isl_surf_init_s(const struct isl_device *dev,<br>
> base_alignment = MAX(base_alignment, fmtl->bpb / 8);<br>
> }<br>
> }<br>
> + base_alignment = isl_round_to_power_of_two(<wbr>base_alignment);<br>
> } else {<br>
> assert(phys_slice0_sa.w % fmtl->bw == 0);<br>
> const uint32_t total_w_el = phys_slice0_sa.width / fmtl->bw;<br>
> diff --git a/src/intel/isl/isl_priv.h b/src/intel/isl/isl_priv.h<br>
> index 3a7af1a..cc9991c 100644<br>
> --- a/src/intel/isl/isl_priv.h<br>
> +++ b/src/intel/isl/isl_priv.h<br>
> @@ -99,6 +99,12 @@ isl_log2u(uint32_t n)<br>
> }<br>
><br>
> static inline uint32_t<br>
> +isl_round_to_power_of_two(<wbr>uint32_t value)<br>
> +{<br>
> + return 1 << isl_log2u(value);<br>
<br>
</div></div>This will round down. Is that desired? (Don't know, just asking... I<br>
kind of assumed you'd want to round up to the nearest power of two,<br>
but perhaps not.)<br></blockquote><div><br></div><div>You're right! R-B recinded. If you rounded up to a power of two, that would work fine.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
> +}<br>
> +<br>
> +static inline uint32_t<br>
> isl_minify(uint32_t n, uint32_t levels)<br>
> {<br>
> if (unlikely(n == 0))<br>
> --<br>
> 2.9.3<br>
><br>
> ______________________________<wbr>_________________<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/<wbr>mailman/listinfo/mesa-dev</a><br>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>