summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-26 16:47:04 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-27 09:04:10 +0000
commitccee730e45d8c2490e578d0b85d9e76f3a44f76f (patch)
treebfc37c4a9f448290d62e1d46633d1e117d993be9
parentdf68b20a17e28c0898226f970315bc8e515e9f56 (diff)
sna: Discard the gpu-bo is the entire pixmap is written to by the CPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 03020c93..1cb79b8b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -741,6 +741,12 @@ done:
DBG(("%s: applying cpu damage\n", __FUNCTION__));
assert_pixmap_contains_box(pixmap, RegionExtents(region));
sna_damage_add(&priv->cpu_damage, region);
+ if (sna_damage_is_all(&priv->cpu_damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height)) {
+ DBG(("%s: replaced entire pixmap\n", __FUNCTION__));
+ sna_pixmap_destroy_gpu_bo(sna, priv);
+ }
if (priv->flush)
list_move(&priv->list, &sna->dirty_pixmaps);
}