[PATCH] hw/xfree86: Restore API compatibility for cursor loading functions

Aaron Plattner aplattner at nvidia.com
Sun Apr 27 21:06:36 PDT 2014


On 04/25/2014 09:54 AM, Keith Packard wrote:
> Create load_cursor_image_check, load_cursor_argb_check,
> LoadCursorImageCheck and LoadCursorARGBCheck that can return failure
> and use them in preference to the old unchecked variants.
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>
> On IRC this morning, Hans and I thought this might provide the best
> compatibility story -- existing driver sources should work with only a
> recompile, which the existing ABI version checks will enforce. New
> drivers can provide the newer entry point where necessary and the
> server will choose the _check versions over the old ones when both are
> available.
>
> I've tested this with the upstream intel driver sources (without the
> return value change) and it works correctly
>
>   hw/xfree86/modes/xf86Crtc.h    |  8 ++++--
>   hw/xfree86/modes/xf86Cursors.c | 56 +++++++++++++++++++++++++++++++++---------
>   hw/xfree86/ramdac/IBM.c        |  4 +--
>   hw/xfree86/ramdac/TI.c         |  2 +-
>   hw/xfree86/ramdac/xf86Cursor.h | 36 +++++++++++++++++++++++++--
>   hw/xfree86/ramdac/xf86HWCurs.c | 14 +++++------
>   6 files changed, 95 insertions(+), 25 deletions(-)

[...]

> diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h
> index 1ecbdcd..a389a99 100644
> --- a/hw/xfree86/ramdac/xf86Cursor.h
> +++ b/hw/xfree86/ramdac/xf86Cursor.h
> @@ -12,7 +12,8 @@ typedef struct _xf86CursorInfoRec {
>       int MaxHeight;
>       void (*SetCursorColors) (ScrnInfoPtr pScrn, int bg, int fg);
>       void (*SetCursorPosition) (ScrnInfoPtr pScrn, int x, int y);
> -    Bool (*LoadCursorImage) (ScrnInfoPtr pScrn, unsigned char *bits);
> +    void (*LoadCursorImage) (ScrnInfoPtr pScrn, unsigned char *bits);
> +    Bool (*LoadCursorImageCheck) (ScrnInfoPtr pScrn, unsigned char *bits);

Doesn't this break the ABI vs. xorg-server-1.15.99.902?  I think just 
moving the new-vs-ABI17 void-returning fields to the end would fix it 
since xf86CreateCursorInfoRec() uses calloc() to allocate the structure.

>       void (*HideCursor) (ScrnInfoPtr pScrn);
>       void (*ShowCursor) (ScrnInfoPtr pScrn);
>       unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr);
> @@ -20,11 +21,42 @@ typedef struct _xf86CursorInfoRec {
>
>   #ifdef ARGB_CURSOR
>       Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
> -    Bool (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
> +    void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
> +    Bool (*LoadCursorARGBCheck) (ScrnInfoPtr, CursorPtr);
>   #endif
>
>   } xf86CursorInfoRec, *xf86CursorInfoPtr;



More information about the xorg-devel mailing list