modesetting: Fix the error check from DRM_IOCTL_MODE_CURSOR2

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 <tiwai@suse.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 074cf58769)
This commit is contained in:
Takashi Iwai 2015-02-16 17:00:53 +01:00 committed by Adam Jackson
parent ee0fd6b2c6
commit 15f8aaa786

View file

@ -504,8 +504,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,