From 991ffcb60a15f08ebb396d4d4ec86d5aff0ded31 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 11 Nov 2011 23:20:36 +0000 Subject: [PATCH] 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 --- src/sna/sna_accel.c | 3 +++ 1 file changed, 3 insertions(+) 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)