[PATCH 04/10] xfree86/xv: Allow xf86XVReputOrStopPort() to stop PutVideo/GetVideo ports

ville.syrjala at nokia.com ville.syrjala at nokia.com
Fri Oct 29 11:19:00 PDT 2010


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

Modify xf86XVReputOrStopPort() to allow stopping of all types of ports.
Will be useful later.

No functional change.

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

diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 581e8a7..4ed1177 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1007,8 +1007,20 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
 static void
 xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
 		      WindowPtr pWin,
-		      Bool AreasExposed)
+		      Bool visible)
 {
+    if (!visible) {
+	if (pPriv->isOn == XV_ON) {
+	    (*pPriv->AdaptorRec->StopVideo)(pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
+	    pPriv->isOn = XV_PENDING;
+	}
+
+	if (!pPriv->type) /* overlaid still/image*/
+	    xf86XVRemovePortFromWindow(pWin, pPriv);
+
+	return;
+    }
+
     switch (pPriv->type) {
     case XvInputMask:
 	xf86XVReputVideo(pPriv);
@@ -1019,14 +1031,6 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
     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;
     }
 }
@@ -1088,10 +1092,19 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
   if (!pWin->valdata) return;
 
   while(WinPriv) {
+     Bool visible = TRUE;
+
      pPriv = WinPriv->PortRec;
 
+     /*
+      * Stop and remove still/images if areas were exposed and
+      * ReputImage isn't supported.
+      */
+     if (!pPriv->type && !pPriv->AdaptorRec->ReputImage)
+	visible = !AreasExposed;
+
      WinPriv = WinPriv->next;
-     xf86XVReputOrStopPort(pPriv, pWin, AreasExposed);
+     xf86XVReputOrStopPort(pPriv, pWin, visible);
   }
 }
 
-- 
1.7.2.2



More information about the xorg-devel mailing list