From dbe3a5ca1e6558bcee29d893aba8cc352220a36d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 3 Jul 2012 11:48:15 +0100 Subject: [PATCH] sna: Attempt to reduce all-damage on the CPU As we now treat CPU all-damaged as a special case for deciding when and where to migrate, look out for that condition after adding damage. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 28b964d7..b4748646 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1869,10 +1869,10 @@ done: assert(!DAMAGE_IS_ALL(priv->cpu_damage)); assert_pixmap_contains_box(pixmap, RegionExtents(region)); sna_damage_add(&priv->cpu_damage, region); - if (priv->gpu_bo && - sna_damage_is_all(&priv->cpu_damage, + sna_damage_reduce_all(&priv->cpu_damage, pixmap->drawable.width, - pixmap->drawable.height)) { + pixmap->drawable.height); + if (priv->gpu_bo && DAMAGE_IS_ALL(priv->cpu_damage)) { DBG(("%s: replaced entire pixmap\n", __FUNCTION__)); sna_pixmap_free_gpu(sna, priv); priv->undamaged = false;