[PATCH] Fix commit 901fbfb by renaming load_cursor_argb() etc to force build breaks

Michael Thayer michael.thayer at oracle.com
Wed Apr 23 11:36:34 PDT 2014


Commit 901fbfb changed the return value of load_cursor_argb() and other
APIs which caused silent breakage of drivers.  Rename the changed APIs to
make the breakage visible.  The ABI version was already bumped with the
original commit.

Signed-off-by: Michael Thayer <michael.thayer at oracle.com>
---
Sorry for the unimaginitive new names...

Regards,

Michael

 hw/xfree86/modes/xf86Crtc.h        |  4 ++--
 hw/xfree86/modes/xf86Cursors.c     | 22 +++++++++++-----------
 hw/xfree86/ramdac/IBM.c            |  4 ++--
 hw/xfree86/ramdac/TI.c             |  2 +-
 hw/xfree86/ramdac/xf86Cursor.c     | 10 +++++-----
 hw/xfree86/ramdac/xf86Cursor.h     |  4 ++--
 hw/xfree86/ramdac/xf86CursorPriv.h |  2 +-
 hw/xfree86/ramdac/xf86HWCurs.c     | 16 ++++++++--------
 8 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 5407deb..286b785 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -187,13 +187,13 @@ typedef struct _xf86CrtcFuncs {
      * Load monochrome image
      */
     Bool
-     (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image);
+     (*load_cursor_image2) (xf86CrtcPtr crtc, CARD8 *image);
 
     /**
      * Load ARGB image
      */
     Bool
-     (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image);
+     (*load_cursor_argb2) (xf86CrtcPtr crtc, CARD32 *image);
 
     /**
      * Clean up driver-specific bits of the crtc
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 10ef6f6..ea3cd64 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -244,7 +244,7 @@ xf86_crtc_convert_cursor_to_argb(xf86CrtcPtr crtc, unsigned char *src)
                 bits = 0;
             cursor_image[y * cursor_info->MaxWidth + x] = bits;
         }
-    return crtc->funcs->load_cursor_argb(crtc, cursor_image);
+    return crtc->funcs->load_cursor_argb2(crtc, cursor_image);
 }
 
 /*
@@ -269,7 +269,7 @@ xf86_set_cursor_colors(ScrnInfoPtr scrn, int bg, int fg)
         xf86CrtcPtr crtc = xf86_config->crtc[c];
 
         if (crtc->enabled && !crtc->cursor_argb) {
-            if (crtc->funcs->load_cursor_image)
+            if (crtc->funcs->load_cursor_image2)
                 crtc->funcs->set_cursor_colors(crtc, bg, fg);
             else if (bits)
                 xf86_crtc_convert_cursor_to_argb(crtc, bits);
@@ -450,7 +450,7 @@ xf86_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *src)
                     set_bit(cursor_image, cursor_info, x, y, TRUE);
             }
     }
-    return crtc->funcs->load_cursor_image(crtc, cursor_image);
+    return crtc->funcs->load_cursor_image2(crtc, cursor_image);
 }
 
 /*
@@ -466,10 +466,10 @@ xf86_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src)
         xf86CrtcPtr crtc = xf86_config->crtc[c];
 
         if (crtc->enabled) {
-            if (crtc->funcs->load_cursor_image) {
+            if (crtc->funcs->load_cursor_image2) {
                 if (!xf86_crtc_load_cursor_image(crtc, src))
                     return FALSE;
-            } else if (crtc->funcs->load_cursor_argb) {
+            } else if (crtc->funcs->load_cursor_argb2) {
                 if (!xf86_crtc_convert_cursor_to_argb(crtc, src))
                     return FALSE;
             } else
@@ -549,7 +549,7 @@ xf86_crtc_load_cursor_argb(xf86CrtcPtr crtc, CursorPtr cursor)
             cursor_image[y * image_width + x] = bits;
         }
 
-    return crtc->funcs->load_cursor_argb(crtc, cursor_image);
+    return crtc->funcs->load_cursor_argb2(crtc, cursor_image);
 }
 
 static Bool
@@ -594,14 +594,14 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags)
 
     cursor_info->SetCursorColors = xf86_set_cursor_colors;
     cursor_info->SetCursorPosition = xf86_set_cursor_position;
-    cursor_info->LoadCursorImage = xf86_load_cursor_image;
+    cursor_info->LoadCursorImage2 = xf86_load_cursor_image;
     cursor_info->HideCursor = xf86_hide_cursors;
     cursor_info->ShowCursor = xf86_show_cursors;
     cursor_info->UseHWCursor = xf86_use_hw_cursor;
 #ifdef ARGB_CURSOR
     if (flags & HARDWARE_CURSOR_ARGB) {
         cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb;
-        cursor_info->LoadCursorARGB = xf86_load_cursor_argb;
+        cursor_info->LoadCursorARGB2 = xf86_load_cursor_argb;
     }
 #endif
 
@@ -658,11 +658,11 @@ xf86_reload_cursors(ScreenPtr screen)
             dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey,
                                    screen);
 #ifdef ARGB_CURSOR
-        if (cursor->bits->argb && cursor_info->LoadCursorARGB)
-            (*cursor_info->LoadCursorARGB) (scrn, cursor);
+        if (cursor->bits->argb && cursor_info->LoadCursorARGB2)
+            (*cursor_info->LoadCursorARGB2) (scrn, cursor);
         else if (src)
 #endif
-            (*cursor_info->LoadCursorImage) (scrn, src);
+            (*cursor_info->LoadCursorImage2) (scrn, src);
 
         x += scrn->frameX0 + cursor_screen_priv->HotX;
         y += scrn->frameY0 + cursor_screen_priv->HotY;
diff --git a/hw/xfree86/ramdac/IBM.c b/hw/xfree86/ramdac/IBM.c
index 872d3d4..ddd1c05 100644
--- a/hw/xfree86/ramdac/IBM.c
+++ b/hw/xfree86/ramdac/IBM.c
@@ -622,7 +622,7 @@ IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr)
         HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
     infoPtr->SetCursorColors = IBMramdac526SetCursorColors;
     infoPtr->SetCursorPosition = IBMramdac526SetCursorPosition;
-    infoPtr->LoadCursorImage = IBMramdac526LoadCursorImage;
+    infoPtr->LoadCursorImage2 = IBMramdac526LoadCursorImage;
     infoPtr->HideCursor = IBMramdac526HideCursor;
     infoPtr->ShowCursor = IBMramdac526ShowCursor;
     infoPtr->UseHWCursor = IBMramdac526UseHWCursor;
@@ -638,7 +638,7 @@ IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr)
         HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
     infoPtr->SetCursorColors = IBMramdac640SetCursorColors;
     infoPtr->SetCursorPosition = IBMramdac640SetCursorPosition;
-    infoPtr->LoadCursorImage = IBMramdac640LoadCursorImage;
+    infoPtr->LoadCursorImage2 = IBMramdac640LoadCursorImage;
     infoPtr->HideCursor = IBMramdac640HideCursor;
     infoPtr->ShowCursor = IBMramdac640ShowCursor;
     infoPtr->UseHWCursor = IBMramdac640UseHWCursor;
diff --git a/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c
index 7d4e0d7..1b4ddb4 100644
--- a/hw/xfree86/ramdac/TI.c
+++ b/hw/xfree86/ramdac/TI.c
@@ -676,7 +676,7 @@ TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr)
         HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
     infoPtr->SetCursorColors = TIramdacSetCursorColors;
     infoPtr->SetCursorPosition = TIramdacSetCursorPosition;
-    infoPtr->LoadCursorImage = TIramdacLoadCursorImage;
+    infoPtr->LoadCursorImage2 = TIramdacLoadCursorImage;
     infoPtr->HideCursor = TIramdacHideCursor;
     infoPtr->ShowCursor = TIramdacShowCursor;
     infoPtr->UseHWCursor = TIramdacUseHWCursor;
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index fac6822..fb39821 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -128,7 +128,7 @@ xf86CursorCloseScreen(ScreenPtr pScreen)
                                                xf86CursorScreenKey);
 
     if (ScreenPriv->isUp && pScrn->vtSema)
-        xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
+        xf86SetCursor2(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
 
     if (ScreenPriv->CurrentCursor)
         FreeCursor(ScreenPriv->CurrentCursor, None);
@@ -245,7 +245,7 @@ xf86CursorSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
                                                xf86CursorScreenKey);
 
     if (ScreenPriv->isUp) {
-        xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
+        xf86SetCursor2(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
         ScreenPriv->isUp = FALSE;
     }
 
@@ -310,7 +310,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
             (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, NullCursor, x,
                                                    y);
         else if (ScreenPriv->isUp) {
-            xf86SetCursor(pScreen, NullCursor, x, y);
+            xf86SetCursor2(pScreen, NullCursor, x, y);
             ScreenPriv->isUp = FALSE;
         }
         if (ScreenPriv->CurrentCursor)
@@ -352,7 +352,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
                 (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen,
                                                        NullCursor, x, y);
 
-            if (xf86SetCursor(pScreen, cursor, x, y)) {
+            if (xf86SetCursor2(pScreen, cursor, x, y)) {
                 ScreenPriv->SWCursor = FALSE;
                 ScreenPriv->isUp = TRUE;
 
@@ -369,7 +369,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
                 xf86SetTransparentCursor(pScreen);
             }
             else {
-                xf86SetCursor(pScreen, NullCursor, x, y);
+                xf86SetCursor2(pScreen, NullCursor, x, y);
                 ScreenPriv->isUp = FALSE;
             }
         }
diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h
index 1ecbdcd..2e4a569 100644
--- a/hw/xfree86/ramdac/xf86Cursor.h
+++ b/hw/xfree86/ramdac/xf86Cursor.h
@@ -12,7 +12,7 @@ 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);
+    Bool (*LoadCursorImage2) (ScrnInfoPtr pScrn, unsigned char *bits);
     void (*HideCursor) (ScrnInfoPtr pScrn);
     void (*ShowCursor) (ScrnInfoPtr pScrn);
     unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr);
@@ -20,7 +20,7 @@ typedef struct _xf86CursorInfoRec {
 
 #ifdef ARGB_CURSOR
     Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
-    Bool (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
+    Bool (*LoadCursorARGB2) (ScrnInfoPtr, CursorPtr);
 #endif
 
 } xf86CursorInfoRec, *xf86CursorInfoPtr;
diff --git a/hw/xfree86/ramdac/xf86CursorPriv.h b/hw/xfree86/ramdac/xf86CursorPriv.h
index f34c1c7..d51f46a 100644
--- a/hw/xfree86/ramdac/xf86CursorPriv.h
+++ b/hw/xfree86/ramdac/xf86CursorPriv.h
@@ -37,7 +37,7 @@ typedef struct {
     void *transparentData;
 } xf86CursorScreenRec, *xf86CursorScreenPtr;
 
-Bool xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y);
+Bool xf86SetCursor2(ScreenPtr pScreen, CursorPtr pCurs, int x, int y);
 void xf86SetTransparentCursor(ScreenPtr pScreen);
 void xf86MoveCursor(ScreenPtr pScreen, int x, int y);
 void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed);
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index 0b5caa2..0112abe 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -87,7 +87,7 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
 
     /* These are required for now */
     if (!infoPtr->SetCursorPosition ||
-        !infoPtr->LoadCursorImage ||
+        !infoPtr->LoadCursorImage2 ||
         !infoPtr->HideCursor ||
         !infoPtr->ShowCursor || !infoPtr->SetCursorColors)
         return FALSE;
@@ -120,7 +120,7 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
 }
 
 Bool
-xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
+xf86SetCursor2(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
 {
     xf86CursorScreenPtr ScreenPriv =
         (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
@@ -140,7 +140,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
     y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
 
 #ifdef ARGB_CURSOR
-    if (!pCurs->bits->argb || !infoPtr->LoadCursorARGB)
+    if (!pCurs->bits->argb || !infoPtr->LoadCursorARGB2)
 #endif
         if (!bits) {
             bits = (*infoPtr->RealizeCursor) (infoPtr, pCurs);
@@ -152,13 +152,13 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
         (*infoPtr->HideCursor) (infoPtr->pScrn);
 
 #ifdef ARGB_CURSOR
-    if (pCurs->bits->argb && infoPtr->LoadCursorARGB) {
-        if (!(*infoPtr->LoadCursorARGB) (infoPtr->pScrn, pCurs))
+    if (pCurs->bits->argb && infoPtr->LoadCursorARGB2) {
+        if (!(*infoPtr->LoadCursorARGB2) (infoPtr->pScrn, pCurs))
             return FALSE;
     } else
 #endif
     if (bits)
-        if (!(*infoPtr->LoadCursorImage) (infoPtr->pScrn, bits))
+        if (!(*infoPtr->LoadCursorImage2) (infoPtr->pScrn, bits))
             return FALSE;
 
     xf86RecolorCursor(pScreen, pCurs, 1);
@@ -185,8 +185,8 @@ xf86SetTransparentCursor(ScreenPtr pScreen)
         (*infoPtr->HideCursor) (infoPtr->pScrn);
 
     if (ScreenPriv->transparentData)
-        (*infoPtr->LoadCursorImage) (infoPtr->pScrn,
-                                     ScreenPriv->transparentData);
+        (*infoPtr->LoadCursorImage2) (infoPtr->pScrn,
+                                      ScreenPriv->transparentData);
 
     (*infoPtr->ShowCursor) (infoPtr->pScrn);
 }
-- 
ORACLE Deutschland B.V. & Co. KG   Michael Thayer
Werkstrasse 24                     VirtualBox engineering
71384 Weinstadt, Germany           mailto:michael.thayer at oracle.com

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher


More information about the xorg-devel mailing list