diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-26 16:47:04 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-27 09:04:10 +0000 |
commit | ccee730e45d8c2490e578d0b85d9e76f3a44f76f (patch) | |
tree | bfc37c4a9f448290d62e1d46633d1e117d993be9 | |
parent | df68b20a17e28c0898226f970315bc8e515e9f56 (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.c | 6 |
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); } |