summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-28 09:28:25 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-28 09:28:25 -0400
commit4017d3190234e189a0bbd33193a148d4d3c7556b (patch)
tree2ab228113d410386afde50c893f137d95974b8f3 /exa
parent85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff)
devPrivates rework: since API is already broken, switch everything
over to new system. Need to update documentation and address some remaining vestiges of old system such as CursorRec structure, fb "offman" structure, and FontRec privates.
Diffstat (limited to 'exa')
-rw-r--r--exa/exa.c20
-rw-r--r--exa/exa_priv.h10
2 files changed, 9 insertions, 21 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 99707fa5c..4260cbade 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -40,9 +40,8 @@
#include "exa.h"
#include "cw.h"
-static int exaGeneration;
-int exaScreenPrivateIndex;
-int exaPixmapPrivateIndex;
+DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKey;
+DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKey;
/**
* exaGetPixmapOffset() returns the offset (in bytes) within the framebuffer of
@@ -619,12 +618,6 @@ exaDriverInit (ScreenPtr pScreen,
#ifdef RENDER
ps = GetPictureScreenIfSet(pScreen);
#endif
- if (exaGeneration != serverGeneration)
- {
- exaScreenPrivateIndex = AllocateScreenPrivateIndex();
- exaPixmapPrivateIndex = AllocatePixmapPrivateIndex();
- exaGeneration = serverGeneration;
- }
pExaScr = xcalloc (sizeof (ExaScreenPrivRec), 1);
@@ -636,7 +629,7 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->info = pScreenInfo;
- pScreen->devPrivates[exaScreenPrivateIndex].ptr = (pointer) pExaScr;
+ dixSetPrivate(&pScreen->devPrivates, exaScreenPrivateKey, pExaScr);
pExaScr->migration = ExaMigrationAlways;
@@ -698,8 +691,7 @@ exaDriverInit (ScreenPtr pScreen,
if ((pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) &&
pExaScr->info->offScreenBase < pExaScr->info->memorySize)
{
- if (!AllocatePixmapPrivate(pScreen, exaPixmapPrivateIndex,
- sizeof (ExaPixmapPrivRec))) {
+ if (!dixRequestPrivate(exaPixmapPrivateKey, sizeof(ExaPixmapPrivRec))) {
LogMessage(X_WARNING,
"EXA(%d): Failed to allocate pixmap private\n",
pScreen->myNum);
@@ -716,11 +708,7 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->info->memorySize - pExaScr->info->offScreenBase);
}
else
- {
LogMessage(X_INFO, "EXA(%d): No offscreen pixmaps\n", pScreen->myNum);
- if (!AllocatePixmapPrivate(pScreen, exaPixmapPrivateIndex, 0))
- return FALSE;
- }
DBG_PIXMAP(("============== %ld < %ld\n", pExaScr->info->offScreenBase,
pExaScr->info->memorySize));
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index a456da05e..b577094bc 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -132,9 +132,9 @@ typedef struct {
(PixmapWidthPaddingInfo[d].padRoundUp+1)))
#endif
-extern int exaScreenPrivateIndex;
-extern int exaPixmapPrivateIndex;
-#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)(s)->devPrivates[exaScreenPrivateIndex].ptr)
+extern DevPrivateKey exaScreenPrivateKey;
+extern DevPrivateKey exaPixmapPrivateKey;
+#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixLookupPrivate(&(s)->devPrivates, exaScreenPrivateKey))
#define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s)
/** Align an offset to an arbitrary alignment */
@@ -150,8 +150,8 @@ extern int exaPixmapPrivateIndex;
#define EXA_PIXMAP_SCORE_PINNED 1000
#define EXA_PIXMAP_SCORE_INIT 1001
-#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)(p)->devPrivates[exaPixmapPrivateIndex].ptr)
-#define ExaSetPixmapPriv(p,a) ((p)->devPrivates[exaPixmapPrivateIndex].ptr = (pointer) (a))
+#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixLookupPrivate(&(p)->devPrivates, exaPixmapPrivateKey))
+#define ExaSetPixmapPriv(p,a) dixSetPrivate(&(p)->devPrivates, exaPixmapPrivateKey, a)
#define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p)
typedef struct {