xserver: Branch 'no-pci-rework' - 4 commits

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


 exa/exa_accel.c |   34 ++++++++++++----------------------
 1 file changed, 12 insertions(+), 22 deletions(-)

New commits:
diff-tree dc37f91d94b1b580f589cefe40630017bb4d8bb8 (from 820bc604389f0a9eb7de0864766dcb0e977e099a)
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 3732f88..a29f3d0 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1238,7 +1238,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;
@@ -1249,7 +1250,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 820bc604389f0a9eb7de0864766dcb0e977e099a (from 49112ed3b168a5cca68575cd3f62d146b1da75a0)
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 7501df7..3732f88 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1185,7 +1185,7 @@ exaFillRegionTiled (DrawablePtr	pDrawabl
 {
     ExaScreenPriv(pDrawable->pScreen);
     PixmapPtr pPixmap;
-    int xoff, yoff, tileXoff, tileYoff;
+    int xoff, yoff;
     int tileWidth, tileHeight;
     ExaMigrationRec pixmaps[2];
     int nbox = REGION_NUM_RECTS (pRegion);
@@ -1227,15 +1227,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--)
 	{
@@ -1261,9 +1256,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 49112ed3b168a5cca68575cd3f62d146b1da75a0 (from 7927850b85f8e2143c8cecdea7c4dbd5960cd0f9)
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 22c7d56..7501df7 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -507,14 +507,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 7927850b85f8e2143c8cecdea7c4dbd5960cd0f9 (from 5a609821d1fffa011a6287d076d64a9cf17e4b07)
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 ecb4fd9..22c7d56 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1287,7 +1287,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