summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-05 10:23:25 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-05 10:38:45 +0000
commita09ebe0b6cc66d08e52b57851d9b8a6a1f71df2b (patch)
treebdae12cc118e08e1aca6a3a7acf90095d70d2082
parent797b27365dc09a3f84349a33cffbfdc67cba0baa (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_glyphs.c7
2 files changed, 7 insertions, 1 deletions
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;
}