• Michael Thayer's avatar
    xfree86: Immediately handle failure to set HW cursor, v5 · c02f6a68
    Michael Thayer authored
    Based on v4 by Alexandre Courbot <acourbot@nvidia.com>
    
    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.
    
    v5: Updated the patch to apply to current git HEAD, split up into two
    patches (server and modesetting driver) and adjusted the code slightly
    to match surrounding code.  I also removed the new exported function
    ShowCursorCheck(), as instead just changing ShowCursor() to return Bool
    should not affect its current callers.
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: Michael Thayer's avatarMichael Thayer <michael.thayer@oracle.com>
    c02f6a68
xf86HWCurs.c 19.1 KB