From 9306a148cbf1a2471540f3301136d57e93197593 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 8 Jun 2014 09:40:19 +0100 Subject: sna/dri2: Use xchg for offscreen drawables where applicable Signed-off-by: Chris Wilson --- src/sna/sna_dri2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 314651e6..622a8e6f 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -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) -- cgit v1.2.3