aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/ramdac
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/ramdac')
-rw-r--r--xorg-server/hw/xfree86/ramdac/IBM.c4
-rw-r--r--xorg-server/hw/xfree86/ramdac/TI.c2
-rw-r--r--xorg-server/hw/xfree86/ramdac/xf86Cursor.h36
-rw-r--r--xorg-server/hw/xfree86/ramdac/xf86HWCurs.c14
4 files changed, 44 insertions, 12 deletions
diff --git a/xorg-server/hw/xfree86/ramdac/IBM.c b/xorg-server/hw/xfree86/ramdac/IBM.c
index 872d3d4e7..45876cfb7 100644
--- a/xorg-server/hw/xfree86/ramdac/IBM.c
+++ b/xorg-server/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->LoadCursorImageCheck = 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->LoadCursorImageCheck = IBMramdac640LoadCursorImage;
infoPtr->HideCursor = IBMramdac640HideCursor;
infoPtr->ShowCursor = IBMramdac640ShowCursor;
infoPtr->UseHWCursor = IBMramdac640UseHWCursor;
diff --git a/xorg-server/hw/xfree86/ramdac/TI.c b/xorg-server/hw/xfree86/ramdac/TI.c
index 7d4e0d796..2492bb531 100644
--- a/xorg-server/hw/xfree86/ramdac/TI.c
+++ b/xorg-server/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->LoadCursorImageCheck = TIramdacLoadCursorImage;
infoPtr->HideCursor = TIramdacHideCursor;
infoPtr->ShowCursor = TIramdacShowCursor;
infoPtr->UseHWCursor = TIramdacUseHWCursor;
diff --git a/xorg-server/hw/xfree86/ramdac/xf86Cursor.h b/xorg-server/hw/xfree86/ramdac/xf86Cursor.h
index 1ecbdcd8d..a389a9988 100644
--- a/xorg-server/hw/xfree86/ramdac/xf86Cursor.h
+++ b/xorg-server/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);
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;
+static inline Bool
+xf86DriverHasLoadCursorImage(xf86CursorInfoPtr infoPtr)
+{
+ return infoPtr->LoadCursorImageCheck || infoPtr->LoadCursorImage;
+}
+
+static inline Bool
+xf86DriverLoadCursorImage(xf86CursorInfoPtr infoPtr, unsigned char *bits)
+{
+ if(infoPtr->LoadCursorImageCheck)
+ return infoPtr->LoadCursorImageCheck(infoPtr->pScrn, bits);
+ infoPtr->LoadCursorImage(infoPtr->pScrn, bits);
+ return TRUE;
+}
+
+static inline Bool
+xf86DriverHasLoadCursorARGB(xf86CursorInfoPtr infoPtr)
+{
+ return infoPtr->LoadCursorARGBCheck || infoPtr->LoadCursorARGB;
+}
+
+static inline Bool
+xf86DriverLoadCursorARGB(xf86CursorInfoPtr infoPtr, CursorPtr pCursor)
+{
+ if(infoPtr->LoadCursorARGBCheck)
+ return infoPtr->LoadCursorARGBCheck(infoPtr->pScrn, pCursor);
+ infoPtr->LoadCursorARGB(infoPtr->pScrn, pCursor);
+ return TRUE;
+}
+
extern _X_EXPORT Bool xf86InitCursor(ScreenPtr pScreen,
xf86CursorInfoPtr infoPtr);
extern _X_EXPORT xf86CursorInfoPtr xf86CreateCursorInfoRec(void);
diff --git a/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c b/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c
index 0b5caa20a..953c86abc 100644
--- a/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c
@@ -87,7 +87,7 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
/* These are required for now */
if (!infoPtr->SetCursorPosition ||
- !infoPtr->LoadCursorImage ||
+ !xf86DriverHasLoadCursorImage(infoPtr) ||
!infoPtr->HideCursor ||
!infoPtr->ShowCursor || !infoPtr->SetCursorColors)
return FALSE;
@@ -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 || !xf86DriverHasLoadCursorARGB(infoPtr))
#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 && xf86DriverHasLoadCursorARGB(infoPtr)) {
+ if (!xf86DriverLoadCursorARGB (infoPtr, pCurs))
return FALSE;
} else
#endif
if (bits)
- if (!(*infoPtr->LoadCursorImage) (infoPtr->pScrn, bits))
+ if (!xf86DriverLoadCursorImage (infoPtr, 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);
+ xf86DriverLoadCursorImage (infoPtr,
+ ScreenPriv->transparentData);
(*infoPtr->ShowCursor) (infoPtr->pScrn);
}