summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-13 10:52:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-13 10:52:47 +0100
commit87fc78ac4f6bbfa8e9427d392356ee26942bf955 (patch)
treee4851dfe1f93eaec43f2a15799a0bc5b6d90614b
parentcd381ad96eadb72eb1a983c973a5dd47f547fc8b (diff)
sna: Try to reuse the current cursor if we fail to update
As a last resort, continue to display the old cursor if we tried and failed to create a new cursor. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 251d305b..5e6de551 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4226,7 +4226,9 @@ sna_set_cursor_position(ScrnInfoPtr scrn, int x, int y)
if (arg.x < crtc->mode.HDisplay && arg.x > -sna->cursor.size &&
arg.y < crtc->mode.VDisplay && arg.y > -sna->cursor.size) {
cursor = __sna_get_cursor(sna, crtc);
- if (cursor == NULL) {
+ if (cursor == NULL)
+ cursor = sna_crtc->cursor;
+ if (cursor == NULL || cursor->size > sna->cursor.size) {
__DBG(("%s: failed to grab cursor, disabling\n",
__FUNCTION__));
goto disable;
@@ -4241,8 +4243,8 @@ sna_set_cursor_position(ScrnInfoPtr scrn, int x, int y)
arg.flags |= DRM_MODE_CURSOR_MOVE;
crtc->cursor_in_range = true;
} else {
-disable:
crtc->cursor_in_range = false;
+disable:
if (sna_crtc->cursor) {
arg.flags = DRM_MODE_CURSOR_BO;
arg.width = arg.height = 0;