summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-04-04 22:58:37 +0100
committerEric Anholt <eric@anholt.net>2014-08-06 20:12:20 -0700
commitb01cfe5f23766b9c13ed6bd889263d5d7a8a351d (patch)
tree9a26ffff586986c59a9ae460d40471cd83127154 /hw
parent6a71ee79aabe6b611cae443a49786824a0322313 (diff)
xv: Move CloseScreen setup from a DIX hook to normal wrapping.
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/src/kxv.c18
-rw-r--r--hw/kdrive/src/kxv.h1
-rw-r--r--hw/xfree86/common/xf86xv.c19
-rw-r--r--hw/xfree86/common/xf86xvpriv.h1
4 files changed, 13 insertions, 26 deletions
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index ad51cf971..47e13574b 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 fe467a97e..451d3faf5 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 0f3b09bfe..3e31046b7 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 e95f959a8..c0dff16d5 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 {