xserver: Branch 'master' - 2 commits

Michel Daenzer daenzer at kemper.freedesktop.org
Wed Jun 20 10:08:08 PDT 2007


 exa/exa_accel.c |   27 +++++++++------------------
 1 files changed, 9 insertions(+), 18 deletions(-)

New commits:
diff-tree c9b79a355845c895aca8303a39798264d80b6212 (from 87966c5d2889873cea6cbc16b7e4399490dfaec1)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Wed Jun 20 18:56:06 2007 +0200

    exaPolyFillRect: Don't track damage explicitly.
    
    All callers should already do it.
    
    Also don't leak pReg.

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 8d03dd5..cc383cc 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -643,15 +643,13 @@ exaPolyFillRect(DrawablePtr pDrawable,
     int		    n;
     ExaMigrationRec pixmaps[2];
     RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
-    RegionPtr pDamageReg = DamageRegion(ExaGetPixmapPriv(pPixmap)->pDamage);
 
     /* Compute intersection of rects and clip region */
     REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
     REGION_INTERSECT(pScreen, pReg, pClip, pReg);
 
     if (!REGION_NUM_RECTS(pReg)) {
-	REGION_DESTROY(pScreen, pReg);
-	return;
+	goto out;
     }
 
     pixmaps[0].as_dst = TRUE;
@@ -680,7 +678,7 @@ exaPolyFillRect(DrawablePtr pDrawable,
 	    (pGC->fillStyle == FillTiled && !pGC->tileIsPixel &&
 	     exaFillRegionTiled(pDrawable, pReg, pGC->tile.pixmap, &pGC->patOrg,
 				pGC->planemask, pGC->alu))) {
-	    goto damage;
+	    goto out;
 	}
     }
 
@@ -709,13 +707,7 @@ fallback:
 	}
 
 	ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect);
-
-damage:
-	REGION_TRANSLATE(pScreen, pReg, xoff, yoff);
-	REGION_UNION(pScreen, pDamageReg, pReg, pDamageReg);
-	REGION_DESTROY(pScreen, pReg);
-
-	return;
+	goto out;
     }
 
     xorg = pDrawable->x;
@@ -754,8 +746,6 @@ damage:
 	    (*pExaScr->info->Solid) (pPixmap,
 				     fullX1 + xoff, fullY1 + yoff,
 				     fullX2 + xoff, fullY2 + yoff);
-	    exaPixmapDirty (pPixmap, fullX1 + xoff, fullY1 + yoff,
-			    fullX2 + xoff, fullY2 + yoff);
 	}
 	else
 	{
@@ -786,14 +776,15 @@ damage:
 		    (*pExaScr->info->Solid) (pPixmap,
 					     partX1 + xoff, partY1 + yoff,
 					     partX2 + xoff, partY2 + yoff);
-		    exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff,
-				    partX2 + xoff, partY2 + yoff);
 		}
 	    }
 	}
     }
     (*pExaScr->info->DoneSolid) (pPixmap);
     exaMarkSync(pDrawable->pScreen);
+
+out:
+    REGION_DESTROY(pScreen, pReg);
 }
 
 static void
diff-tree 87966c5d2889873cea6cbc16b7e4399490dfaec1 (from 40f27a2df4906d9ceb1c78f6163a62c497321535)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Wed Jun 20 18:42:00 2007 +0200

    exaGetImage: Don't migrate or try to accelerate for 1x1.
    
    This is mainly to avoid wasting effort for XSync(), but just reading a single
    pixel directly is probably faster than DownloadFromScreen anyway. Though in
    light of the latter, even larger thresholds might be useful.
    
    Also move the swappedOut check before the migration checks because migration
    can't actually occur when swapped out.

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index bf63f2c..8d03dd5 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1329,6 +1329,9 @@ exaGetImage (DrawablePtr pDrawable, int 
     int xoff, yoff;
     Bool ok;
 
+    if (pExaScr->swappedOut || (w == 1 && h == 1))
+	goto fallback;
+
     if (pExaScr->info->DownloadFromScreen == NULL)
 	goto migrate_and_fallback;
 
@@ -1342,9 +1345,6 @@ exaGetImage (DrawablePtr pDrawable, int 
     if (pDrawable->bitsPerPixel < 8)
 	goto migrate_and_fallback;
 
-    if (pExaScr->swappedOut)
-	goto fallback;
-
     pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
     if (pPix == NULL)
 	goto fallback;


More information about the xorg-commit mailing list