<div dir="ltr"><div>Seems reasonable.  I think you know more of what you're doing here than I do anyway.<br><br></div><div>Acked-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 29, 2016 at 2:52 AM, Michel Dänzer <span dir="ltr"><<a href="mailto:michel@daenzer.net" target="_blank">michel@daenzer.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Michel Dänzer <<a href="mailto:michel.daenzer@amd.com">michel.daenzer@amd.com</a>><br>
<br>
Without this, the X server may accumulate stale Present event contexts<br>
if a client creates and destroys multiple swapchains using the same<br>
window.<br>
<br>
v2: Based on Chris Wilson's review:<br>
* Use xcb_present_select_input_<wbr>checked so that protocol errors<br>
  generated by old X servers can be handled gracefully<br>
* Use xcb_discard_reply() instead of free(xcb_request_check())<br>
<br>
Signed-off-by: Michel Dänzer <<a href="mailto:michel.daenzer@amd.com">michel.daenzer@amd.com</a>><br>
---<br>
 src/intel/vulkan/anv_wsi_x11.c | 5 +++++<br>
 1 file changed, 5 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_wsi_<wbr>x11.c b/src/intel/vulkan/anv_wsi_<wbr>x11.c<br>
index 2895d6b..3e089b7 100644<br>
--- a/src/intel/vulkan/anv_wsi_<wbr>x11.c<br>
+++ b/src/intel/vulkan/anv_wsi_<wbr>x11.c<br>
@@ -734,11 +734,16 @@ x11_swapchain_destroy(struct anv_swapchain *anv_chain,<br>
                       const VkAllocationCallbacks *pAllocator)<br>
 {<br>
    struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;<br>
+   xcb_void_cookie_t cookie;<br>
<br>
    for (uint32_t i = 0; i < chain->image_count; i++)<br>
       x11_image_finish(chain, pAllocator, &chain->images[i]);<br>
<br>
    xcb_unregister_for_special_<wbr>event(chain->conn, chain->special_event);<br>
+   cookie = xcb_present_select_input_<wbr>checked(chain->conn, chain->event_id,<br>
+                                             chain->window,<br>
+                                             XCB_PRESENT_EVENT_MASK_NO_<wbr>EVENT);<br>
+   xcb_discard_reply(chain->conn, cookie.sequence);<br>
<br>
    anv_free2(&chain->base.device-<wbr>>alloc, pAllocator, chain);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.8.1<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>