sna/dri2: Use xchg for offscreen drawables where applicable
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 8 Jun 2014 08:40:19 +0000 (09:40 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 8 Jun 2014 13:26:35 +0000 (14:26 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_dri2.c

index 314651e..622a8e6 100644 (file)
@@ -2485,9 +2485,12 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 
 blit:
        DBG(("%s -- blit\n", __FUNCTION__));
-       __sna_dri2_copy_region(sna, draw, NULL, back, front, false);
        if (info)
                sna_dri2_event_free(sna, draw, info);
+       if (can_xchg(sna, draw, front, back))
+               sna_dri2_exchange_buffers(draw, front, back);
+       else
+               __sna_dri2_copy_region(sna, draw, NULL, back, front, false);
 skip:
        DBG(("%s: unable to show frame, unblocking client\n", __FUNCTION__));
        if (crtc == NULL)