[Mesa-dev] [PATCH] dri2: Remove the extra roundtrip during SwapBuffers

Chris Wilson chris at chris-wilson.co.uk
Sun Aug 11 05:11:09 PDT 2013


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 <eric at anholt.net>
Date:   Tue Sep 25 12:26:39 2012 -0700

    glx: Replace DRI2SwapBuffers() custom protocol with XCB.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Marek Olšák <maraeo at gmail.com>
Cc: Eric Anholt <eric at 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



More information about the mesa-dev mailing list