<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">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 | 18 ++++++++++++++----<br>
 1 file changed, 14 insertions(+), 4 deletions(-)<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 971013f2dd..85070bb54d 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
@@ -809,7 +809,7 @@ intel_query_image(__DRIimage *image, int attrib, int *value)<br>
    case __DRI_IMAGE_ATTRIB_FOURCC:<br>
       return intel_lookup_fourcc(image-><wbr>dri_format, value);<br>
    case __DRI_IMAGE_ATTRIB_NUM_PLANES:<br>
-      *value = 1;<br>
+      *value = image->aux_offset ? 2: 1;<br>
       return true;<br>
    case __DRI_IMAGE_ATTRIB_OFFSET:<br>
       *value = image->offset;<br>
@@ -1018,9 +1018,18 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)<br>
     int width, height, offset, stride, dri_format, index;<br>
     struct intel_image_format *f;<br>
     __DRIimage *image;<br>
-<br>
-    if (parent == NULL || parent->planar_format == NULL)<br>
-        return NULL;<br>
+    bool is_aux = parent->aux_offset && plane == 1;<br></blockquote><div><br></div><div>Why is this outside the if?  It seems to only apply when other plane stuff is NULL as below.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<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>
+          height = ALIGN(DIV_ROUND_UP(parent-><wbr>height, 16), 32);<br>
+          dri_format = parent->dri_format;<br>
+          goto done;<br></blockquote><div><br></div><div>Do we really need the goto?  Why not just put the stuff below in an else?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+       }<br>
+       return NULL;<br>
+    }<br>
<br>
     f = parent->planar_format;<br>
<br>
@@ -1034,6 +1043,7 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)<br>
     offset = parent->offsets[index];<br>
     stride = parent->strides[index];<br>
<br>
+done:<br>
     image = intel_allocate_image(parent-><wbr>screen, dri_format, loaderPrivate);<br>
     if (image == NULL)<br>
        return NULL;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<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>
</font></span></blockquote></div><br></div></div>