[PATCH] modesetting: Fix software cursor fallback
Rob Clark
robdclark at gmail.com
Mon May 4 10:21:51 PDT 2015
On Fri, May 1, 2015 at 11:43 AM, Adel Gadllah <adel.gadllah at gmail.com> wrote:
> 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.
Might not hurt to add something to the commit msg about falling
through to drmModeSetCursor() path (which does properly handle -ENXIO
and other non-EINVAL errors properly) since you can't easily see that
from the diffstat..
either way,
Reviewed-by: Rob Clark <robdclark at gmail.com>
>
> References: https://bugzilla.redhat.com/show_bug.cgi?id=1205725
> Signed-off-by: Adel Gadllah <adel.gadllah at gmail.com>
> ---
> 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 824500b..912abda 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -396,10 +396,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,
> --
> 2.1.0
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
More information about the xorg-devel
mailing list