diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-04 12:06:22 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-04 15:19:37 +0000 |
commit | 4baa2806bc0f51e7576b769ca6750deb3821c4d3 (patch) | |
tree | cf3b1439711513a89733b1bc149e8279d064ce83 | |
parent | 2653524dffc1fe0dbff7d74bfc9be535d9ececb1 (diff) |
sna: Check if the damage reduces to all before performing the migration
An assert exposed a situation where we had accumulated an unreduced
damage-all and so we were taking the slow path only to discover later
that it was a damage-all and that we had performed needless checks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 1d2b999b..b6f67720 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -416,6 +416,8 @@ static inline uint32_t default_tiling(PixmapPtr pixmap) if (sna_damage_is_all(&priv->cpu_damage, pixmap->drawable.width, pixmap->drawable.height)) { + DBG(("%s: entire source is damaged, using Y-tiling\n", + __FUNCTION__)); sna_damage_destroy(&priv->gpu_damage); priv->undamaged = false; return I915_TILING_Y; @@ -1221,7 +1223,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable, return true; } - if (DAMAGE_IS_ALL(priv->cpu_damage)) + if (sna_damage_is_all(&priv->cpu_damage, + pixmap->drawable.width, + pixmap->drawable.height)) goto out; if (priv->clear) @@ -1245,6 +1249,8 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable, } if ((flags & MOVE_READ) == 0) { + DBG(("%s: no read, checking to see if we can stream the write into the GPU bo\n", + __FUNCTION__)); assert(flags & MOVE_WRITE); if (priv->stride && priv->gpu_bo && @@ -1611,7 +1617,9 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, BoxPtr box, unsigned int flags) assert_pixmap_contains_box(pixmap, box); - if (DAMAGE_IS_ALL(priv->gpu_damage)) + if (sna_damage_is_all(&priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height)) goto done; if (priv->gpu_bo == NULL) { @@ -2081,7 +2089,9 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags) return NULL; } - if (DAMAGE_IS_ALL(priv->gpu_damage)) { + if (sna_damage_is_all(&priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height)) { DBG(("%s: already all-damaged\n", __FUNCTION__)); goto active; } |