sna: Reset the source counter if we completely dirty the CPU pixmap

For a long lived pixmap which we are repeatedly using for upload and
copying to other pixmaps, we don't want to keep to maintain a GPU
buffer. So instead, reset the source counter if we discard the GPU bo
and treat the pixmap as purely CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-11-11 23:20:36 +00:00
parent 403a4dd353
commit 991ffcb60a
1 changed files with 3 additions and 0 deletions

View File

@ -166,6 +166,9 @@ static void sna_pixmap_destroy_gpu_bo(struct sna *sna, struct sna_pixmap *priv)
{
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
priv->gpu_bo = NULL;
/* and reset the upload counter */
priv->source_count = SOURCE_BIAS;
}
static Bool sna_destroy_private(PixmapPtr pixmap, struct sna_pixmap *priv)