xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Jan 5 12:01:08 PST 2011


 composite/compalloc.c                  |   11 +++++++
 composite/compinit.c                   |   46 +++++++++++++++++++++++++++++++++
 composite/compint.h                    |    4 ++
 composite/compwindow.c                 |   34 ++++++++++++++++--------
 dix/window.c                           |    4 ++
 doc/xml/Xserver-spec.xml               |    7 ++---
 exa/exa_unaccel.c                      |    5 ++-
 hw/xfree86/common/xf86VGAarbiter.c     |    5 ++-
 hw/xfree86/common/xf86VGAarbiterPriv.h |    2 -
 hw/xfree86/xaa/xaaBitBlt.c             |    6 ++--
 include/scrnintstr.h                   |    3 +-
 include/windowstr.h                    |    3 ++
 mi/micopy.c                            |    6 ++--
 mi/misprite.c                          |    7 ++---
 miext/damage/damage.c                  |   20 --------------
 miext/rootless/rootlessScreen.c        |    5 ++-
 render/mipict.c                        |    3 +-
 17 files changed, 117 insertions(+), 54 deletions(-)

New commits:
commit f3480286aeb3009623d8d4b0202eadda0049552d
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Wed Jan 5 20:41:09 2011 +0200

    composite: Support updating an arbitrary subtree
    
    Rename compUpdateWindow to compPaintWindowToParent and split the child
    walk to compPaintChildrenToWindow. Calling compPaintChildrenToWindow
    allows an arbitrary subtree to be updated, instead of having to update
    all the windows. This will be used to make sure all the descendants are
    copied to the parent when the parent window contents need to be accessed
    in IncludeInferios sub-window mode.
    
    WindowRec has a new member 'damagedDescendants' that is used to keep
    track of which subtrees need updating. When a window is damaged,
    'damagedDescendants' will be set for all the ancestors, and when a
    subtree is updated, the tree walk can be stopped early if no damaged
    descendants are present.
    
    CompScreenRec no longer needs the 'damaged' member since the root
    window's 'damagedDescendants' provides the same information.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index b2e3f71..e4064f6 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -47,11 +47,11 @@
 
 #include "compint.h"
 
-void
+static void
 compScreenUpdate (ScreenPtr pScreen)
 {
     compCheckTree (pScreen);
-    compWindowUpdate (pScreen->root);
+    compPaintChildrenToWindow (pScreen->root);
 }
 
 static void
@@ -84,6 +84,15 @@ compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
         pScreen->BlockHandler = compBlockHandler;
     }
     cw->damaged = TRUE;
+
+    /* Mark the ancestors */
+    pWin = pWin->parent;
+    while (pWin) {
+	if (pWin->damagedDescendants)
+	    break;
+	pWin->damagedDescendants = TRUE;
+	pWin = pWin->parent;
+    }
 }
 
 static void
diff --git a/composite/compinit.c b/composite/compinit.c
index 74689be..90ee66c 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -145,7 +145,7 @@ compGetImage (DrawablePtr pDrawable,
 
     pScreen->GetImage = cs->GetImage;
     if (pDrawable->type == DRAWABLE_WINDOW)
-	compScreenUpdate (pScreen);
+	compPaintChildrenToWindow ((WindowPtr) pDrawable);
     (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine);
     cs->GetImage = pScreen->GetImage;
     pScreen->GetImage = compGetImage;
@@ -161,7 +161,7 @@ static void compSourceValidate(DrawablePtr pDrawable,
 
     pScreen->SourceValidate = cs->SourceValidate;
     if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors)
-	compScreenUpdate (pScreen);
+	compPaintChildrenToWindow ((WindowPtr) pDrawable);
     if (pScreen->SourceValidate)
 	(*pScreen->SourceValidate) (pDrawable, x, y, width, height,
 				    subWindowMode);
diff --git a/composite/compint.h b/composite/compint.h
index 681f651..57e0b5d 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -315,10 +315,7 @@ void
 compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
 
 void
-compWindowUpdate (WindowPtr pWin);
-
-void
-compScreenUpdate (ScreenPtr pScreen);
+compPaintChildrenToWindow (WindowPtr pWin);
 
 WindowPtr
 CompositeRealChildHead (WindowPtr pWin);
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 22d2374..2440f18 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -720,13 +720,11 @@ compWindowUpdateAutomatic (WindowPtr pWin)
     DamageEmpty (cw->damage);
 }
 
-void
-compWindowUpdate (WindowPtr pWin)
+static void
+compPaintWindowToParent (WindowPtr pWin)
 {
-    WindowPtr	pChild;
+    compPaintChildrenToWindow (pWin);
 
-    for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
-	compWindowUpdate (pChild);
     if (pWin->redirectDraw != RedirectDrawNone)
     {
 	CompWindowPtr	cw = GetCompWindow(pWin);
@@ -739,6 +737,20 @@ compWindowUpdate (WindowPtr pWin)
     }
 }
 
+void
+compPaintChildrenToWindow (WindowPtr pWin)
+{
+    WindowPtr pChild;
+
+    if (!pWin->damagedDescendants)
+	return;
+
+    for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
+	compPaintWindowToParent (pChild);
+
+    pWin->damagedDescendants = FALSE;
+}
+
 WindowPtr
 CompositeRealChildHead (WindowPtr pWin)
 {
diff --git a/dix/window.c b/dix/window.c
index d140dda..9be7064 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -298,6 +298,10 @@ SetWindowToDefaults(WindowPtr pWin)
 #ifdef ROOTLESS
     pWin->rootlessUnhittable = FALSE;
 #endif
+
+#ifdef COMPOSITE
+    pWin->damagedDescendants = FALSE;
+#endif
 }
 
 static void
diff --git a/include/windowstr.h b/include/windowstr.h
index 0b66ebb..4a7a0f4 100644
--- a/include/windowstr.h
+++ b/include/windowstr.h
@@ -167,6 +167,9 @@ typedef struct _Window {
 #ifdef ROOTLESS
     unsigned		rootlessUnhittable:1;	/* doesn't hit-test */
 #endif
+#ifdef COMPOSITE
+    unsigned		damagedDescendants:1;	/* some descendants are damaged */
+#endif
 } WindowRec;
 
 /*
commit b89e6dbdfbb50e3b5bc7fcb7eccc397c467c92f8
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Wed Jan 5 20:41:08 2011 +0200

    composite: Add SourceValidate wrapper
    
    When SourceValidate is performed on a window with IncludeInferiors
    sub-window mode, force an immediate update of all the automatically
    redirected windows, so that the current window contents will be up
    to date.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compinit.c b/composite/compinit.c
index e1a7656..74689be 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -78,6 +78,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
     pScreen->PositionWindow = cs->PositionWindow;
 
     pScreen->GetImage = cs->GetImage;
+    pScreen->SourceValidate = cs->SourceValidate;
 
     free(cs);
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
@@ -150,6 +151,24 @@ compGetImage (DrawablePtr pDrawable,
     pScreen->GetImage = compGetImage;
 }
 
+static void compSourceValidate(DrawablePtr pDrawable,
+			       int x, int y,
+			       int width, int height,
+			       unsigned int subWindowMode)
+{
+    ScreenPtr pScreen = pDrawable->pScreen;
+    CompScreenPtr cs = GetCompScreen (pScreen);
+
+    pScreen->SourceValidate = cs->SourceValidate;
+    if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors)
+	compScreenUpdate (pScreen);
+    if (pScreen->SourceValidate)
+	(*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+				    subWindowMode);
+    cs->SourceValidate = pScreen->SourceValidate;
+    pScreen->SourceValidate = compSourceValidate;
+}
+
 /*
  * Add alternate visuals -- always expose an ARGB32 and RGB24 visual
  */
@@ -385,6 +404,9 @@ compScreenInit (ScreenPtr pScreen)
     cs->GetImage = pScreen->GetImage;
     pScreen->GetImage = compGetImage;
 
+    cs->SourceValidate = pScreen->SourceValidate;
+    pScreen->SourceValidate = compSourceValidate;
+
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, cs);
 
     RegisterRealChildHeadProc(CompositeRealChildHead);
diff --git a/composite/compint.h b/composite/compint.h
index c188bf1..681f651 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -160,6 +160,7 @@ typedef struct _CompScreen {
     CompOverlayClientPtr        pOverlayClients;
     
     GetImageProcPtr		GetImage;
+    SourceValidateProcPtr	SourceValidate;
 } CompScreenRec, *CompScreenPtr;
 
 extern DevPrivateKeyRec CompScreenPrivateKeyRec;
commit 84154954db54696d4661eb8d0a6014cdbff3c91f
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Wed Jan 5 20:41:07 2011 +0200

    composite: Add GetImage wrapper
    
    When GetImage is performed on a window, force an immediate update of
    all the automatically redirected windows, so that the current window
    contents will be up to date.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 86a6f8e..b2e3f71 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -47,7 +47,7 @@
 
 #include "compint.h"
 
-static void
+void
 compScreenUpdate (ScreenPtr pScreen)
 {
     compCheckTree (pScreen);
diff --git a/composite/compinit.c b/composite/compinit.c
index 276ed75..e1a7656 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -77,6 +77,8 @@ compCloseScreen (int index, ScreenPtr pScreen)
     pScreen->CopyWindow = cs->CopyWindow;
     pScreen->PositionWindow = cs->PositionWindow;
 
+    pScreen->GetImage = cs->GetImage;
+
     free(cs);
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
     ret = (*pScreen->CloseScreen) (index, pScreen);
@@ -129,6 +131,25 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
     return ret;
 }
 
+static void
+compGetImage (DrawablePtr pDrawable,
+	      int sx, int sy,
+	      int w, int h,
+	      unsigned int format,
+	      unsigned long planemask,
+	      char *pdstLine)
+{
+    ScreenPtr pScreen = pDrawable->pScreen;
+    CompScreenPtr cs = GetCompScreen (pScreen);
+
+    pScreen->GetImage = cs->GetImage;
+    if (pDrawable->type == DRAWABLE_WINDOW)
+	compScreenUpdate (pScreen);
+    (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine);
+    cs->GetImage = pScreen->GetImage;
+    pScreen->GetImage = compGetImage;
+}
+
 /*
  * Add alternate visuals -- always expose an ARGB32 and RGB24 visual
  */
@@ -361,6 +382,9 @@ compScreenInit (ScreenPtr pScreen)
     cs->CloseScreen = pScreen->CloseScreen;
     pScreen->CloseScreen = compCloseScreen;
 
+    cs->GetImage = pScreen->GetImage;
+    pScreen->GetImage = compGetImage;
+
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, cs);
 
     RegisterRealChildHeadProc(CompositeRealChildHead);
diff --git a/composite/compint.h b/composite/compint.h
index 4b058e7..c188bf1 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -159,6 +159,7 @@ typedef struct _CompScreen {
     Window			overlayWid;
     CompOverlayClientPtr        pOverlayClients;
     
+    GetImageProcPtr		GetImage;
 } CompScreenRec, *CompScreenPtr;
 
 extern DevPrivateKeyRec CompScreenPrivateKeyRec;
@@ -315,6 +316,9 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
 void
 compWindowUpdate (WindowPtr pWin);
 
+void
+compScreenUpdate (ScreenPtr pScreen);
+
 WindowPtr
 CompositeRealChildHead (WindowPtr pWin);
 
commit a5dc3531e14589ac473cea482944d2d67517aabd
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Wed Jan 5 20:41:06 2011 +0200

    Revert "composite: Convert compWindowUpdate to use TraverseTree"
    
    TraverseTree visits the parent before the children. When performing
    the automatic redirection updates, the children must be visited before
    the parent.
    
    If there are automatically redirected windows on multiple levels of the
    tree, updating the parents before the children would cause the parent
    updates to use stale data for areas covered by the children. Also
    updating the damaged children would re-damage the parent, which would
    cause additional walks over the tree.
    
    In the worst case with an unbroken chain of automatically redirected
    subwindows, all of which are damaged, only the leaf window would be
    properly updated on the first round. Then it's parent would be properly
    updated on the second round, and so on. And on every round all of the
    ancestor windows would be updated as well, but with stale data.
    So with N damaged windows you would end up with (N^2+N)/2 updates,
    instead of the expected N.
    
    This reverts commit 648c8871c92727d7b6b16859f27f12266a06a16e.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compwindow.c b/composite/compwindow.c
index bbd5756..22d2374 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -653,9 +653,10 @@ compWindowFormat (WindowPtr pWin)
 }
 
 static void
-compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
+compWindowUpdateAutomatic (WindowPtr pWin)
 {
     CompWindowPtr   cw = GetCompWindow (pWin);
+    ScreenPtr	    pScreen = pWin->drawable.pScreen;
     WindowPtr	    pParent = pWin->parent;
     PixmapPtr	    pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
     PictFormatPtr   pSrcFormat = compWindowFormat (pWin);
@@ -678,7 +679,8 @@ compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
     /*
      * First move the region from window to screen coordinates
      */
-    RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y);
+    RegionTranslate(pRegion,
+		      pWin->drawable.x, pWin->drawable.y);
 
     /*
      * Clip against the "real" border clip
@@ -688,7 +690,8 @@ compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
     /*
      * Now translate from screen to dest coordinates
      */
-    RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y);
+    RegionTranslate(pRegion,
+		      -pParent->drawable.x, -pParent->drawable.y);
 
     /*
      * Clip the picture
@@ -717,26 +720,23 @@ compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
     DamageEmpty (cw->damage);
 }
 
-static int
-compWindowUpdateVisit(WindowPtr pWin, void *data)
+void
+compWindowUpdate (WindowPtr pWin)
 {
+    WindowPtr	pChild;
+
+    for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
+	compWindowUpdate (pChild);
     if (pWin->redirectDraw != RedirectDrawNone)
     {
-	CompWindowPtr cw = GetCompWindow(pWin);
+	CompWindowPtr	cw = GetCompWindow(pWin);
+
 	if (cw->damaged)
 	{
-	    compWindowUpdateAutomatic(pWin, data);
+	    compWindowUpdateAutomatic (pWin);
 	    cw->damaged = FALSE;
 	}
     }
-
-    return WT_WALKCHILDREN;
-}
-
-void
-compWindowUpdate (WindowPtr pWin)
-{
-    TraverseTree(pWin, compWindowUpdateVisit, pWin->drawable.pScreen);
 }
 
 WindowPtr
commit 0998574699502e6ab14fd8899c2e42961d4df7d0
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Wed Jan 5 20:41:05 2011 +0200

    Call SourceValidate even if src == dst
    
    The extra SourceValidate calls from damageCopyArea and damageCopyPlane
    can be removed.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/doc/xml/Xserver-spec.xml b/doc/xml/Xserver-spec.xml
index f7b2296..7d7f915 100644
--- a/doc/xml/Xserver-spec.xml
+++ b/doc/xml/Xserver-spec.xml
@@ -2958,8 +2958,7 @@ The sample server implementation is in Xserver/fb/fbscreen.c.</para>
 
 </programlisting></blockquote>
 SourceValidate should be called by CopyArea/CopyPlane primitives when
-the source drawable is not the same as the destination, and the
-SourceValidate function pointer in the screen is non-null.  If you know that
+the SourceValidate function pointer in the screen is non-null.  If you know that
 you will never need SourceValidate, you can avoid this check.  Currently,
 SourceValidate is used by the mi software cursor code to remove the cursor
 from the screen when the source rectangle overlaps the cursor position.
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
index dfe51ea..049dbfb 100644
--- a/hw/xfree86/xaa/xaaBitBlt.c
+++ b/hw/xfree86/xaa/xaaBitBlt.c
@@ -54,8 +54,7 @@ XAABitBlt(
     origDest.x = dstx;
     origDest.y = dsty;
 
-    if((pSrcDrawable != pDstDrawable) && 
-			pSrcDrawable->pScreen->SourceValidate) {
+    if (pSrcDrawable->pScreen->SourceValidate) {
 	(*pSrcDrawable->pScreen->SourceValidate) (
 			pSrcDrawable, srcx, srcy, width, height,
 			pGC->subWindowMode);
diff --git a/mi/micopy.c b/mi/micopy.c
index 50e2667..652c620 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -183,8 +183,7 @@ miDoCopy (DrawablePtr	pSrcDrawable,
 	return NULL;
     }
 
-    if ((pSrcDrawable != pDstDrawable) &&
-	pSrcDrawable->pScreen->SourceValidate)
+    if (pSrcDrawable->pScreen->SourceValidate)
     {
 	(*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc,
 						  pGC->subWindowMode);
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index d0e0fe4..566995c 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -891,17 +891,6 @@ damageCopyArea(DrawablePtr   pSrc,
     RegionPtr ret;
     DAMAGE_GC_OP_PROLOGUE(pGC, pDst);
     
-    /* The driver will only call SourceValidate() when pSrc != pDst,
-     * but the software sprite (misprite.c) always need to know when a
-     * drawable is copied so it can remove the sprite. See #1030. */
-    if ((pSrc == pDst) && pSrc->pScreen->SourceValidate &&
-	pSrc->type == DRAWABLE_WINDOW &&
-	((WindowPtr)pSrc)->viewable)
-    {
-	(*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height,
-					  pGC->subWindowMode);
-    }
-    
     if (checkGCDamage (pDst, pGC))
     {
 	BoxRec box;
@@ -938,17 +927,6 @@ damageCopyPlane(DrawablePtr	pSrc,
     RegionPtr ret;
     DAMAGE_GC_OP_PROLOGUE(pGC, pDst);
 
-    /* The driver will only call SourceValidate() when pSrc != pDst,
-     * but the software sprite (misprite.c) always need to know when a
-     * drawable is copied so it can remove the sprite. See #1030. */
-    if ((pSrc == pDst) && pSrc->pScreen->SourceValidate &&
-	pSrc->type == DRAWABLE_WINDOW &&
-	((WindowPtr)pSrc)->viewable)
-    {
-	(*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height,
-					  pGC->subWindowMode);
-    }
-
     if (checkGCDamage (pDst, pGC))
     {
 	BoxRec box;
commit e41e907b3c19908f5316346fa587ced3115478cd
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Wed Jan 5 20:41:04 2011 +0200

    Add subWindowMode parameter to SourceValidate
    
    Pass the subWindowMode from the GC/source Picture to SourceValidate.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/doc/xml/Xserver-spec.xml b/doc/xml/Xserver-spec.xml
index a2aec2f..f7b2296 100644
--- a/doc/xml/Xserver-spec.xml
+++ b/doc/xml/Xserver-spec.xml
@@ -2954,6 +2954,7 @@ The sample server implementation is in Xserver/fb/fbscreen.c.</para>
 	pScreen->SourceValidate(pDrawable, x, y, width, height)
 		DrawablePtr pDrawable;
 		int x, y, width, height;
+		unsigned int subWindowMode;
 
 </programlisting></blockquote>
 SourceValidate should be called by CopyArea/CopyPlane primitives when
@@ -2963,7 +2964,8 @@ you will never need SourceValidate, you can avoid this check.  Currently,
 SourceValidate is used by the mi software cursor code to remove the cursor
 from the screen when the source rectangle overlaps the cursor position.
 x,y,width,height describe the source rectangle (source relative, that is)
-for the copy operation.</para>
+for the copy operation.  subWindowMode comes from the GC or source Picture.
+</para>
 <para>
 <blockquote><programlisting>
 
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index d3c405f..bd533c4 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -438,7 +438,8 @@ ExaSrcValidate(DrawablePtr pDrawable,
 	       int x,
 	       int y,
 	       int width,
-	       int height)
+	       int height,
+	       unsigned int subWindowMode)
 {
     ScreenPtr pScreen = pDrawable->pScreen;
     ExaScreenPriv(pScreen);
@@ -464,7 +465,7 @@ ExaSrcValidate(DrawablePtr pDrawable,
 
     if (pExaScr->SavedSourceValidate) {
         swap(pExaScr, pScreen, SourceValidate);
-        pScreen->SourceValidate(pDrawable, x, y, width, height);
+        pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode);
         swap(pExaScr, pScreen, SourceValidate);
     }
 }
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index e518f45..215e845 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -325,13 +325,14 @@ VGAarbiterGetSpans (
 static void
 VGAarbiterSourceValidate (
     DrawablePtr pDrawable,
-    int x, int y, int width, int height )
+    int x, int y, int width, int height,
+    unsigned int subWindowMode )
 {
     ScreenPtr   pScreen = pDrawable->pScreen;
     SCREEN_PROLOG (SourceValidate);
     VGAGet(pScreen);
     if (pScreen->SourceValidate)
-    (*pScreen->SourceValidate) (pDrawable, x, y, width, height);
+    (*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode);
     VGAPut();
     SCREEN_EPILOG (SourceValidate, VGAarbiterSourceValidate);
 }
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index 2920fb5..848e45d 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -149,7 +149,7 @@ static void VGAarbiterGetImage (DrawablePtr pDrawable, int sx, int sy, int w,
 static void VGAarbiterGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr
     ppt, int *pwidth, int nspans, char  *pdstStart);
 static void VGAarbiterSourceValidate (DrawablePtr pDrawable, int x, int y,
-    int width, int height);
+    int width, int height, unsigned int subWindowMode);
 static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
     RegionPtr prgnSrc);
 static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
index 5148ed4..dfe51ea 100644
--- a/hw/xfree86/xaa/xaaBitBlt.c
+++ b/hw/xfree86/xaa/xaaBitBlt.c
@@ -57,7 +57,8 @@ XAABitBlt(
     if((pSrcDrawable != pDstDrawable) && 
 			pSrcDrawable->pScreen->SourceValidate) {
 	(*pSrcDrawable->pScreen->SourceValidate) (
-			pSrcDrawable, srcx, srcy, width, height);
+			pSrcDrawable, srcx, srcy, width, height,
+			pGC->subWindowMode);
     }
 
     srcx += pSrcDrawable->x;
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 00d014c..9952325 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -135,7 +135,8 @@ typedef    void (* SourceValidateProcPtr)(
 	int /*x*/,
 	int /*y*/,
 	int /*width*/,
-	int /*height*/);
+	int /*height*/,
+	unsigned int /*subWindowMode*/);
 
 typedef    Bool (* CreateWindowProcPtr)(
 	WindowPtr /*pWindow*/);
diff --git a/mi/micopy.c b/mi/micopy.c
index 027c461..50e2667 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -186,7 +186,8 @@ miDoCopy (DrawablePtr	pSrcDrawable,
     if ((pSrcDrawable != pDstDrawable) &&
 	pSrcDrawable->pScreen->SourceValidate)
     {
-	(*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc);
+	(*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc,
+						  pGC->subWindowMode);
     }
 
     /* Compute source clip region */
diff --git a/mi/misprite.c b/mi/misprite.c
index c25c093..770951e 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -198,7 +198,8 @@ static void	    miSpriteGetSpans(DrawablePtr pDrawable, int wMax,
 				     DDXPointPtr ppt, int *pwidth, int nspans,
 				     char *pdstStart);
 static void	    miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
-					   int width, int height);
+					   int width, int height,
+					   unsigned int subWindowMode);
 static void	    miSpriteCopyWindow (WindowPtr pWindow,
 					DDXPointRec ptOldOrg,
 					RegionPtr prgnSrc);
@@ -489,7 +490,7 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
 
 static void
 miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
-                        int height)
+                        int height, unsigned int subWindowMode)
 {
     ScreenPtr		    pScreen = pDrawable->pScreen;
     DeviceIntPtr            pDev;
@@ -517,7 +518,7 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
     }
 
     if (pScreen->SourceValidate)
-	(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
+	(*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode);
 
     SCREEN_EPILOGUE (pPriv, pScreen, SourceValidate);
 }
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 21cbb78..d0e0fe4 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -898,7 +898,8 @@ damageCopyArea(DrawablePtr   pSrc,
 	pSrc->type == DRAWABLE_WINDOW &&
 	((WindowPtr)pSrc)->viewable)
     {
-	(*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height);
+	(*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height,
+					  pGC->subWindowMode);
     }
     
     if (checkGCDamage (pDst, pGC))
@@ -944,7 +945,8 @@ damageCopyPlane(DrawablePtr	pSrc,
 	pSrc->type == DRAWABLE_WINDOW &&
 	((WindowPtr)pSrc)->viewable)
     {
-        (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height);
+	(*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height,
+					  pGC->subWindowMode);
     }
 
     if (checkGCDamage (pDst, pGC))
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 61d2f5d..510d6fd 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -223,7 +223,8 @@ out:
  *  here and leave StopDrawing for the block handler.
  */
 static void
-RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h)
+RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h,
+                       unsigned int subWindowMode)
 {
     SCREEN_UNWRAP(pDrawable->pScreen, SourceValidate);
     if (pDrawable->type == DRAWABLE_WINDOW) {
@@ -231,7 +232,7 @@ RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h)
         RootlessStartDrawing(pWin);
     }
     if (pDrawable->pScreen->SourceValidate) {
-        pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h);
+        pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h, subWindowMode);
     }
     SCREEN_WRAP(pDrawable->pScreen, SourceValidate);
 }
diff --git a/render/mipict.c b/render/mipict.c
index b5b8970..de5eea6 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -386,7 +386,8 @@ miCompositeSourceValidate (PicturePtr	pPicture,
 	}
         x += pPicture->pDrawable->x;
         y += pPicture->pDrawable->y;
-	(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
+	(*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+				    pPicture->subWindowMode);
     }
 }
 


More information about the xorg-commit mailing list