diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-14 15:04:53 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-14 17:10:09 +0100 |
commit | 96aa7a236ac0605324a94f7b7d10413cb219f071 (patch) | |
tree | a7556d8c7d749cab73bf1832612283e9327d15b4 /src/i830_uxa.c | |
parent | 2d17bd50af367bead84985c22fdd43d264a5f072 (diff) |
i830: Allocate bo's for glyphs larger than 32x32.
As we only use the glyph cache for small glyphs, those large than 32x32
will first be copied to a bo and used as a mask in a composite
operation. We can avoid the allocation and upload per use by allocating
a bo for the over-sized glyph from the start. As the glyph is large
anyway, the excess memory allocation is less significant.
Using normal font sizes, firefox shows no change - as expected. However,
using the 36 font size traces, we see around a 10% improvement on g45.
Before:
xcb firefox-36-20090609 127.333 127.897 0.22%
xcb firefox-36-20090611 87.456 88.624 0.66%
xcb firefox-20090601 19.522 20.194 1.69%
xlib firefox-36-20090609 201.054 201.780 0.18%
xlib firefox-36-20090611 133.468 133.717 0.09%
xlib firefox-20090601 23.740 23.975 0.49%
With large glyphs in bo:
xcb firefox-36-20090609 117.256 118.254 0.42%
xcb firefox-36-20090611 79.462 79.962 0.31%
xcb firefox-20090601 19.658 20.024 0.92%
xlib firefox-36-20090609 185.645 188.202 0.68%
xlib firefox-36-20090611 123.592 124.940 0.54%
xlib firefox-20090601 23.917 24.098 0.38%
Thanks to Owain G. Ainsworth for the suggestion!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i830_uxa.c')
-rw-r--r-- | src/i830_uxa.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/i830_uxa.c b/src/i830_uxa.c index 58ed4917..f3f0f651 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -876,7 +876,7 @@ i830_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth, if (w > 32767 || h > 32767) return NullPixmap; - if (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE) + if (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE && w <= 32 && h <= 32) return fbCreatePixmap(screen, w, h, depth, usage); pixmap = fbCreatePixmap(screen, 0, 0, depth, usage); @@ -902,6 +902,14 @@ i830_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth, if (usage == UXA_CREATE_PIXMAP_FOR_MAP) priv->tiling = I915_TILING_NONE; + if (priv->tiling != I915_TILING_NONE) { + if (w < 256) + priv->tiling = I915_TILING_NONE; + if (h < 8) + priv->tiling = I915_TILING_NONE; + if (h < 32 && priv->tiling == I915_TILING_Y) + priv->tiling = I915_TILING_X; + } size = i830_uxa_pixmap_compute_size(pixmap, w, h, &priv->tiling, &stride); |