sna: Attach to the pixmap for source counting when deferring uploads

If we decide to defer the upload for this instance of the source pixmap,
mark it so. Then if we do use it again we will upload it to a GPU bo and
hopefully reuse those pixels.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-05 10:34:08 +00:00
parent 292097590b
commit dbb495c3ae
1 changed files with 2 additions and 2 deletions

View File

@ -323,7 +323,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box)
pixmap->drawable.width,
pixmap->drawable.height,
pixmap->drawable.bitsPerPixel) == I915_TILING_NONE) {
priv = sna_pixmap(pixmap);
priv = sna_pixmap_attach(pixmap);
upload = priv && priv->source_count++ > SOURCE_BIAS;
}
@ -340,7 +340,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box)
return FALSE;
count = SOURCE_BIAS;
priv = sna_pixmap(pixmap);
priv = sna_pixmap_attach(pixmap);
if (priv)
count = priv->source_count++;