summaryrefslogtreecommitdiff
path: root/src/drmmode_display.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-03-09 18:28:47 +0900
committerMichel Dänzer <michel@daenzer.net>2016-03-23 16:52:59 +0900
commit7f3d0780ca65a90117c2a61362dbc0899bd9c0b0 (patch)
tree11674b05095f2afb217926f6955627260c3b67db /src/drmmode_display.c
parent3de480e83c0a1824838d662d6d67c9fe85277298 (diff)
Don't try DRI2/Present flipping while the HW cursor can't be used
Flipping doesn't interact correctly with SW cursor: A flip makes the SW cursor disappear. It will only appear again when the cursor is moved, but it will be surrounded by corruption, because the SW cursor code will restore stale screen contents at the old cursor location before drawing the cursor at the new location. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r--src/drmmode_display.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 3769e44c..3c873dc0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -860,7 +860,20 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
}
}
- if (drmmode_can_use_hw_cursor(crtc))
+ /* Compute index of this CRTC into xf86_config->crtc */
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ if (xf86_config->crtc[i] != crtc)
+ continue;
+
+ if (!crtc->enabled || drmmode_can_use_hw_cursor(crtc))
+ info->hwcursor_disabled &= ~(1 << i);
+ else
+ info->hwcursor_disabled |= 1 << i;
+
+ break;
+ }
+
+ if (!info->hwcursor_disabled)
xf86_reload_cursors(pScreen);
done: