summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86RandR.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-01-03 17:04:54 +1030
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-01-03 17:04:54 +1030
commit8da83836b60f7cdb75d08482f4311fa0e2ab4e1d (patch)
tree092efcfc39e3e293baaf04c4c84027ee453d3e13 /hw/xfree86/common/xf86RandR.c
parenteace88989c3b65d5c20e9f37ea9b23c7c8e19335 (diff)
parentae869fc7669764729e13fdd70149ed636753f2a3 (diff)
Merge branch 'master' into mpx
Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c
Diffstat (limited to 'hw/xfree86/common/xf86RandR.c')
-rw-r--r--hw/xfree86/common/xf86RandR.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index 87d5a364b..f6157518e 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -46,10 +46,9 @@ typedef struct _xf86RandRInfo {
Rotation rotation;
} XF86RandRInfoRec, *XF86RandRInfoPtr;
-static int xf86RandRIndex = -1;
-static int xf86RandRGeneration;
+static DevPrivateKey xf86RandRKey = NULL;
-#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[xf86RandRIndex].ptr)
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr)dixLookupPrivate(&(p)->devPrivates, xf86RandRKey))
static int
xf86RandRModeRefresh (DisplayModePtr mode)
@@ -339,14 +338,14 @@ xf86RandRCloseScreen (int index, ScreenPtr pScreen)
scrp->currentMode = scrp->modes;
pScreen->CloseScreen = randrp->CloseScreen;
xfree (randrp);
- pScreen->devPrivates[xf86RandRIndex].ptr = 0;
+ dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL);
return (*pScreen->CloseScreen) (index, pScreen);
}
_X_EXPORT Rotation
xf86GetRotation(ScreenPtr pScreen)
{
- if (xf86RandRIndex == -1)
+ if (xf86RandRKey == NULL)
return RR_Rotate_0;
return XF86RANDRINFO(pScreen)->rotation;
@@ -360,7 +359,7 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
{
XF86RandRInfoPtr randrp;
- if (xf86RandRIndex == -1)
+ if (xf86RandRKey == NULL)
return FALSE;
randrp = XF86RANDRINFO(pScreen);
@@ -402,11 +401,8 @@ xf86RandRInit (ScreenPtr pScreen)
if (!noPanoramiXExtension)
return TRUE;
#endif
- if (xf86RandRGeneration != serverGeneration)
- {
- xf86RandRIndex = AllocateScreenPrivateIndex();
- xf86RandRGeneration = serverGeneration;
- }
+
+ xf86RandRKey = &xf86RandRKey;
randrp = xalloc (sizeof (XF86RandRInfoRec));
if (!randrp)
@@ -434,7 +430,7 @@ xf86RandRInit (ScreenPtr pScreen)
randrp->rotation = RR_Rotate_0;
- pScreen->devPrivates[xf86RandRIndex].ptr = randrp;
+ dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, randrp);
return TRUE;
}