From 239cfb99f9697392d7c25328093e6662ad04bdc9 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 3 Nov 2011 14:25:54 +0000 Subject: 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 --- src/sna/sna_accel.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index b457dd20..95a149eb 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; -- cgit v1.2.3