From fbdbfaf38d4da5204750d91cf5a3f43307a6ac33 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 13 Jul 2011 17:38:41 +0100 Subject: [PATCH] sna/glyphs: Discard GLYPH_PICTURE hint if the glyph doesn't fit into the cache If the glyph is too big to fit into the cache, than ideally we do want to keep an associated GPU bo around for future use. As it is too large to fit into the cache, it of reasonable size and there is little wastage in allocating indiviual GPU bo for each oversized glyph. Signed-off-by: Chris Wilson --- src/sna/sna_glyphs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 224154e6..87a67192 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -305,8 +305,10 @@ glyph_cache(ScreenPtr screen, int size, mask, pos, s; if (glyph->info.width > GLYPH_MAX_SIZE || - glyph->info.height > GLYPH_MAX_SIZE) + glyph->info.height > GLYPH_MAX_SIZE) { + ((PixmapPtr)glyph_picture->pDrawable)->usage_hint = 0; return FALSE; + } for (size = GLYPH_MIN_SIZE; size <= GLYPH_MAX_SIZE; size *= 2) if (glyph->info.width <= size && glyph->info.height <= size)