summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86xv.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@nokia.com>2010-10-29 17:34:56 +0300
committerVille Syrjälä <ville.syrjala@nokia.com>2010-11-26 18:01:06 +0200
commitf4f41c812d2ba5edba7e0e0dbaab4bbf0af834b3 (patch)
tree3d94b9e45a128920a114648c9b8921c24198955a /hw/xfree86/common/xf86xv.c
parent640c8716e0400e35afd7e91efc826fc447ea6745 (diff)
xfree86/xv: Provide a ModeSet hook
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@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de>
Diffstat (limited to 'hw/xfree86/common/xf86xv.c')
-rw-r--r--hw/xfree86/common/xf86xv.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index d3230069e..016db1f04 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;
@@ -1241,6 +1244,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);
@@ -1344,6 +1348,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 ****/