[PATCH RESEND xserver v3] xfree86: Immediately handle failure to set HW cursor

Alexandre Courbot acourbot at nvidia.com
Fri May 13 10:36:01 UTC 2016

On 05/13/2016 01:04 AM, Adam Jackson wrote:
> On Thu, 2016-05-12 at 16:04 +0900, Alexandre Courbot wrote:
>> There is currently no reliable way to report failure to set a HW
>> cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM
>> ioctl fails (which currently happens at least with modesetting on Tegra
>> for format incompatibility reasons).
>> As failures are currently handled by setting the HW cursor size to
>> (0,0), the fallback to SW cursor will not happen until the next time the
>> cursor changes and xf86CursorSetCursor() is called again. In the
>> meantime, the cursor will be invisible to the user.
>> This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and
>> _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans.
>> This allows to propagate errors up to xf86CursorSetCursor(), which can
>> then fall back to using the SW cursor immediately.
>> Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
>> Cc: Michael Thayer <michael.thayer at oracle.com>
>> ---
>> Hoping to see this patch go through - all issues in the previous versions
>> have been addressed, and the logic it introduces seems saner than setting
>> the cursor size to (0, 0).
> How are external drivers to know whether .set_cursor_check is available
> at compile time? ABI_VIDEODRV_VERSION > 21.0 ? (That's a fine answer,
> just want to make sure it's explicit.)

Yes, that's probably how it should be done - should I add a comment 
somewhere in the code to specify the minimum ABI version? I haven't 
found any such comment for other _check variants though.

More information about the xorg-devel mailing list