[PATCH 03/10] xfree86/xv: Factor out the meat of xf86XVWindowExposures for later reuse

ville.syrjala at nokia.com ville.syrjala at nokia.com
Fri Oct 29 11:18:59 PDT 2010


From: Ville Syrjälä <ville.syrjala at nokia.com>

No fucntional change.

Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
---
 hw/xfree86/common/xf86xv.c |   53 +++++++++++++++++++++++--------------------
 1 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index f9b3d93..581e8a7 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1004,6 +1004,33 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
      portPriv->pDraw = NULL;
 }
 
+static void
+xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
+		      WindowPtr pWin,
+		      Bool AreasExposed)
+{
+    switch (pPriv->type) {
+    case XvInputMask:
+	xf86XVReputVideo(pPriv);
+	break;
+    case XvOutputMask:
+	xf86XVRegetVideo(pPriv);
+	break;
+    default:  /* overlaid still/image*/
+	if (pPriv->AdaptorRec->ReputImage)
+	    xf86XVReputImage(pPriv);
+	else if (AreasExposed) {
+	    if (pPriv->isOn == XV_ON) {
+		(*pPriv->AdaptorRec->StopVideo)(pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
+		pPriv->isOn = XV_PENDING;
+	    }
+
+	    xf86XVRemovePortFromWindow(pWin, pPriv);
+	}
+	break;
+    }
+}
+
 /****  ScreenRec fields ****/
 
 static Bool
@@ -1063,32 +1090,8 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
   while(WinPriv) {
      pPriv = WinPriv->PortRec;
 
-     /* Reput anyone with a reput function */
-
-     switch(pPriv->type) {
-     case XvInputMask:
-	xf86XVReputVideo(pPriv);
-	break;
-     case XvOutputMask:
-	xf86XVRegetVideo(pPriv);
-	break;
-     default:  /* overlaid still/image*/
-	if (pPriv->AdaptorRec->ReputImage)
-	   xf86XVReputImage(pPriv);
-	else if(AreasExposed) {
-	    if (pPriv->isOn == XV_ON) {
-		(*pPriv->AdaptorRec->StopVideo)(
-		    pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
-		pPriv->isOn = XV_PENDING;
-	    }
-
-	    WinPriv = WinPriv->next;
-	    xf86XVRemovePortFromWindow(pWin, pPriv);
-	    continue;
-	}
-	break;
-     }
      WinPriv = WinPriv->next;
+     xf86XVReputOrStopPort(pPriv, pWin, AreasExposed);
   }
 }
 
-- 
1.7.2.2



More information about the xorg-devel mailing list