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:
parent
292097590b
commit
dbb495c3ae
|
|
@ -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++;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue