<div dir="ltr"><div>This seems perfectly reasonable. I don't think rounding up to a power of two can hurt.<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 22, 2016 at 10:46 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The one I actually wanted to Cc you on :)<div class="HOEnZb"><div class="h5"><br>
<br>
On 20/08/16 00:44, Lionel Landwerlin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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" target="_blank">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(base<wbr>_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>
static inline uint32_t<br>
+isl_round_to_power_of_two(uin<wbr>t32_t value)<br>
+{<br>
+ return 1 << isl_log2u(value);<br>
+}<br>
+<br>
+static inline uint32_t<br>
isl_minify(uint32_t n, uint32_t levels)<br>
{<br>
if (unlikely(n == 0))<br>
</blockquote>
<br>
<br>
</div></div></blockquote></div><br></div>