From 3bb7a530e77a5c6e8bae0fb14c570feafe37c2bd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 7 Jul 2012 20:53:27 +0100 Subject: [PATCH] sna/dri: Fix cross-chaining of pageflip vs vblank And double-check that the drawable is still flippable before completing the delay exchange. Signed-off-by: Chris Wilson --- src/sna/sna_dri.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 83465541..e5203942 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -1083,9 +1083,17 @@ static void chain_swap(struct sna *sna, int type; assert(chain == sna_dri_window_get_chain((WindowPtr)draw)); + DBG(("%s: chaining type=%d\n", __FUNCTION__, chain->type)); + switch (chain->type) { + case DRI2_XCHG_THROTTLE: + case DRI2_SWAP_THROTTLE: + break; + default: + return; + } - /* In theory, it shoudln't be possible for cross-chaining to occur! */ - if (chain->type == DRI2_XCHG_THROTTLE) { + if (chain->type == DRI2_XCHG_THROTTLE && + can_exchange(sna, draw, chain->front, chain->back)) { DBG(("%s: performing chained exchange\n", __FUNCTION__)); sna_dri_exchange_buffers(draw, chain->front, chain->back); type = DRI2_EXCHANGE_COMPLETE;