Currently we call XSync() to run the event queue to catch the invalidate event before we wait for the reply from the DRI2SwapBuffers request. However, the XServer sends the DRI2InvalidateNotify event before sending the DRI2SwapBuffers reply and so the invalidate event is processed in the normal manner by xcb before it returns the DRI2SwapBuffers reply without having to add an extra round-trip.
The XSync was introduced with commit 8c472b8f6a612a810aec34283d90bb5aa88bf855 Author: Eric Anholt <e...@anholt.net> Date: Tue Sep 25 12:26:39 2012 -0700 glx: Replace DRI2SwapBuffers() custom protocol with XCB. Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> Cc: Marek Olšák <mar...@gmail.com> Cc: Eric Anholt <e...@anholt.net> --- src/glx/dri2_glx.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index c54edac..899bb1f 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -812,13 +812,7 @@ dri2XcbSwapBuffers(Display *dpy, * to do so some time before reusing a (non-pageflipped) backbuffer. * Otherwise, the new rendering could get ahead of the X Server's * dispatch of the swapbuffer and you'd display garbage. - * - * We use XSync() first to reap the invalidate events through the event - * filter, to ensure that the next drawing doesn't use an invalidated - * buffer. */ - XSync(dpy, False); - swap_buffers_reply = xcb_dri2_swap_buffers_reply(c, swap_buffers_cookie, NULL); if (swap_buffers_reply) { -- 1.8.4.rc2 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev