From 074cf58769b38550a3f35d5ecb73333330cb2aed Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 16 Feb 2015 17:00:53 +0100 Subject: [PATCH] modesetting: Fix the error check from DRM_IOCTL_MODE_CURSOR2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error value isn't always -EINVAL, e.g. the kernel drm core returns -ENXIO when the corresponding ops doesn't exist. Without this fix, DRM_IOCTL_MODE_CURSOR2 would be dealt as success even if it shouldn't. Signed-off-by: Takashi Iwai Reviewed-by: Michel Dänzer Reviewed-by: Kenneth Graunke Signed-off-by: Hans de Goede --- hw/xfree86/drivers/modesetting/drmmode_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index fb9334834..fe8a20353 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -798,8 +798,8 @@ drmmode_set_cursor(xf86CrtcPtr crtc) cursor->bits->xhot, cursor->bits->yhot); if (!ret) return; - if (ret == -EINVAL) - use_set_cursor2 = FALSE; + + use_set_cursor2 = FALSE; } ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle,