diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-07 20:53:27 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-08 21:34:21 +0100 |
commit | 3bb7a530e77a5c6e8bae0fb14c570feafe37c2bd (patch) | |
tree | cef0e96701906d81bae920af7fd956582862a77f | |
parent | 1454df8caa51fff9810a9b792d17aa82b247a4ae (diff) |
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 <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_dri.c | 12 |
1 files 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; |