<div dir="ltr">It's a bit annoying, but I think this would all make more sense if we moved 23 and 24 to before 19.  Then we could drop no_aux from 21.  Then again, I'm sure Ben has some good reason why that's not practical and I'm fine with leaving the order as-is.  It's hard to review but there's a lot of detangling going on so I think that's somewhat expected.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 19, 2017 at 2:38 AM, Daniel Stone <span dir="ltr"><<a href="mailto:daniels@collabora.com" target="_blank">daniels@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
<br>
There is nothing particularly useful to do currently if the update<br>
fails, but there is no point carrying on either. As a result, this has a<br>
behavior change.<br>
<br>
v2: Make the return type a bool (Topi)<br>
<br>
v3: Don't leak the bo if update_winsys_renderbuffer fails. (Jason)<br>
<br>
Signed-off-by: Ben Widawsky <<a href="mailto:benjamin.widawsky@intel.com">benjamin.widawsky@intel.com</a>><br>
Acked-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>> (v2)<br>
Signed-off-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
---<br>
 src/mesa/drivers/dri/i965/brw_<wbr>context.c       | 16 ++++++++++------<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c |  6 +++---<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h |  2 +-<br>
 3 files changed, 14 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_context.c b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
index 1a2b64f73e..3ae84fd332 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
@@ -1660,9 +1660,12 @@ intel_process_dri2_buffer(<wbr>struct brw_context *brw,<br>
       return;<br>
    }<br>
<br>
-   intel_update_winsys_<wbr>renderbuffer_miptree(brw, rb, bo,<br>
-                                            drawable->w, drawable->h,<br>
-                                            buffer->pitch);<br>
+   if (!intel_update_winsys_<wbr>renderbuffer_miptree(brw, rb, bo,<br>
+                                                 drawable->w, drawable->h,<br>
+                                                 buffer->pitch)) {<br>
+      brw_bo_unreference(bo);<br>
+      return;<br>
+   }<br>
<br>
    if (_mesa_is_front_buffer_<wbr>drawing(fb) &&<br>
        (buffer->attachment == __DRI_BUFFER_FRONT_LEFT ||<br>
@@ -1721,9 +1724,10 @@ intel_update_image_buffer(<wbr>struct brw_context *intel,<br>
    if (!buffer->aux_offset)<br>
       rb->no_aux = true;<br>
<br>
-   intel_update_winsys_<wbr>renderbuffer_miptree(intel, rb, buffer->bo,<br>
-                                            buffer->width, buffer->height,<br>
-                                            buffer->pitch);<br>
+   if (!intel_update_winsys_<wbr>renderbuffer_miptree(intel, rb, buffer->bo,<br>
+                                                 buffer->width, buffer->height,<br>
+                                                 buffer->pitch))<br>
+      return;<br>
<br>
    if (_mesa_is_front_buffer_<wbr>drawing(fb) &&<br>
        buffer_type == __DRI_IMAGE_BUFFER_FRONT &&<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index 9dca5cc435..edda132f7b 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -870,7 +870,7 @@ intel_miptree_create_for_<wbr>image(struct brw_context *intel,<br>
  * that will contain the actual rendering (which is lazily resolved to<br>
  * irb->singlesample_mt).<br>
  */<br>
-void<br>
+bool<br>
 intel_update_winsys_<wbr>renderbuffer_miptree(struct brw_context *intel,<br>
                                          struct intel_renderbuffer *irb,<br>
                                          struct brw_bo *bo,<br>
@@ -937,12 +937,12 @@ intel_update_winsys_<wbr>renderbuffer_miptree(struct brw_context *intel,<br>
          irb->mt = multisample_mt;<br>
       }<br>
    }<br>
-   return;<br>
+   return true;<br>
<br>
 fail:<br>
    intel_miptree_release(&irb-><wbr>singlesample_mt);<br>
    intel_miptree_release(&irb-><wbr>mt);<br>
-   return;<br>
+   return false;<br>
 }<br>
<br>
 struct intel_mipmap_tree*<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
index 8ec1278d0b..15e81300a2 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
@@ -717,7 +717,7 @@ intel_miptree_create_for_<wbr>image(struct brw_context *intel,<br>
                                uint32_t pitch,<br>
                                uint32_t layout_flags);<br>
<br>
-void<br>
+bool<br>
 intel_update_winsys_<wbr>renderbuffer_miptree(struct brw_context *intel,<br>
                                          struct intel_renderbuffer *irb,<br>
                                          struct brw_bo *bo,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.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>