diff options
author | George Sapountzis <gsap7@yahoo.gr> | 2006-10-31 16:44:10 +0200 |
---|---|---|
committer | George Sapountzis <gsap7@yahoo.gr> | 2007-02-05 19:32:08 +0200 |
commit | 67b240ddd4a6549a23885afc723b6efa7c52db4c (patch) | |
tree | 2da8d5150eceb03ed74d55ee38d350ecc03852c7 | |
parent | 4dac7896549392f7378cad9620618cec28f41a16 (diff) |
Consolidate atixv.c w/ atimach64xv.c, part 1.
Merge ATIXVInitializeAdaptor() in ATIMach64XVInitialiseAdaptor().
-rw-r--r-- | src/atimach64xv.c | 36 | ||||
-rw-r--r-- | src/atimach64xv.h | 3 | ||||
-rw-r--r-- | src/atixv.c | 46 |
3 files changed, 31 insertions, 54 deletions
diff --git a/src/atimach64xv.c b/src/atimach64xv.c index 8384685..54f5c4c 100644 --- a/src/atimach64xv.c +++ b/src/atimach64xv.c @@ -1404,26 +1404,30 @@ 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 ) { + ScreenPtr pScreen = screenInfo.screens[pScreenInfo->scrnIndex]; + ATIPtr pATI = ATIPTR(pScreenInfo); + XF86VideoAdaptorPtr *ppAdaptor = NULL; XF86VideoAdaptorPtr pAdaptor; int Index; + if (pppAdaptor) + *pppAdaptor = NULL; + if (!pATI->Block1Base) return 0; if (!(pAdaptor = xf86XVAllocateVideoAdaptorRec(pScreenInfo))) return 0; - *pppAdaptor = xnfalloc(sizeof(pAdaptor)); - **pppAdaptor = pAdaptor; + ppAdaptor = xnfalloc(sizeof(pAdaptor)); + ppAdaptor[0] = pAdaptor; pAdaptor->nPorts = 1; pAdaptor->pPortPrivates = pATI->XVPortPrivate; @@ -1499,10 +1503,32 @@ 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 +) +{ + (void)xf86XVRegisterGenericAdaptorDriver(ATIMach64XVInitialiseAdaptor); +} + +/* * ATIMach64CloseXVideo -- * * This function is called during screen termination to clean up after diff --git a/src/atimach64xv.h b/src/atimach64xv.h index 0661246..f46a120 100644 --- a/src/atimach64xv.h +++ b/src/atimach64xv.h @@ -28,9 +28,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/atixv.c b/src/atixv.c index ef86ec3..476948d 100644 --- a/src/atixv.c +++ b/src/atixv.c @@ -50,52 +50,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 -) -{ - (void)xf86XVRegisterGenericAdaptorDriver(ATIXVInitializeAdaptor); -} - -/* * ATIInitializeXVideo -- * * This function is called to initialise XVideo extension support on a screen. |