diff options
-rw-r--r-- | src/atimach64xv.c | 53 | ||||
-rw-r--r-- | src/atimach64xv.h | 3 | ||||
-rw-r--r-- | src/atiscreen.c | 2 | ||||
-rw-r--r-- | src/atixv.c | 70 | ||||
-rw-r--r-- | src/atixv.h | 1 |
5 files changed, 44 insertions, 85 deletions
diff --git a/src/atimach64xv.c b/src/atimach64xv.c index 9c8f8a1..9a3d034 100644 --- a/src/atimach64xv.c +++ b/src/atimach64xv.c @@ -1405,26 +1405,27 @@ static XF86OffscreenImageRec ATIMach64Surface_C[] = * This function is called to make a Mach64's hardware overlay support * available as an XVideo adaptor. */ -int +static int ATIMach64XVInitialiseAdaptor ( - ScreenPtr pScreen, ScrnInfoPtr pScreenInfo, - ATIPtr pATI, XF86VideoAdaptorPtr **pppAdaptor ) { - XF86VideoAdaptorPtr pAdaptor; - int Index; + ScreenPtr pScreen = screenInfo.screens[pScreenInfo->scrnIndex]; + ATIPtr pATI = ATIPTR(pScreenInfo); + XF86VideoAdaptorPtr pAdaptor; + XF86VideoAdaptorPtr *ppAdaptor = NULL; if (!pATI->Block1Base) return 0; - if (!(pAdaptor = xf86XVAllocateVideoAdaptorRec(pScreenInfo))) + pAdaptor = xf86XVAllocateVideoAdaptorRec(pScreenInfo); + if (!pAdaptor) return 0; - *pppAdaptor = xnfalloc(sizeof(pAdaptor)); - **pppAdaptor = pAdaptor; + ppAdaptor = xnfalloc(sizeof(pAdaptor)); + ppAdaptor[0] = pAdaptor; pAdaptor->nPorts = 1; pAdaptor->pPortPrivates = pATI->XVPortPrivate; @@ -1471,8 +1472,9 @@ ATIMach64XVInitialiseAdaptor REGION_NULL(pScreen, &pATI->VideoClip); pATI->ActiveSurface = FALSE; - if (ATIMach64XVAtomGeneration != serverGeneration) - { + if (ATIMach64XVAtomGeneration != serverGeneration) { + int Index; + /* Refresh static data */ ATIMach64XVAtomGeneration = serverGeneration; @@ -1500,10 +1502,38 @@ ATIMach64XVInitialiseAdaptor ATIMach64Surface_C, nATIMach64Surface_C); } + if (pppAdaptor) + *pppAdaptor = ppAdaptor; + else { + xfree(ppAdaptor[0]); + xfree(ppAdaptor); + } + return 1; } /* + * ATIXVPreInit -- + * + * This function is called by ATIPreInit() to set up the environment required + * to support the XVideo extension. + */ +void +ATIXVPreInit(ATIPtr pATI) +{ + +#ifndef AVOID_CPIO + + /* Currently a linear aperture is needed ... */ + if (!pATI->LinearBase) + return; + +#endif /* AVOID_CPIO */ + + (void)xf86XVRegisterGenericAdaptorDriver(ATIMach64XVInitialiseAdaptor); +} + +/* * ATIMach64CloseXVideo -- * * This function is called during screen termination to clean up after @@ -1522,6 +1552,9 @@ ATIMach64CloseXVideo REGION_UNINIT(pScreen, &pATI->VideoClip); } +/* + * Offscreen memory management functions for Mach64 XVideo support. + */ #ifdef USE_XAA static FBLinearPtr ATIResizeOffscreenLinear diff --git a/src/atimach64xv.h b/src/atimach64xv.h index 8f5257c..bed7048 100644 --- a/src/atimach64xv.h +++ b/src/atimach64xv.h @@ -29,9 +29,6 @@ #include "xf86str.h" #include "xf86xv.h" -extern int ATIMach64XVInitialiseAdaptor(ScreenPtr, ScrnInfoPtr, ATIPtr, - XF86VideoAdaptorPtr **); - extern void ATIMach64CloseXVideo(ScreenPtr, ScrnInfoPtr, ATIPtr); #endif /* ___ATIMACH64XV_H___ */ diff --git a/src/atiscreen.c b/src/atiscreen.c index b907f46..05fb43c 100644 --- a/src/atiscreen.c +++ b/src/atiscreen.c @@ -663,7 +663,7 @@ ATICloseScreen #endif /* XF86DRI_DEVEL */ - ATICloseXVideo(pScreen, pScreenInfo, pATI); + ATIMach64CloseXVideo(pScreen, pScreenInfo, pATI); #ifdef USE_EXA if (pATI->pExa) diff --git a/src/atixv.c b/src/atixv.c index c0c258c..bd0cb83 100644 --- a/src/atixv.c +++ b/src/atixv.c @@ -51,59 +51,6 @@ ATIXVFreeAdaptorInfo } /* - * ATIXVInitializeAdaptor -- - * - * This is called by the server's XVideo support layer to initialise an XVideo - * adapter. - */ -static int -ATIXVInitializeAdaptor -( - ScrnInfoPtr pScreenInfo, - XF86VideoAdaptorPtr **pppAdaptor -) -{ - ScreenPtr pScreen = screenInfo.screens[pScreenInfo->scrnIndex]; - ATIPtr pATI = ATIPTR(pScreenInfo); - XF86VideoAdaptorPtr *ppAdaptor = NULL; - int nAdaptor; - - nAdaptor = ATIMach64XVInitialiseAdaptor(pScreen, pScreenInfo, pATI, - &ppAdaptor); - - if (pppAdaptor) - *pppAdaptor = ppAdaptor; - else - ATIXVFreeAdaptorInfo(ppAdaptor, nAdaptor); - - return nAdaptor; -} - -/* - * ATIXVPreInit -- - * - * This function is called by ATIPreInit() to set up the environment required - * to support the XVideo extension. - */ -void -ATIXVPreInit -( - ATIPtr pATI -) -{ - -#ifndef AVOID_CPIO - - /* Currently a linear aperture is needed ... */ - if (!pATI->LinearBase) - return; - -#endif /* AVOID_CPIO */ - - (void)xf86XVRegisterGenericAdaptorDriver(ATIXVInitializeAdaptor); -} - -/* * ATIInitializeXVideo -- * * This function is called to initialise XVideo extension support on a screen. @@ -132,20 +79,3 @@ ATIInitializeXVideo return result; } - -/* - * ATICloseXVideo -- - * - * This function is called during screen termination to clean up after XVideo - * initialisation. - */ -void -ATICloseXVideo -( - ScreenPtr pScreen, - ScrnInfoPtr pScreenInfo, - ATIPtr pATI -) -{ - ATIMach64CloseXVideo(pScreen, pScreenInfo, pATI); -} diff --git a/src/atixv.h b/src/atixv.h index 64674de..fe5d119 100644 --- a/src/atixv.h +++ b/src/atixv.h @@ -30,6 +30,5 @@ extern void ATIXVPreInit(ATIPtr); extern Bool ATIInitializeXVideo(ScreenPtr, ScrnInfoPtr, ATIPtr); -extern void ATICloseXVideo(ScreenPtr, ScrnInfoPtr, ATIPtr); #endif /* ___ATIXV_H___ */ |