<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 23, 2017 at 10:21 PM, Ben Widawsky <span dir="ltr"><<a href="mailto:ben@bwidawsk.net" target="_blank">ben@bwidawsk.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">v2: Put the commit message as a comment (Topi)<br>
<br>
Cc: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.com</a>><br>
Cc: Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a><wbr>><br>
Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
Signed-off-by: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
Acked-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/<wbr>intel_screen.c | 5 ++++-<br>
1 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_screen.c b/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
index 85070bb54d..12b3b071e4 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
@@ -1023,7 +1023,10 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)<br>
if (parent == NULL || parent->planar_format == NULL) {<br>
if (is_aux) {<br>
offset = parent->aux_offset;<br>
- stride = ALIGN(parent->pitch / 32, 128);<br>
+ /* Make CCS stride match kernel's expectations. Mesa's internals<br>
+ * expect: stride = ALIGN(parent->pitch / 32, 128)<br>
+ */<br>
+ stride = ALIGN(parent->pitch / 64, 128);<br></blockquote><div><br></div><div>Does the kernel expect the alignment to be 128 or 64? Given that ville likes 64-wide tiles, I think it should be 64. Really, I think the more accurate calculation would be<br><br></div><div>stride = ALIGN(parent->pitch, 4096) / 64;<br><br></div><div>4096 is the stride in bytes in the primary surface required to cross a single CCS tile. The calculation you have above will work in the sense that the worst that happens is for it to align up a bit too far. In any case, what matters is that we a) have enough space and b) exactly match the kernel's calculation.<br><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">
height = ALIGN(DIV_ROUND_UP(parent-><wbr>height, 16), 32);<br>
dri_format = parent->dri_format;<br>
goto done;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
</font></span></blockquote></div><br></div></div>