summaryrefslogtreecommitdiff
path: root/Xext/xvmc.c
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 /Xext/xvmc.c
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 'Xext/xvmc.c')
-rw-r--r--Xext/xvmc.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index ae358936e..7ae8cc0da 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -39,7 +39,7 @@
#define DR_CLIENT_DRIVER_NAME_SIZE 48
#define DR_BUSID_SIZE 48
-int XvMCScreenIndex = -1;
+static DevPrivateKey XvMCScreenKey = NULL;
unsigned long XvMCGeneration = 0;
@@ -63,7 +63,7 @@ typedef struct {
} XvMCScreenRec, *XvMCScreenPtr;
#define XVMC_GET_PRIVATE(pScreen) \
- (XvMCScreenPtr)((pScreen)->devPrivates[XvMCScreenIndex].ptr)
+ (XvMCScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, XvMCScreenKey))
static int
@@ -153,7 +153,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
return _XvBadPort;
}
- if(XvMCScreenIndex >= 0) { /* any adaptors at all */
+ if(XvMCScreenKey) { /* any adaptors at all */
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
@@ -211,7 +211,7 @@ ProcXvMCCreateContext(ClientPtr client)
pScreen = pPort->pAdaptor->pScreen;
- if(XvMCScreenIndex < 0) /* no XvMC adaptors */
+ if(XvMCScreenKey == NULL) /* no XvMC adaptors */
return BadMatch;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
@@ -494,7 +494,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
pScreen = pPort->pAdaptor->pScreen;
- if(XvMCScreenIndex < 0) /* No XvMC adaptors */
+ if(XvMCScreenKey == NULL) /* No XvMC adaptors */
return BadMatch;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
@@ -679,7 +679,7 @@ XvMCExtensionInit(void)
{
ExtensionEntry *extEntry;
- if(XvMCScreenIndex < 0) /* nobody supports it */
+ if(XvMCScreenKey == NULL) /* nobody supports it */
return;
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
@@ -720,17 +720,12 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
{
XvMCScreenPtr pScreenPriv;
- if(XvMCGeneration != serverGeneration) {
- if((XvMCScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return BadAlloc;
-
- XvMCGeneration = serverGeneration;
- }
+ XvMCScreenKey = &XvMCScreenKey;
if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
return BadAlloc;
- pScreen->devPrivates[XvMCScreenIndex].ptr = (pointer)pScreenPriv;
+ dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = XvMCCloseScreen;
@@ -754,7 +749,7 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
XvMCAdaptorPtr adaptor = NULL;
int i;
- if(XvMCScreenIndex < 0) return NULL;
+ if(XvMCScreenKey == NULL) return NULL;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
return NULL;