From 61226cd41faf320f79ee4bd72dc77163079da853 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 8 Mar 2012 13:41:58 +0000 Subject: [PATCH] sna: Fix handling of large glyphs following large and shared buffer work Part of the large buffer handling was to move the decision making about whether to create GPU bo for a pixmap to creation time. The single instance where we change our minds later is involving large glyphs which we choose not to cache. Signed-off-by: Chris Wilson --- src/sna/sna.h | 1 - src/sna/sna_accel.c | 2 +- src/sna/sna_glyphs.c | 2 +- src/sna/sna_render.c | 5 ++++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sna/sna.h b/src/sna/sna.h index 8340345e..441b24e5 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -684,7 +684,6 @@ memcpy_xor(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_accel.c b/src/sna/sna_accel.c index 08ee5374..5aad88b7 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -764,7 +764,7 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen, } if (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE) - goto fallback; + flags &= ~KGEM_CAN_CREATE_GPU; force_create: pad = PixmapBytePad(width, depth); diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 2733a1ae..1c536c82 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -315,7 +315,7 @@ glyph_cache(ScreenPtr screen, PixmapPtr pixmap = (PixmapPtr)glyph_picture->pDrawable; assert(glyph_picture->pDrawable->type == DRAWABLE_PIXMAP); if (pixmap->drawable.depth >= 8) { - pixmap->usage_hint = SNA_CREATE_GLYPH; + pixmap->usage_hint = 0; sna_pixmap_force_to_gpu(pixmap, MOVE_READ); } return FALSE; diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 421c7ff6..d1e35000 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -378,8 +378,11 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) bool upload; priv = sna_pixmap(pixmap); - if (!priv) + if (!priv) { + DBG(("%s: not migrating unattached pixmap\n", + __FUNCTION__)); return false; + } upload = true; if ((priv->create & KGEM_CAN_CREATE_GPU) == 0 ||