summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-07-17 10:06:06 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-07-17 10:06:06 +0100
commit62f62f70eda97a3ef18c5144031fdf1cb2b7dad0 (patch)
treecd5a377c36f2a64d2ede3386de18e4879cc08cb4 /src/sna/sna_dri2.c
parent95f08c171ebd9b594112ab006c4460702a22bec1 (diff)
sna: Avoid confusing failure to flip and flipping zero CRTC
During the present unflip path we blindly try to restore the original mode after a flip failure. However, it confuses flipping zero CRTC with a genuine failure. This has the result of undoing a DPMS change (e.g. xset dpms force dpms) under a DRI3 compositor. Reported-by: Jiri Slaby <jirislaby@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81456 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r--src/sna/sna_dri2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 0b343cec..be5d8141 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1560,11 +1560,13 @@ can_flip(struct sna * sna,
if (draw->type == DRAWABLE_PIXMAP)
return false;
- if (!sna->scrn->vtSema) {
- DBG(("%s: no, not attached to VT\n", __FUNCTION__));
+ if (!sna->mode.front_active) {
+ DBG(("%s: no, active CRTC\n", __FUNCTION__));
return false;
}
+ assert(sna->scrn->vtSema);
+
if ((sna->flags & (SNA_HAS_FLIP | SNA_HAS_ASYNC_FLIP)) == 0) {
DBG(("%s: no, pageflips disabled\n", __FUNCTION__));
return false;