xserver: Branch 'master'

Maarten Maathuis madman2003 at kemper.freedesktop.org
Tue Feb 17 10:43:22 PST 2009


 exa/exa_migration.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit b2ceea3635ec05dca9d4aa2f823b96ae9fce7fe8
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Tue Feb 17 19:40:59 2009 +0100

    Revert "exa: the extent of the valid region is probably much larger than that of the pending damage."
    
    This reverts commit 97c1cbc70216366e92b9371de608ce94e60aa874.
    
    - Sorry for the thinko, pending damage is often not fragmentated.
    - Should the dst region become fragmentated, you actually want to copy more to unfragmentate it.

diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 36b1a8c..9d0eda0 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -174,13 +174,23 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
 #endif
 
 	    /* Try to prevent destination valid region from growing too many
-	     * rects by filling it up to the extents of the pending damage region.
+	     * rects by filling it up to the extents of the union of the
+	     * destination valid region and the pending damage region.
 	     */
 	    if (REGION_NUM_RECTS(pValidDst) > 10) {
-		BoxPtr pDamageExt = REGION_EXTENTS(pScreen, pending_damage);
+		BoxRec box;
+		BoxPtr pValidExt, pDamageExt;
 		RegionRec closure;
 
-		REGION_INIT(pScreen, &closure, pDamageExt, 0);
+		pValidExt = REGION_EXTENTS(pScreen, pValidDst);
+		pDamageExt = REGION_EXTENTS(pScreen, pending_damage);
+
+		box.x1 = min(pValidExt->x1, pDamageExt->x1);
+		box.y1 = min(pValidExt->y1, pDamageExt->y1);
+		box.x2 = max(pValidExt->x2, pDamageExt->x2);
+		box.y2 = max(pValidExt->y2, pDamageExt->y2);
+
+		REGION_INIT(pScreen, &closure, &box, 0);
 		REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, &closure);
 	    } else
 		REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage);


More information about the xorg-commit mailing list