[PATCH 08/10] xfree86/xv: Factor out the meat of xf86XVAdjustFrame for later reuse
ville.syrjala at nokia.com
ville.syrjala at nokia.com
Fri Oct 29 11:19:04 PDT 2010
From: Ville Syrjälä <ville.syrjala at nokia.com>
No functional change.
Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
---
hw/xfree86/common/xf86xv.c | 66 +++++++++++++++++++++++--------------------
1 files changed, 35 insertions(+), 31 deletions(-)
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index f70a2ef..e4c5082 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1035,6 +1035,40 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
}
}
+static void
+xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn)
+{
+ ScreenPtr pScreen = pScrn->pScreen;
+ XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
+ XvAdaptorPtr pa;
+ int c, i;
+
+ for (c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) {
+ XvPortPtr pPort = pa->pPorts;
+
+ for (i = pa->nPorts; i > 0; i--, pPort++) {
+ XvPortRecPrivatePtr pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
+ WindowPtr pWin = (WindowPtr)pPriv->pDraw;
+ Bool visible;
+
+ if (pPriv->isOn == XV_OFF || !pWin)
+ continue;
+
+ visible = pWin->visibility == VisibilityUnobscured ||
+ pWin->visibility == VisibilityPartiallyObscured;
+
+ /*
+ * Stop and remove still/images if
+ * ReputImage isn't supported.
+ */
+ if (!pPriv->type && !pPriv->AdaptorRec->ReputImage)
+ visible = FALSE;
+
+ xf86XVReputOrStopPort(pPriv, pWin, visible);
+ }
+ }
+}
+
/**** ScreenRec fields ****/
static Bool
@@ -1269,11 +1303,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[index];
ScreenPtr pScreen = pScrn->pScreen;
- XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- WindowPtr pWin;
- XvAdaptorPtr pa;
- int c, i;
if(ScreenPriv->AdjustFrame) {
pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
@@ -1281,33 +1311,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
pScrn->AdjustFrame = xf86XVAdjustFrame;
}
- for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) {
- XvPortPtr pPort = pa->pPorts;
- XvPortRecPrivatePtr pPriv;
-
- for(i = pa->nPorts; i > 0; i--, pPort++) {
- Bool visible;
-
- pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
-
- pWin = (WindowPtr)pPriv->pDraw;
-
- if (pPriv->isOn == XV_OFF || !pWin)
- continue;
-
- visible = pWin->visibility == VisibilityUnobscured ||
- pWin->visibility == VisibilityPartiallyObscured;
-
- /*
- * Stop and remove still/images if
- * ReputImage isn't supported.
- */
- if (!pPriv->type && !pPriv->AdaptorRec->ReputImage)
- visible = FALSE;
-
- xf86XVReputOrStopPort(pPriv, pWin, visible);
- }
- }
+ xf86XVReputOrStopAllPorts(pScrn);
}
--
1.7.2.2
More information about the xorg-devel
mailing list