[PATCH 10/10] xfree86/xv: Provide a ModeSet hook
ville.syrjala at nokia.com
ville.syrjala at nokia.com
Fri Oct 29 11:19:06 PDT 2010
From: Ville Syrjälä <ville.syrjala at nokia.com>
Reput all ports when the display mode or panning has been changed by
RandR code. This makes the overlays appear in the correct position
on the screen.
Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
---
hw/xfree86/common/xf86xv.c | 24 ++++++++++++++++++++++++
hw/xfree86/common/xf86xvpriv.h | 1 +
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index e4c5082..19bb482 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -104,6 +104,7 @@ static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy);
static Bool xf86XVEnterVT(int, int);
static void xf86XVLeaveVT(int, int);
static void xf86XVAdjustFrame(int index, int x, int y, int flags);
+static void xf86XVModeSet(ScrnInfoPtr pScrn);
/* misc */
@@ -287,6 +288,7 @@ xf86XVScreenInit(
ScreenPriv->EnterVT = pScrn->EnterVT;
ScreenPriv->LeaveVT = pScrn->LeaveVT;
ScreenPriv->AdjustFrame = pScrn->AdjustFrame;
+ ScreenPriv->ModeSet = pScrn->ModeSet;
pScreen->DestroyWindow = xf86XVDestroyWindow;
pScreen->WindowExposures = xf86XVWindowExposures;
@@ -295,6 +297,7 @@ xf86XVScreenInit(
pScrn->LeaveVT = xf86XVLeaveVT;
if(pScrn->AdjustFrame)
pScrn->AdjustFrame = xf86XVAdjustFrame;
+ pScrn->ModeSet = xf86XVModeSet;
if(!xf86XVInitAdaptors(pScreen, adaptors, num))
return FALSE;
@@ -1211,6 +1214,7 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
pScrn->EnterVT = ScreenPriv->EnterVT;
pScrn->LeaveVT = ScreenPriv->LeaveVT;
pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
+ pScrn->ModeSet = ScreenPriv->ModeSet;
for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
xf86XVFreeAdaptor(pa);
@@ -1314,6 +1318,26 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
xf86XVReputOrStopAllPorts(pScrn);
}
+static void
+xf86XVModeSet(ScrnInfoPtr pScrn)
+{
+ ScreenPtr pScreen = pScrn->pScreen;
+ XF86XVScreenPtr ScreenPriv;
+
+ /* Can be called before pScrn->pScreen is set */
+ if (!pScreen)
+ return;
+
+ ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+
+ if (ScreenPriv->ModeSet) {
+ pScrn->ModeSet = ScreenPriv->ModeSet;
+ (*pScrn->ModeSet)(pScrn);
+ pScrn->ModeSet = xf86XVModeSet;
+ }
+
+ xf86XVReputOrStopAllPorts(pScrn);
+}
/**** XvAdaptorRec fields ****/
diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h
index 7623d29..fa2b60e 100644
--- a/hw/xfree86/common/xf86xvpriv.h
+++ b/hw/xfree86/common/xf86xvpriv.h
@@ -44,6 +44,7 @@ typedef struct {
Bool (*EnterVT)(int, int);
void (*LeaveVT)(int, int);
GCPtr videoGC;
+ xf86ModeSetProc *ModeSet;
} XF86XVScreenRec, *XF86XVScreenPtr;
typedef struct {
--
1.7.2.2
More information about the xorg-devel
mailing list