summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-26 17:12:03 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-27 09:04:10 +0000
commitf11e9f189111f53ace20381a0bd4f559ccd3605f (patch)
treecb756f6f064b31448af4842574a8138425b0d0c6
parentccee730e45d8c2490e578d0b85d9e76f3a44f76f (diff)
sna: Only check for all-damaged CPU bo if we may discard the GPU bo
The goal of the optimisation is to discard the GPU bo early, so we can skip the extra damage reduction if there is no gpu bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 1cb79b8b..4b013c91 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -741,7 +741,8 @@ 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,
+ if (priv->gpu_bo &&
+ sna_damage_is_all(&priv->cpu_damage,
pixmap->drawable.width,
pixmap->drawable.height)) {
DBG(("%s: replaced entire pixmap\n", __FUNCTION__));
@@ -1437,7 +1438,8 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
assert_pixmap_contains_box(pixmap, RegionExtents(region));
sna_damage_subtract(&priv->gpu_damage, region);
sna_damage_add(&priv->cpu_damage, region);
- if (sna_damage_is_all(&priv->cpu_damage,
+ if (priv->gpu_bo &&
+ sna_damage_is_all(&priv->cpu_damage,
pixmap->drawable.width,
pixmap->drawable.height)) {
DBG(("%s: replaced entire pixmap\n", __FUNCTION__));