xserver: Branch 'server-1.5-branch' - 2 commits

Adam Jackson ajax at kemper.freedesktop.org
Thu May 8 13:12:17 PDT 2008


 hw/xfree86/xaa/xaaInit.c |    4 -
 hw/xfree86/xaa/xaaPict.c |  144 -----------------------------------------------
 2 files changed, 3 insertions(+), 145 deletions(-)

New commits:
commit 64948dc667fb6841147e87dafd5711b544511cf1
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu May 8 16:04:24 2008 -0400

    Bug #13104: Remove broken XAA a1 glyph fast path.
    
    (cherry picked from commit f17ba5d5849c92603f453195aca384844ca76d74)

diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
index 74e90e3..784c649 100644
--- a/hw/xfree86/xaa/xaaPict.c
+++ b/hw/xfree86/xaa/xaaPict.c
@@ -588,150 +588,6 @@ XAADoGlyphs (CARD8         op,
         IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
         return FALSE;
 
-    if(maskFormat && (maskFormat->depth == 1) && 
-       (pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1) &&
-       (op == PictOpOver) && infoRec->WriteBitmap &&
-       !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
-    {
-	CARD16 red, green, blue, alpha;
-	CARD32 pixel =
-                *((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
-	CARD32 *bits, *pntr, *pnt;
-	int x, y, i, n, left, top, right, bottom, width, height, pitch;
-	int L, T, R, B, X, Y, h, w, dwords, row, column, nbox;
-	int leftEdge, rightEdge, topLine, botLine;
-	BoxPtr pbox;
-	GlyphPtr glyph;
-	
-	if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
-		return FALSE;
-
-	if(alpha != 0xffff) return FALSE;
-
-	XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
-
-	if((infoRec->WriteBitmapFlags & RGB_EQUAL) && !((red == green) && (green == blue)))
-	   return FALSE;
-
-	x = pDst->pDrawable->x;
-	y = pDst->pDrawable->y;
-
-	while(nlist--) {
-	    x += list->xOff;
-	    y += list->yOff;
-	    left = right = X = x;
-	    top = bottom = Y = y;
-	    for(i = 0; i < list->len; i++) {
-		glyph = glyphs[i];
-
-		L = X - glyph->info.x;
-		if(L < left) left = L;
-		R = L + glyph->info.width;
-		if(R > right) right = R;
-
-		T = Y - glyph->info.y;
-		if(T < top) top = T;
-		B = T + glyph->info.height;
-		if(B > bottom) bottom = B;
-
-		X += glyph->info.xOff;
-		Y += glyph->info.yOff;
-	    }
-
-	    width = right - left;
-	    height = bottom - top;
-
-	    if(width && height) {
-		pitch = (((width + 31) & ~31) >> 5) + 1;
-		pntr = (CARD32*)xalloc(sizeof(CARD32) * pitch * height);
-		if(!pntr) 
-		    return TRUE;
-		bzero(pntr, sizeof(CARD32) * pitch * height);
-		n = list->len;
-
-		X = x; Y = y;
-		while(n--) {
-		    glyph = *glyphs++;
-		    h = glyph->info.height;
-		    w = glyph->info.width;
-		    if(h && w) {
-			row = y - top - glyph->info.y;
-			column = x - left - glyph->info.x;
-			pnt = pntr + (row * pitch) + (column >> 5);
-			column &= 31;
-			dwords = ((w + 31) >> 5) - 1;
-			bits = (CARD32*)(glyph + 1);
-			if(dwords) {
-			  while(h--) {
-			    for(i = 0; i <= dwords; i++) {
-				if(column) {
-				    pnt[i] |= SHIFT_L(*bits, column);
-				    pnt[i + 1] |= SHIFT_R(*bits, 32 - column);
-				} else
-				    pnt[i] |= *bits;
-
-				if(i != dwords) bits++;
-			    }
-			    bits++;
-			    pnt += pitch;
-			  } 
-			} else {
-			  if(column) {
-			     while(h--) {
-				pnt[0] |= SHIFT_L(*bits, column);
-				pnt[0 + 1] |= SHIFT_R(*bits, 32 - column);
-				bits++;
-				pnt += pitch;
-			     }
-			  } else {
-			     while(h--) {
-				*pnt |= *bits++;
-				pnt += pitch;
-			     }			  
-			  }	  
-			}
-		    }
-		    x += glyph->info.xOff;
-		    y += glyph->info.yOff;
-		}
-		
-		nbox = REGION_NUM_RECTS(pDst->pCompositeClip);
-		pbox = REGION_RECTS(pDst->pCompositeClip);
-		
-		while(nbox && (top >= pbox->y2)) {
-		    pbox++; nbox--;
-		}
-		
-		while(nbox && (bottom > pbox->y1)) {		
-		    leftEdge = max(left, pbox->x1);
-		    rightEdge = min(right, pbox->x2);
-		    
-		    if(rightEdge > leftEdge) {
-		    	column = leftEdge - left;
-			topLine = max(top, pbox->y1);
-			botLine = min(bottom, pbox->y2);
-			h = botLine - topLine;
-			
-			if(h > 0) {
-			  (*infoRec->WriteBitmap)(infoRec->pScrn, 
-			  	leftEdge, topLine, rightEdge - leftEdge, h,
-				(unsigned char*)(pntr + 
-				  ((topLine - top) * pitch) + (column >> 5)),
-				pitch << 2, column & 31, pixel, -1, GXcopy, ~0);
-			}
-		    }	
-		    nbox--; pbox++;
-	   	}
-		xfree(pntr);
-	    } else {
-		x = X; y = Y;
-	    }
-	    list++;
-	}
-
-	return TRUE;
-    }
-
     /*
      * If it looks like we have a chance of being able to draw these
      * glyphs with an accelerated Composite, do that now to avoid
commit f2aa0000a2220df4158ded8284d70954670aff36
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue May 6 17:52:37 2008 -0400

    Bug #13104: Don't let XAA glyph pixmaps anywhere near video memory.
    
    Since glyphs are stored in pixmaps now, they can make their way into VRAM,
    which invalidates a bunch of fast-path assumptions in the XAA code.  Thus
    you end up doing color-expands or WriteBitmap from la-la land and your
    aliased glyphs go all funny.
    
    Since XAA isn't ever growing the ability to do sane glyph accel, just force
    glyph pixmaps into host memory by catching them at CreatePixmap time.
    (cherry picked from commit 718652eaf9221e0eeec2c971dd7baa97f827451b)

diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 892cbcf..22a35a0 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -342,7 +342,9 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
     if (!infoRec->offscreenDepthsInitialized)
 	XAAInitializeOffscreenDepths (pScreen);
 
-    if(pScrn->vtSema && (infoRec->offscreenDepths & (1 << (depth - 1))) &&
+    if(pScrn->vtSema &&
+	(usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
+	(infoRec->offscreenDepths & (1 << (depth - 1))) &&
 	(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
 	(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
 	(!infoRec->maxOffPixHeight || (h <= infoRec->maxOffPixHeight)) )


More information about the xorg-commit mailing list