[PATCH 2/4] modesetting: Fix the error check from DRM_IOCTL_MODE_CURSOR2

Michel Dänzer michel at daenzer.net
Mon Feb 16 19:15:10 PST 2015


On 17.02.2015 01:00, Takashi Iwai wrote:
> 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 at suse.de>
> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index 1ea799b3a244..25d16a233103 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -427,7 +427,7 @@ 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 == -EINVAL)
> +        if (ret)
>              use_set_cursor2 = FALSE;
>          else
>              return;
> 

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list