[PATCH xserver] Switch to SW cursor right after HW cursor failure
Michael Thayer
michael.thayer at oracle.com
Fri Mar 18 09:09:43 UTC 2016
Hello Alexandre,
In that context, see this patch to Modesetting which I send a couple of
weeks ago, which should incidentally also fix your issue:
https://patchwork.freedesktop.org/patch/75985/
Regards,
Michael
On 18.03.2016 09:19, Alexandre Courbot wrote:
> Modesetting currently signals a failure to display the HW cursor by
> setting its size to 0 in drmmode_set_cursor(). xf86CursorSetCursor()
> will then detect that condition and switch to the SW cursor upon the
> next invokation.
>
> The problem is that said invokation may not come before a while (i.e.
> before the cursor changes shape), and thus the user may be left with an
> invisible cursor for an undefined period of time. Therefore, check
> whether the HW cursor size has been set to 0 after calling
> xf86SetCursor(), and fall through the SW cursor fallback if this is the
> case in order to display the cursor immediately.
>
> Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
> ---
> hw/xfree86/ramdac/xf86Cursor.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
> index c061b8028ca8..08868ffb2459 100644
> --- a/hw/xfree86/ramdac/xf86Cursor.c
> +++ b/hw/xfree86/ramdac/xf86Cursor.c
> @@ -357,7 +357,15 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
> ScreenPriv->isUp = TRUE;
>
> miPointerSetWaitForUpdate(pScreen, !infoPtr->pScrn->silkenMouse);
> - return;
> +
> + /* even if xf86SetCursor returns success, modesetting may
> + * have set the cursor size to 0 in order to switch to software
> + * cursor. If this happens, just fall through to switch to
> + * software cursor. If we don't do it here, the cursor will
> + * remain invisible until the next call to this function, which
> + * may not happen before a while */
> + if (!(infoPtr->MaxWidth == 0 || infoPtr->MaxHeight == 0))
> + return;
> }
> }
>
>
--
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt
ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
More information about the xorg-devel
mailing list