summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/atimach64xv.c36
-rw-r--r--src/atimach64xv.h3
-rw-r--r--src/atixv.c46
3 files changed, 31 insertions, 54 deletions
diff --git a/src/atimach64xv.c b/src/atimach64xv.c
index 83846856..54f5c4c0 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 06612462..f46a120b 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 ef86ec3d..476948d4 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.