xf86-video-intel: 3 commits - src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Nov 3 07:37:11 PDT 2011


 src/sna/sna_accel.c |   43 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 35 insertions(+), 8 deletions(-)

New commits:
commit 1677b273af67e2b690bd21a1b43a7d9f9d5a70c1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 3 14:31:53 2011 +0000

    sna: Skip encoding zero sized glyphs
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 95a149e..397a2d8 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -6882,9 +6882,6 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
 			int w8 = (w + 7) >> 3;
 			int x1, y1, len;
 
-			if (w == 0 || h == 0)
-				goto skip;
-
 			len = (w8 * h + 7) >> 3 << 1;
 			DBG(("%s glyph: (%d, %d) x (%d[%d], %d), len=%d\n" ,__FUNCTION__,
 			     x,y, w, w8, h, len));
@@ -7015,6 +7012,11 @@ static bool sna_set_glyph(CharInfoPtr in, CharInfoPtr out)
 	int stride = GLYPHWIDTHBYTESPADDED(in);
 	uint8_t *dst, *src;
 
+	if (w == 0 || h == 0) {
+		out->bits = (void *)-1;
+		return false;
+	}
+
 	w = (w + 7) >> 3;
 
 	out->metrics = in->metrics;
commit 239cfb99f9697392d7c25328093e6662ad04bdc9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 3 14:25:54 2011 +0000

    sna: Unroll the quadword upload of the glyph data
    
    We know that the length is nicely aligned and so can avoid a relatively
    expensive call into memcpy.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b457dd2..95a149e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -6877,7 +6877,6 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
 
 		do {
 			CharInfoPtr c = *info++;
-			uint8_t *glyph = FONTGLYPHBITS(base, c);
 			int w = GLYPHWIDTHPIXELS(c);
 			int h = GLYPHHEIGHTPIXELS(c);
 			int w8 = (w + 7) >> 3;
@@ -6930,7 +6929,16 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
 			b[0] = br00 | (1 + len);
 			b[1] = (uint16_t)y1 << 16 | (uint16_t)x1;
 			b[2] = (uint16_t)(y1+h) << 16 | (uint16_t)(x1+w);
-			memcpy(b+3, glyph, w8*h);
+			{
+				uint32_t *glyph = (uint32_t*)c->bits;
+				b += 3;
+				do  {
+					*b++ = *glyph++;
+					*b++ = *glyph++;
+
+					len -= 2;
+				} while (len);
+			}
 
 			if (damage) {
 				BoxRec r;
commit e2542bad88573e590ef4cbeed6b5884166b56adb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 3 14:17:05 2011 +0000

    sna: Add the missing returns to prevent fbImageGlyphBlt fallbacks
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ede994f..b457dd2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1057,7 +1057,7 @@ static void sna_gc_move_to_cpu(GCPtr gc, DrawablePtr drawable)
 	struct sna_gc *sgc = sna_gc(gc);
 	long changes = sgc->changes;
 
-	DBG(("%s, changes=%d\n", __FUNCTION_, changes_));
+	DBG(("%s, changes=%lx\n", __FUNCTION__, changes));
 
 	if (gc->clientClipType == CT_PIXMAP) {
 		PixmapPtr clip = gc->clientClip;
@@ -6819,6 +6819,9 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
 
 	uint8_t rop = transparent ? copy_ROP[gc->alu] : ROP_S;
 
+	DBG(("%s (%d, %d) x %d, transparent? %d, alu=%d\n",
+	     __FUNCTION__, _x, _y, _n, transparent, alu));
+
 	if (!sna_drawable_use_gpu_bo(drawable, &clip->extents, &damage))
 		return false;
 
@@ -7125,6 +7128,7 @@ sna_poly_text8(DrawablePtr drawable, GCPtr gc,
 	return x + extents.overallRight;
 
 fallback:
+	DBG(("%s: fallback -- depth=%d\n", __FUNCTION__, drawable->depth));
 	gc->font->get_glyphs(gc->font, count, (unsigned char *)chars,
 			     Linear8Bit, &n, info);
 	if (n == 0)
@@ -7133,6 +7137,8 @@ fallback:
 	extents.overallWidth = x;
 	for (i = 0; i < n; i++)
 		extents.overallWidth += info[i]->metrics.characterWidth;
+
+	DBG(("%s: fallback -- fbPolyGlyphBlt\n", __FUNCTION__));
 	fbPolyGlyphBlt(drawable, gc, x, y, n, info, FONTGLYPHS(gc->font));
 
 	return extents.overallWidth;
@@ -7193,6 +7199,7 @@ sna_poly_text16(DrawablePtr drawable, GCPtr gc,
 	return x + extents.overallRight;
 
 fallback:
+	DBG(("%s: fallback -- depth=%d\n", __FUNCTION__, drawable->depth));
 	gc->font->get_glyphs(gc->font, count, (unsigned char *)chars,
 			     FONTLASTROW(gc->font) ? TwoD16Bit : Linear16Bit,
 			     &n, info);
@@ -7202,6 +7209,8 @@ fallback:
 	extents.overallWidth = x;
 	for (i = 0; i < n; i++)
 		extents.overallWidth += info[i]->metrics.characterWidth;
+
+	DBG(("%s: fallback -- fbPolyGlyphBlt\n", __FUNCTION__));
 	fbPolyGlyphBlt(drawable, gc, x, y, n, info, FONTGLYPHS(gc->font));
 
 	return extents.overallWidth;
@@ -7257,12 +7266,16 @@ sna_image_text8(DrawablePtr drawable, GCPtr gc,
 				info, FONTGLYPHS(gc->font));
 	}
 	RegionUninit(&region);
+	return;
 
 fallback:
+	DBG(("%s: fallback, depth=%d\n", __FUNCTION__, drawable->depth));
 	gc->font->get_glyphs(gc->font, count, (unsigned char *)chars,
 			     Linear8Bit, &n, info);
-	if (n)
+	if (n) {
+		DBG(("%s: fallback -- fbImageGlyphBlt\n", __FUNCTION__));
 		fbImageGlyphBlt(drawable, gc, x, y, n, info, FONTGLYPHS(gc->font));
+	}
 }
 
 static void
@@ -7316,13 +7329,17 @@ sna_image_text16(DrawablePtr drawable, GCPtr gc,
 				info, FONTGLYPHS(gc->font));
 	}
 	RegionUninit(&region);
+	return;
 
 fallback:
+	DBG(("%s: fallback -- depth=%d\n", __FUNCTION__, drawable->depth));
 	gc->font->get_glyphs(gc->font, count, (unsigned char *)chars,
 			     FONTLASTROW(gc->font) ? TwoD16Bit : Linear16Bit,
 			     &n, info);
-	if (n)
+	if (n) {
+		DBG(("%s: fallback -- fbImageGlyphBlt\n", __FUNCTION__));
 		fbImageGlyphBlt(drawable, gc, x, y, n, info, FONTGLYPHS(gc->font));
+	}
 }
 
 static bool


More information about the xorg-commit mailing list