summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-08 13:41:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-08 14:05:20 +0000
commit61226cd41faf320f79ee4bd72dc77163079da853 (patch)
treef731459aa746fcc18900cf3c7436c70d9325a1fd
parentaa7a2bd71275e069a2e4383a26355854b0b8044c (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_accel.c2
-rw-r--r--src/sna/sna_glyphs.c2
-rw-r--r--src/sna/sna_render.c5
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 ||