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>
This commit is contained in:
Chris Wilson 2012-03-08 13:41:58 +00:00
parent aa7a2bd712
commit 61226cd41f
4 changed files with 6 additions and 4 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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;

View File

@ -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 ||