summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAdel Gadllah <adel.gadllah@gmail.com>2015-05-01 17:43:41 +0200
committerKeith Packard <keithp@keithp.com>2015-05-11 15:47:52 -0700
commitc3ce9d8fd404ca1d4697a104ce4899525dd43c51 (patch)
treefad725ed138def252b6f46fc51933d6377bb438a /hw
parent81a51a6cace6fdb54999ccdf1533dc28a2222bb9 (diff)
modesetting: Fix software cursor fallback
The code in drmmode_set_cursor does not properly handle the case where drmModeSetCursor2 returns any other error than EINVAL and silently fails to set a cursor. So only return when the drmModeSetCursor2 succeeds (i.e returns 0) and disable the cursor2 usage on EINVAL. References: https://bugzilla.redhat.com/show_bug.cgi?id=1205725 Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 1ea799b3a..a8de5f9e7 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -427,10 +427,10 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
handle, ms->cursor_width, ms->cursor_height,
cursor->bits->xhot, cursor->bits->yhot);
+ if (!ret)
+ return;
if (ret == -EINVAL)
use_set_cursor2 = FALSE;
- else
- return;
}
ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle,