diff options
author | George Sapountzis <gsap7@yahoo.gr> | 2006-11-21 04:02:41 +0200 |
---|---|---|
committer | George Sapountzis <gsap7@yahoo.gr> | 2007-02-05 19:32:10 +0200 |
commit | eda9fb15e8bc042661a91a3d8c921006dfb3ddd9 (patch) | |
tree | 2fb4c704c862732420c1ac0b53c3b94c15d22379 /src/atimach64xv.c | |
parent | 67b240ddd4a6549a23885afc723b6efa7c52db4c (diff) |
Consolidate atixv.c w/ atimach64xv.c, part 2.
Move {Initialize,Close}XVideo from atixv.c to atimach64xv.c .
Diffstat (limited to 'src/atimach64xv.c')
-rw-r--r-- | src/atimach64xv.c | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/src/atimach64xv.c b/src/atimach64xv.c index 54f5c4c0..5df903b6 100644 --- a/src/atimach64xv.c +++ b/src/atimach64xv.c @@ -30,10 +30,11 @@ #include "atichip.h" #include "atimach64accel.h" #include "atimach64io.h" -#include "atimach64xv.h" +#include "atixv.h" #include <X11/extensions/Xv.h> #include "fourcc.h" +#include "xf86xv.h" #define MAKE_ATOM(string) MakeAtom(string, strlen(string), TRUE) #define MaxScale (CARD32)(CARD16)(-1) @@ -1529,13 +1530,62 @@ ATIXVPreInit } /* + * ATIXVFreeAdaptorInfo -- + * + * Free XVideo adaptor information. + */ +static void +ATIXVFreeAdaptorInfo +( + XF86VideoAdaptorPtr *ppAdaptor, + int nAdaptor +) +{ + if (!ppAdaptor) + return; + + while (nAdaptor > 0) + xfree(ppAdaptor[--nAdaptor]); + + xfree(ppAdaptor); +} + +/* + * ATIInitializeXVideo -- + * + * This function is called to initialise XVideo extension support on a screen. + */ +Bool +ATIInitializeXVideo +( + ScreenPtr pScreen, + ScrnInfoPtr pScreenInfo, + ATIPtr pATI +) +{ + XF86VideoAdaptorPtr *ppAdaptor; + int nAdaptor; + Bool result; + + pScreenInfo->memPhysBase = pATI->LinearBase; + pScreenInfo->fbOffset = 0; + + nAdaptor = xf86XVListGenericAdaptors(pScreenInfo, &ppAdaptor); + result = xf86XVScreenInit(pScreen, ppAdaptor, nAdaptor); + + ATIXVFreeAdaptorInfo(ppAdaptor, nAdaptor); + + return result; +} + +/* * ATIMach64CloseXVideo -- * * This function is called during screen termination to clean up after * initialisation of Mach64 XVideo support. */ void -ATIMach64CloseXVideo +ATICloseXVideo ( ScreenPtr pScreen, ScrnInfoPtr pScreenInfo, |