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

ville.syrjala at nokia.com ville.syrjala at nokia.com
Tue Nov 2 11:05:48 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 b6a9bf6..2942dc6 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1051,7 +1051,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;
 
@@ -1064,8 +1063,6 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
   /* filter out XClearWindow/Area */
   if (!pWin->valdata) return;
 
-  pPrev = NULL;
-
   while(WinPriv) {
      pPriv = WinPriv->PortRec;
 
@@ -1082,28 +1079,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;
   }
 }
@@ -1115,7 +1102,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);
@@ -1143,21 +1129,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