summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-22 00:48:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-22 12:59:02 +0100
commit273765033223024ff6a662195e0e4b96f8960463 (patch)
treeab92a541226dc99b19ae63d82d398c3baf518d2a
parent31e398c9dbd8539e6fd2cc7398e97ee1df2f7f23 (diff)
sna: Make sure the opposite damage is destroyed after reducing to all
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ee23b434..ba8c93d5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2536,9 +2536,10 @@ done:
assert(priv->gpu_bo != NULL);
if (sna_damage_is_all(&priv->gpu_damage,
pixmap->drawable.width,
- pixmap->drawable.height))
+ pixmap->drawable.height)) {
+ sna_damage_destroy(&priv->cpu_damage);
*damage = NULL;
- else
+ } else
*damage = &priv->gpu_damage;
DBG(("%s: using GPU bo with damage? %d\n",
@@ -2579,6 +2580,8 @@ use_cpu_bo:
if (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo))
goto move_to_gpu;
+ assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL);
+
if (flags & RENDER_GPU) {
if (priv->gpu_bo && priv->gpu_bo->tiling)
goto move_to_gpu;
@@ -2598,9 +2601,10 @@ use_cpu_bo:
if (sna_damage_is_all(&priv->cpu_damage,
pixmap->drawable.width,
- pixmap->drawable.height))
+ pixmap->drawable.height)) {
+ sna_damage_destroy(&priv->gpu_damage);
*damage = NULL;
- else
+ } else
*damage = &priv->cpu_damage;
if (priv->shm) {
@@ -2726,6 +2730,8 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
pixmap->drawable.width,
pixmap->drawable.height)) {
DBG(("%s: already all-damaged\n", __FUNCTION__));
+ sna_damage_destroy(&priv->cpu_damage);
+ priv->undamaged = true;
goto active;
}