dri3: Flush XCB before blocking for special events
authorKeith Packard <keithp@keithp.com>
Tue, 26 Nov 2013 06:57:42 +0000 (22:57 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 31 Jan 2014 00:40:25 +0000 (16:40 -0800)
XCB doesn't flush the output buffer automatically, so we have to call
xcb_flush ourselves before waiting.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glx/dri3_glx.c

index 79bc5f0214d3670a3b362a6b09824294163457eb..c91f5000db5bbf27c737e63bd7749234681d3631 100644 (file)
@@ -406,6 +406,7 @@ dri3_wait_for_event(__GLXDRIdrawable *pdraw)
    xcb_generic_event_t *ev;
    xcb_present_generic_event_t *ge;
 
+   xcb_flush(c);
    ev = xcb_wait_for_special_event(c, priv->special_event);
    if (!ev)
       return false;
@@ -1075,6 +1076,7 @@ dri3_find_back(xcb_connection_t *c, struct dri3_drawable *priv)
          if (!buffer->busy)
             return b;
       }
+      xcb_flush(c);
       ev = xcb_wait_for_special_event(c, priv->special_event);
       if (!ev)
          return -1;