diff --git a/Xext/xvdix.h b/Xext/xvdix.h index b61659ce496b789a314c517a88a51a41998bfbcd..534e7d3f84bb988bc8b6632284b494e2b24e4485 100644 --- a/Xext/xvdix.h +++ b/Xext/xvdix.h @@ -213,7 +213,6 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; DestroyPixmapProcPtr DestroyPixmap; CloseScreenProcPtr CloseScreen; - Bool (*ddCloseScreen) (ScreenPtr); } XvScreenRec, *XvScreenPtr; #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \ diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 2046b9dfa00c9b3e4667286e4b4a2156a07008fd..4a439e32c4bf23e66169bb8fac145f2e4bf56c58 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -302,8 +302,6 @@ XvCloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = pxvs->DestroyWindow; pScreen->CloseScreen = pxvs->CloseScreen; - (*pxvs->ddCloseScreen) (pScreen); - free(pxvs); dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL); diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index ad51cf9719c5d0850b45709341ac76b8c5441cb1..47e13574b99b570056b0fe814d8a75f2c1de4a4d 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -56,10 +56,6 @@ of the copyright holder. #include "kxv.h" #include "fourcc.h" -/* XvScreenRec fields */ - -static Bool KdXVCloseScreen(ScreenPtr); - /* XvAdaptorRec fields */ static int KdXVAllocatePort(unsigned long, XvPortPtr, XvPortPtr *); @@ -95,6 +91,7 @@ static Bool KdXVCreateWindow(WindowPtr pWin); static Bool KdXVDestroyWindow(WindowPtr pWin); static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); static void KdXVClipNotify(WindowPtr pWin, int dx, int dy); +static Bool KdXVCloseScreen(ScreenPtr); /* misc */ static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr, int); @@ -132,7 +129,6 @@ Bool KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) { KdXVScreenPtr ScreenPriv; - XvScreenPtr pxvs; /* fprintf(stderr,"KdXVScreenInit initializing %d adaptors\n",num); */ @@ -153,13 +149,6 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) KdXvScreenKey = XvGetScreenKey(); PortResource = XvGetRTPort(); - pxvs = GET_XV_SCREEN(pScreen); - - /* Anyone initializing the Xv layer must provide this. - The Xv di layer calls it without even checking if it exists! */ - - pxvs->ddCloseScreen = KdXVCloseScreen; - ScreenPriv = malloc(sizeof(KdXVScreenRec)); dixSetPrivate(&pScreen->devPrivates, &KdXVScreenPrivateKey, ScreenPriv); @@ -170,6 +159,7 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; ScreenPriv->ClipNotify = pScreen->ClipNotify; + ScreenPriv->CloseScreen = pScreen->CloseScreen; /* fprintf(stderr,"XV: Wrapping screen funcs\n"); */ @@ -177,6 +167,7 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) pScreen->DestroyWindow = KdXVDestroyWindow; pScreen->WindowExposures = KdXVWindowExposures; pScreen->ClipNotify = KdXVClipNotify; + pScreen->CloseScreen = KdXVCloseScreen; if (!KdXVInitAdaptors(pScreen, adaptors, num)) return FALSE; @@ -990,6 +981,7 @@ KdXVCloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; + pScreen->CloseScreen = ScreenPriv->CloseScreen; /* fprintf(stderr,"XV: Unwrapping screen funcs\n"); */ @@ -1000,7 +992,7 @@ KdXVCloseScreen(ScreenPtr pScreen) free(pxvs->pAdaptors); free(ScreenPriv); - return TRUE; + return pScreen->CloseScreen(pScreen); } static Bool diff --git a/hw/kdrive/src/kxv.h b/hw/kdrive/src/kxv.h index fe467a97ebf23070281c847028f31777f2891755..451d3faf5c5575e71185b955c772133979715898 100644 --- a/hw/kdrive/src/kxv.h +++ b/hw/kdrive/src/kxv.h @@ -188,6 +188,7 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; + CloseScreenProcPtr CloseScreen; } KdXVScreenRec, *KdXVScreenPtr; typedef struct { diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 0f3b09bfecfc8d64bce3b8c925dc1a81a0d2af93..3e31046b79d40d8961a6401a5a111a790ff6b457 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -54,10 +54,6 @@ #include "xf86xvpriv.h" -/* XvScreenRec fields */ - -static Bool xf86XVCloseScreen(ScreenPtr); - /* XvAdaptorRec fields */ static int xf86XVAllocatePort(unsigned long, XvPortPtr, XvPortPtr *); @@ -94,6 +90,7 @@ static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind); static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); +static Bool xf86XVCloseScreen(ScreenPtr); #define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1) @@ -234,7 +231,6 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) { ScrnInfoPtr pScrn; XF86XVScreenPtr ScreenPriv; - XvScreenPtr pxvs; if (num <= 0 || noXvExtension) return FALSE; @@ -251,13 +247,6 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) PortResource = XvGetRTPort(); - pxvs = GET_XV_SCREEN(pScreen); - - /* Anyone initializing the Xv layer must provide this. - The Xv di layer calls it without even checking if it exists! */ - - pxvs->ddCloseScreen = xf86XVCloseScreen; - ScreenPriv = malloc(sizeof(XF86XVScreenRec)); dixSetPrivate(&pScreen->devPrivates, &XF86XVScreenPrivateKey, ScreenPriv); @@ -270,6 +259,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) ScreenPriv->WindowExposures = pScreen->WindowExposures; ScreenPriv->PostValidateTree = PostValidateTreeUndefined; ScreenPriv->ClipNotify = pScreen->ClipNotify; + ScreenPriv->CloseScreen = pScreen->CloseScreen; ScreenPriv->EnterVT = pScrn->EnterVT; ScreenPriv->LeaveVT = pScrn->LeaveVT; ScreenPriv->AdjustFrame = pScrn->AdjustFrame; @@ -278,6 +268,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) pScreen->DestroyWindow = xf86XVDestroyWindow; pScreen->WindowExposures = xf86XVWindowExposures; pScreen->ClipNotify = xf86XVClipNotify; + pScreen->CloseScreen = xf86XVCloseScreen; pScrn->EnterVT = xf86XVEnterVT; pScrn->LeaveVT = xf86XVLeaveVT; if (pScrn->AdjustFrame) @@ -1168,6 +1159,7 @@ xf86XVCloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; + pScreen->CloseScreen = ScreenPriv->CloseScreen; pScrn->EnterVT = ScreenPriv->EnterVT; pScrn->LeaveVT = ScreenPriv->LeaveVT; @@ -1180,7 +1172,8 @@ xf86XVCloseScreen(ScreenPtr pScreen) free(pxvs->pAdaptors); free(ScreenPriv); - return TRUE; + + return pScreen->CloseScreen(pScreen); } /**** ScrnInfoRec fields ****/ diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h index e95f959a851c94cc7e5b54f50c1a5941e3e23d30..c0dff16d5d47a0a4825fbeeeeecd383e8b5ca2f1 100644 --- a/hw/xfree86/common/xf86xvpriv.h +++ b/hw/xfree86/common/xf86xvpriv.h @@ -45,6 +45,7 @@ typedef struct { Bool (*EnterVT) (ScrnInfoPtr); void (*LeaveVT) (ScrnInfoPtr); xf86ModeSetProc *ModeSet; + CloseScreenProcPtr CloseScreen; } XF86XVScreenRec, *XF86XVScreenPtr; typedef struct {