[PATCH 4/4] xf86/xv: Only register PostValidateTree hook when there is work to do
Pauli
ext-pauli.nieminen at nokia.com
Fri Jan 14 05:44:24 PST 2011
From: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
hw/xfree86/common/xf86xv.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 95eb2e5..52e6c0a 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -281,7 +281,6 @@ xf86XVScreenInit(
pScrn = xf86Screens[pScreen->myNum];
ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
- ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
ScreenPriv->ClipNotify = pScreen->ClipNotify;
ScreenPriv->EnterVT = pScrn->EnterVT;
ScreenPriv->LeaveVT = pScrn->LeaveVT;
@@ -289,7 +288,6 @@ xf86XVScreenInit(
ScreenPriv->ModeSet = pScrn->ModeSet;
pScreen->DestroyWindow = xf86XVDestroyWindow;
- pScreen->PostValidateTree = xf86XVPostValidateTree;
pScreen->ClipNotify = xf86XVClipNotify;
pScrn->EnterVT = xf86XVEnterVT;
pScrn->LeaveVT = xf86XVLeaveVT;
@@ -1151,8 +1149,7 @@ xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind)
if (ScreenPriv->PostValidateTree) {
pScreen->PostValidateTree = ScreenPriv->PostValidateTree;
(*pScreen->PostValidateTree)(pWin, pLayerWin, kind);
- ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
- pScreen->PostValidateTree = xf86XVPostValidateTree;
+ ScreenPriv->PostValidateTree = NULL;
}
}
@@ -1178,6 +1175,11 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
pPriv->clipChanged = TRUE;
+ if (!ScreenPriv->PostValidateTree) {
+ ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = xf86XVPostValidateTree;
+ }
+
WinPriv = WinPriv->next;
}
@@ -1204,7 +1206,6 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
if(!ScreenPriv) return TRUE;
pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
- pScreen->PostValidateTree = ScreenPriv->PostValidateTree;
pScreen->ClipNotify = ScreenPriv->ClipNotify;
pScrn->EnterVT = ScreenPriv->EnterVT;
--
1.7.0.4
More information about the xorg-devel
mailing list