summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-11 23:20:36 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-11 23:22:35 +0000
commit991ffcb60a15f08ebb396d4d4ec86d5aff0ded31 (patch)
treefdbf15a16c7cc4cda565c7a17c641239852ffcf9
parent403a4dd353eef67decfba965e40623e8137e1944 (diff)
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>
-rw-r--r--src/sna/sna_accel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 561747de..2dc86ca2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -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)