summaryrefslogtreecommitdiff
path: root/hw/xfree86/ramdac
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2006-11-17 15:10:37 +1030
committerPeter Hutterer <whot@hyena.localdomain>2006-11-17 15:10:37 +1030
commit94e106a898c44daeb228bcb031b85f996ddc96b0 (patch)
treec327a537cc304a0f38ed83e2d1c4795aa19b6c97 /hw/xfree86/ramdac
parent5388423eb05daefcc71067b6ab96b6e57c44ef5c (diff)
dix: moved isMPdev field to end of _DeviceIntRec structure
mi: added miMPPointers array to mipointer.c added DeviceIntPtr to all miPointerSpriteFuncs. Coming from miPointer we use inputInfo.pointer as standard value. ABI BREAK! ramdac: forcing failed HW Cursor initialisation. MPX needs software rendering. changes to use new miPointerSpriteFunc (this required externing inputInfo, should probably be fixed at a later point). RAC: changes to use new miPointerSpriteFuncs.
Diffstat (limited to 'hw/xfree86/ramdac')
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.c61
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c7
2 files changed, 47 insertions, 21 deletions
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index a903f7f02..ec813e068 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -8,15 +8,25 @@
#include "colormapst.h"
#include "cursorstr.h"
+/* FIXME: This was added with the ABI change of the miPointerSpriteFuncs for
+ * MPX.
+ * inputInfo is needed to pass the core pointer as the default argument into
+ * the cursor functions.
+ *
+ * Externing inputInfo is not the nice way to do it but it works.
+ */
+#include "inputstr.h"
+extern InputInfo inputInfo;
+
int xf86CursorScreenIndex = -1;
static unsigned long xf86CursorGeneration = 0;
/* sprite functions */
-static Bool xf86CursorRealizeCursor(ScreenPtr, CursorPtr);
-static Bool xf86CursorUnrealizeCursor(ScreenPtr, CursorPtr);
-static void xf86CursorSetCursor(ScreenPtr, CursorPtr, int, int);
-static void xf86CursorMoveCursor(ScreenPtr, int, int);
+static Bool xf86CursorRealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr);
+static Bool xf86CursorUnrealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr);
+static void xf86CursorSetCursor(DeviceIntPtr, ScreenPtr, CursorPtr, int, int);
+static void xf86CursorMoveCursor(DeviceIntPtr, ScreenPtr, int, int);
static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
xf86CursorRealizeCursor,
@@ -194,14 +204,17 @@ xf86CursorEnableDisableFBAccess(
int index,
Bool enable)
{
+ DeviceIntPtr pDev = inputInfo.pointer;
+
ScreenPtr pScreen = screenInfo.screens[index];
xf86CursorScreenPtr ScreenPriv =
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
if (!enable && ScreenPriv->CurrentCursor != NullCursor) {
ScreenPriv->SavedCursor = ScreenPriv->CurrentCursor;
- xf86CursorSetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
- ScreenPriv->isUp = FALSE;
+ xf86CursorSetCursor(pDev, pScreen, NullCursor, ScreenPriv->x,
+ ScreenPriv->y);
+ ScreenPriv->isUp = FALSE;
ScreenPriv->SWCursor = TRUE;
}
@@ -214,7 +227,7 @@ xf86CursorEnableDisableFBAccess(
* Re-set current cursor so drivers can react to FB access having been
* temporarily disabled.
*/
- xf86CursorSetCursor(pScreen, ScreenPriv->SavedCursor,
+ xf86CursorSetCursor(pDev, pScreen, ScreenPriv->SavedCursor,
ScreenPriv->x, ScreenPriv->y);
ScreenPriv->SavedCursor = NULL;
}
@@ -251,7 +264,7 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
/****** miPointerSpriteFunctions *******/
static Bool
-xf86CursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
+xf86CursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs)
{
xf86CursorScreenPtr ScreenPriv =
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
@@ -259,11 +272,12 @@ xf86CursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
if (pCurs->refcnt <= 1)
pCurs->devPriv[pScreen->myNum] = NULL;
- return (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCurs);
+ return (*ScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs);
}
static Bool
-xf86CursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
+xf86CursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
+ CursorPtr pCurs)
{
xf86CursorScreenPtr ScreenPriv =
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
@@ -273,11 +287,12 @@ xf86CursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
pCurs->devPriv[pScreen->myNum] = NULL;
}
- return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCurs);
+ return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs);
}
static void
-xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
+xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
+ int x, int y)
{
xf86CursorScreenPtr ScreenPriv =
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
@@ -294,8 +309,10 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
if (ScreenPriv->SWCursor)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
- else if (ScreenPriv->isUp) {
+ (*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor,
+ x, y);
+ else if
+ (ScreenPriv->isUp) {
xf86SetCursor(pScreen, NullCursor, x, y);
ScreenPriv->isUp = FALSE;
}
@@ -319,7 +336,7 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
{
if (ScreenPriv->SWCursor) /* remove the SW cursor */
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
+ (*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor, x, y);
xf86SetCursor(pScreen, pCurs, x, y);
ScreenPriv->SWCursor = FALSE;
@@ -344,11 +361,11 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
if (pCurs->bits->emptyMask && !ScreenPriv->showTransparent)
pCurs = NullCursor;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCurs, x, y);
+ (*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, pCurs, x, y);
}
static void
-xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
+xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
xf86CursorScreenPtr ScreenPriv =
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
@@ -357,10 +374,10 @@ xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
ScreenPriv->y = y;
if (ScreenPriv->CursorToRestore)
- xf86CursorSetCursor(pScreen, ScreenPriv->CursorToRestore,
+ xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CursorToRestore,
ScreenPriv->x, ScreenPriv->y);
else if (ScreenPriv->SWCursor)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
+ (*ScreenPriv->spriteFuncs->MoveCursor)(pDev, pScreen, x, y);
else if (ScreenPriv->isUp)
xf86MoveCursor(pScreen, x, y);
}
@@ -368,6 +385,8 @@ xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
void
xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
{
+ DeviceIntPtr pDev = inputInfo.pointer;
+
xf86CursorScreenPtr ScreenPriv =
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
@@ -378,7 +397,7 @@ xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
if (ScreenPriv->SWCursor && ScreenPriv->CurrentCursor)
{
ScreenPriv->HWCursorForced = TRUE;
- xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
+ xf86CursorSetCursor (pDev, pScreen, ScreenPriv->CurrentCursor,
ScreenPriv->x, ScreenPriv->y);
}
else
@@ -390,7 +409,7 @@ xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
if (--ScreenPriv->ForceHWCursorCount == 0)
{
if (ScreenPriv->HWCursorForced && ScreenPriv->CurrentCursor)
- xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
+ xf86CursorSetCursor (pDev, pScreen, ScreenPriv->CurrentCursor,
ScreenPriv->x, ScreenPriv->y);
}
}
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index 91caea047..b76b8005f 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -73,6 +73,13 @@ static unsigned char* RealizeCursorInterleave64(xf86CursorInfoPtr, CursorPtr);
Bool
xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
{
+
+#ifdef MPX
+ /* Graphics cards cannot render multiple cursors in hardware. We have to
+ software render them. */
+ return FALSE;
+#endif
+
if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0))
return FALSE;