summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2011-01-14 15:03:28 +0200
committerPauli Nieminen <ext-pauli.nieminen@nokia.com>2011-02-03 14:38:42 +0200
commit5d020c31351594c104fb46615ce41f256cd8e8b9 (patch)
treea74c8e7e4baac8c201356b5eba9b0108950acc87
parentddf32df5cc2e73b833f6e414276d938fdc38869e (diff)
xf86/xv: Only register PostValidateTree hook when there is work to do
If none of Xv ports were affected by window tree modifications we don't want scan the port list. To avoid useless scanning of port list PostValidateTree hook is only registered when ClipNotify was called for any port. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com>
-rw-r--r--hw/xfree86/common/xf86xv.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index ea286df79..53ebe8f88 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -100,6 +100,8 @@ 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);
+#define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1)
+
/* ScrnInfoRec functions */
static Bool xf86XVEnterVT(int, int);
@@ -283,7 +285,7 @@ xf86XVScreenInit(
ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
ScreenPriv->WindowExposures = pScreen->WindowExposures;
- ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
+ ScreenPriv->PostValidateTree = PostValidateTreeUndefined;
ScreenPriv->ClipNotify = pScreen->ClipNotify;
ScreenPriv->EnterVT = pScrn->EnterVT;
ScreenPriv->LeaveVT = pScrn->LeaveVT;
@@ -292,7 +294,6 @@ xf86XVScreenInit(
pScreen->DestroyWindow = xf86XVDestroyWindow;
pScreen->WindowExposures = xf86XVWindowExposures;
- pScreen->PostValidateTree = xf86XVPostValidateTree;
pScreen->ClipNotify = xf86XVClipNotify;
pScrn->EnterVT = xf86XVEnterVT;
pScrn->LeaveVT = xf86XVLeaveVT;
@@ -1165,12 +1166,11 @@ xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind)
xf86XVReputOrStopAllPorts(pScrn, TRUE);
- if (ScreenPriv->PostValidateTree) {
- pScreen->PostValidateTree = ScreenPriv->PostValidateTree;
+ pScreen->PostValidateTree = ScreenPriv->PostValidateTree;
+ if (pScreen->PostValidateTree) {
(*pScreen->PostValidateTree)(pWin, pLayerWin, kind);
- ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
- pScreen->PostValidateTree = xf86XVPostValidateTree;
}
+ ScreenPriv->PostValidateTree = PostValidateTreeUndefined;
}
static void
@@ -1247,6 +1247,11 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
pPriv->clipChanged = TRUE;
+ if (ScreenPriv->PostValidateTree == PostValidateTreeUndefined) {
+ ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = xf86XVPostValidateTree;
+ }
+
WinPriv = WinPriv->next;
}
@@ -1274,7 +1279,6 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
pScreen->WindowExposures = ScreenPriv->WindowExposures;
- pScreen->PostValidateTree = ScreenPriv->PostValidateTree;
pScreen->ClipNotify = ScreenPriv->ClipNotify;
pScrn->EnterVT = ScreenPriv->EnterVT;