diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-31 21:41:45 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-02 08:32:10 +0100 |
commit | 1b5f91e14226799ef4ec6461de93fa9193ef2ebc (patch) | |
tree | 4a091587d849f981d7927372d4230038f6d66ecd /src/sna | |
parent | 0ee1940a4ffc1901534fa3bf15adb427527a8c20 (diff) |
sna/dri2: Decouple spent flip
If the flip is already completed before we finish the previous flip, the
drawable has been replaced already and we can unchain the flip queue.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna_dri2.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index a832099c..497bd5bb 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -1786,11 +1786,24 @@ sna_dri2_flip_continue(struct sna *sna, struct sna_dri2_frame_event *info) if (bo != sna_pixmap(sna->front)->gpu_bo) return false; - info->count = sna_page_flip(sna, bo, info, info->pipe); - if (!info->count) + if (bo == sna->dri2.scanout[0].bo) { + DBG(("%s: flip chain already complete\n", __FUNCTION__)); + + if (info->draw) { + sna_dri2_remove_frame_event((WindowPtr)info->draw, info); + if (info->chain) + chain_swap(sna, info->draw, info->chain); + } + + info->draw = NULL; return false; + } else { + info->count = sna_page_flip(sna, bo, info, info->pipe); + if (!info->count) + return false; - update_scanout(sna, info, bo, info->front->name); + update_scanout(sna, info, bo, info->front->name); + } } else { info->type = -info->mode; |