xserver: Branch 'master' - 6 commits

Michel Daenzer daenzer at kemper.freedesktop.org
Thu Sep 27 04:38:18 PDT 2007


 exa/exa.c       |   34 ------------------------
 exa/exa_accel.c |   78 ++++++++++++++++----------------------------------------
 2 files changed, 23 insertions(+), 89 deletions(-)

New commits:
diff-tree 6d5c1e0d896666bcb2b3c1de7bfa424f140be364 (from 598698678b07cb3a9406a9ee98bd3186366949e7)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 13:04:41 2007 +0200

    EXA: Remove bogus pitch checks.
    
    exaCreatePixmap should handle all cases correctly.

diff --git a/exa/exa.c b/exa/exa.c
index ae6b70f..8d70558 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -726,40 +726,6 @@ exaDriverInit (ScreenPtr		pScreen,
 		   "non-NULL\n", pScreen->myNum);
 	return FALSE;
     }
-
-    /* If the driver doesn't set any max pitch values, we'll just assume
-     * that there's a limitation by pixels, and that it's the same as
-     * maxX.
-     */
-    if (!pScreenInfo->maxPitchPixels && !pScreenInfo->maxPitchBytes)
-    {
-        pScreenInfo->maxPitchPixels = pScreenInfo->maxX;
-    }
-
-    /* If set, maxPitchPixels must not be smaller than maxX. */
-    if (pScreenInfo->maxPitchPixels &&
-        pScreenInfo->maxPitchPixels < pScreenInfo->maxX)
-    {
-        LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::maxPitchPixels "
-                   "is smaller than ExaDriverRec::maxX\n",
-                   pScreen->myNum);
-	return FALSE;
-    }
-
-    /* If set, maxPitchBytes must not be smaller than maxX * 4.
-     * This is to ensure that a 32bpp pixmap with the maximum width
-     * can be handled wrt the pitch.
-     */
-    if (pScreenInfo->maxPitchBytes &&
-        pScreenInfo->maxPitchBytes < (pScreenInfo->maxX * 4))
-    {
-        LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::maxPitchBytes "
-                   "doesn't allow a 32bpp pixmap with width equal to "
-                   "ExaDriverRec::maxX\n",
-                   pScreen->myNum);
-	return FALSE;
-    }
-
 #ifdef RENDER
     ps = GetPictureScreenIfSet(pScreen);
 #endif
diff-tree 598698678b07cb3a9406a9ee98bd3186366949e7 (from 006f6525057970a74382132237b2131286ad147c)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 13:07:09 2007 +0200

    EXA: Punt for all fallbacks in exaFillRegion*.
    
    Now that PaintWindow is gone, all callers already handle fallbacks.

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 9089535..abe5c20 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1098,6 +1098,7 @@ exaFillRegionSolid (DrawablePtr	pDrawabl
     ExaPixmapPriv (pPixmap);
     int xoff, yoff;
     ExaMigrationRec pixmaps[1];
+    Bool ret = FALSE;
 
     pixmaps[0].as_dst = TRUE;
     pixmaps[0].as_src = FALSE;
@@ -1110,12 +1111,12 @@ exaFillRegionSolid (DrawablePtr	pDrawabl
 
     if (pExaPixmap->accel_blocked)
     {
-	goto fallback;
+	goto out;
     } else {
 	exaDoMigration (pixmaps, 1, TRUE);
     }
 
-    if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) &&
+    if (exaPixmapIsOffscreen (pPixmap) &&
 	(*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel))
     {
 	int nbox;
@@ -1152,24 +1153,13 @@ exaFillRegionSolid (DrawablePtr	pDrawabl
 			 pRegion);
 	}
 
-	REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
-	return TRUE;
+	ret = TRUE;
     }
 
-fallback:
-    if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) {
-	REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
-	return FALSE;
-    }
-    EXA_FALLBACK(("to %p (%c)\n", pDrawable,
-		  exaDrawableLocation(pDrawable)));
-    exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg);
+out:
     REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
-    fbFillRegionSolid (pDrawable, pRegion, 0,
-		       fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
-    exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
 
-    return TRUE;
+    return ret;
 }
 
 /* Try to do an accelerated tile of the pTile into pRegion of pDrawable.
@@ -1192,6 +1182,7 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
     ExaMigrationRec pixmaps[2];
     int nbox = REGION_NUM_RECTS (pRegion);
     BoxPtr pBox = REGION_RECTS (pRegion);
+    Bool ret = FALSE;
 
     tileWidth = pTile->drawable.width;
     tileHeight = pTile->drawable.height;
@@ -1221,7 +1212,7 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
 
     if (pExaPixmap->accel_blocked || pTileExaPixmap->accel_blocked)
     {
-	goto fallback;
+	goto out;
     } else {
 	exaDoMigration (pixmaps, 2, TRUE);
     }
@@ -1229,7 +1220,7 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
     pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
 
     if (!pPixmap || !exaPixmapIsOffscreen(pTile))
-	goto fallback;
+	goto out;
 
     if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask))
     {
@@ -1272,27 +1263,14 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
 	}
 	(*pExaScr->info->DoneCopy) (pPixmap);
 	exaMarkSync(pDrawable->pScreen);
-	REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
-	return TRUE;
-    }
 
-fallback:
-    if (alu != GXcopy || pPatOrg->x != 0 || pPatOrg->y != 0 ||
-	!EXA_PM_IS_SOLID(pDrawable, planemask)) {
-	REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
-	return FALSE;
+	ret = TRUE;
     }
-    EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable,
-		  exaDrawableLocation(&pTile->drawable),
-		  exaDrawableLocation(pDrawable)));
-    exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg);
+
+out:
     REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
-    exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC);
-    fbFillRegionTiled (pDrawable, pRegion, pTile);
-    exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC);
-    exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
 
-    return TRUE;
+    return ret;
 }
 
 
diff-tree 006f6525057970a74382132237b2131286ad147c (from da7d9aa1fb60e13a59c9f842fed7aefc5b97c195)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 13:08:41 2007 +0200

    EXA: Make sure tile offsets passed to drivers are never negative.
    
    Thanks to Björn Steinbrink for pointing out the problem on IRC.

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 142d556..9089535 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1239,7 +1239,8 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
 	    int dstY = pBox->y1;
 	    int tileY;
 
-	    tileY = (dstY - yoff - pDrawable->y - pPatOrg->y) % tileHeight;
+	    modulus(dstY - yoff - pDrawable->y - pPatOrg->y, tileHeight, tileY);
+
 	    while (height > 0) {
 		int width = pBox->x2 - pBox->x1;
 		int dstX = pBox->x1;
@@ -1250,7 +1251,9 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
 		    h = height;
 		height -= h;
 
-		tileX = (dstX - xoff - pDrawable->x - pPatOrg->x) % tileWidth;
+		modulus(dstX - xoff - pDrawable->x - pPatOrg->x, tileWidth,
+			tileX);
+
 		while (width > 0) {
 		    int w = tileWidth - tileX;
 		    if (w > width)
diff-tree da7d9aa1fb60e13a59c9f842fed7aefc5b97c195 (from d6f4764bf5f3a601a0034ded039857e8ea5563b2)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 13:08:40 2007 +0200

    EXA: Tile offscreen pixmap coordinate offsets are always 0.

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 76dbc72..142d556 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1187,7 +1187,7 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr pExaPixmap;
     ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile);
-    int xoff, yoff, tileXoff, tileYoff;
+    int xoff, yoff;
     int tileWidth, tileHeight;
     ExaMigrationRec pixmaps[2];
     int nbox = REGION_NUM_RECTS (pRegion);
@@ -1228,15 +1228,10 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
 
     pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
 
-    if (!pPixmap)
-	goto fallback;
-
-    if (!exaPixmapIsOffscreen(pTile))
+    if (!pPixmap || !exaPixmapIsOffscreen(pTile))
 	goto fallback;
 
-    if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile,
-							     &tileXoff, &tileYoff),
-				       pPixmap, 0, 0, alu, planemask))
+    if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask))
     {
 	while (nbox--)
 	{
@@ -1262,9 +1257,8 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
 			w = width;
 		    width -= w;
 
-		    (*pExaScr->info->Copy) (pPixmap,
-					    tileX + tileXoff, tileY + tileYoff,
-					    dstX, dstY, w, h);
+		    (*pExaScr->info->Copy) (pPixmap, tileX, tileY, dstX, dstY,
+					    w, h);
 		    dstX += w;
 		    tileX = 0;
 		}
diff-tree d6f4764bf5f3a601a0034ded039857e8ea5563b2 (from c7d6d1f589d729fa689d22d82fe30afbc6e1cacb)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 13:08:40 2007 +0200

    EXA: Remove some clearly bogus code from exaCopyNtoN.
    
    Not sure what I was thinking when I wrote this... it would cause the box
    coordinates to be off for exaCopyNtoNTwoDir or fallbacks.
    
    Thanks to Tilman Sauerbeck for pointing out the problem on IRC and testing the
    fix.

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 90595d4..76dbc72 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -508,14 +508,6 @@ exaCopyNtoN (DrawablePtr    pSrcDrawable
 
 	    region  = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED);
 	    DEALLOCATE_LOCAL(rects);
-
-	    if (region) {
-		src_off_x -= dst_off_x;
-		src_off_y -= dst_off_y;
-		dst_off_x = dst_off_y = 0;
-		pbox = REGION_RECTS(region);
-		nbox = REGION_NUM_RECTS(region);
-	    }
 	}
     }
 
diff-tree c7d6d1f589d729fa689d22d82fe30afbc6e1cacb (from 1d938a80fd4fa58d1791c146b6b5c2dfe148dce7)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 13:08:40 2007 +0200

    EXA: Punt on fallback case not handled correctly in exaFillRegionTiled.
    
    Fixes http://bugs.freedesktop.org/show_bug.cgi?id=12520 .

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 028d936..90595d4 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1288,7 +1288,8 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
     }
 
 fallback:
-    if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) {
+    if (alu != GXcopy || pPatOrg->x != 0 || pPatOrg->y != 0 ||
+	!EXA_PM_IS_SOLID(pDrawable, planemask)) {
 	REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
 	return FALSE;
     }


More information about the xorg-commit mailing list