[PATCH 02/10] xfree86/xv: Eliminate two open coded copies of xf86XVRemovePortFromWindow

ville.syrjala at nokia.com ville.syrjala at nokia.com
Fri Oct 29 11:18:58 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 |   27 ++-------------------------
 1 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 532f0b2..f9b3d93 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1048,7 +1048,6 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
   ScreenPtr pScreen = pWin->drawable.pScreen;
   XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
   XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
-  XF86XVWindowPtr pPrev;
   XvPortRecPrivatePtr pPriv;
   Bool AreasExposed;
 
@@ -1061,8 +1060,6 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
   /* filter out XClearWindow/Area */
   if (!pWin->valdata) return;
 
-  pPrev = NULL;
-
   while(WinPriv) {
      pPriv = WinPriv->PortRec;
 
@@ -1079,28 +1076,18 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
 	if (pPriv->AdaptorRec->ReputImage)
 	   xf86XVReputImage(pPriv);
 	else if(AreasExposed) {
-	    XF86XVWindowPtr tmp;
-
 	    if (pPriv->isOn == XV_ON) {
 		(*pPriv->AdaptorRec->StopVideo)(
 		    pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
 		pPriv->isOn = XV_PENDING;
 	    }
-	    pPriv->pDraw = NULL;
 
-	    if(!pPrev)
-		dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey,
-			      WinPriv->next);
-	    else
-	       pPrev->next = WinPriv->next;
-	    tmp = WinPriv;
 	    WinPriv = WinPriv->next;
-	    free(tmp);
+	    xf86XVRemovePortFromWindow(pWin, pPriv);
 	    continue;
 	}
 	break;
      }
-     pPrev = WinPriv;
      WinPriv = WinPriv->next;
   }
 }
@@ -1112,7 +1099,6 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
   ScreenPtr pScreen = pWin->drawable.pScreen;
   XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
   XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
-  XF86XVWindowPtr tmp, pPrev = NULL;
   XvPortRecPrivatePtr pPriv;
   Bool visible = (pWin->visibility == VisibilityUnobscured) ||
 		 (pWin->visibility == VisibilityPartiallyObscured);
@@ -1140,21 +1126,12 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
 	}
 
 	if(!pPriv->type) {  /* overlaid still/image */
-	    pPriv->pDraw = NULL;
-
-	    if(!pPrev)
-		dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey,
-			      WinPriv->next);
-	    else
-	       pPrev->next = WinPriv->next;
-	    tmp = WinPriv;
 	    WinPriv = WinPriv->next;
-	    free(tmp);
+	    xf86XVRemovePortFromWindow(pWin, pPriv);
 	    continue;
 	}
      }
 
-     pPrev = WinPriv;
      WinPriv = WinPriv->next;
   }
 
-- 
1.7.2.2



More information about the xorg-devel mailing list