From a09ebe0b6cc66d08e52b57851d9b8a6a1f71df2b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Jan 2012 10:23:25 +0000 Subject: [PATCH] sna: Immediately upload oversized glyphs Glyphs, even large ones, we suspect will be reused and so the deferred upload is counterproductive. Upload them immediately and mark them as special creatures for later debugging. Signed-off-by: Chris Wilson --- src/sna/sna.h | 1 + src/sna/sna_glyphs.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sna/sna.h b/src/sna/sna.h index 110eae9d..1e6a803a 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -705,6 +705,7 @@ memcpy_blt(const void *src, void *dst, int bpp, #define SNA_CREATE_FB 0x10 #define SNA_CREATE_SCRATCH 0x11 +#define SNA_CREATE_GLYPH 0x12 inline static bool is_power_of_two(unsigned x) { diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 95836feb..209b199b 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -307,7 +307,12 @@ glyph_cache(ScreenPtr screen, if (glyph->info.width > GLYPH_MAX_SIZE || glyph->info.height > GLYPH_MAX_SIZE) { - ((PixmapPtr)glyph_picture->pDrawable)->usage_hint = 0; + PixmapPtr pixmap = (PixmapPtr)glyph_picture->pDrawable; + assert(glyph_picture->pDrawable->type == DRAWABLE_PIXMAP); + if (pixmap->drawable.depth >= 8) { + pixmap->usage_hint = SNA_CREATE_GLYPH; + sna_pixmap_force_to_gpu(pixmap, MOVE_READ); + } return FALSE; }