diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-10 09:13:34 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-10 17:08:15 +0000 |
commit | 572cc76be5c78102166f2b3640640e21acdfa129 (patch) | |
tree | af8ece1b19dbc3a68ab51442be2ef172305ef98a | |
parent | 4a255e13164440b797e5ac11dcbf72f0827a3094 (diff) |
sna: Destroy the counter damage after a reduction-to-all
If, for instance, we reduce the GPU damage to all we know that there can
be no CPU damage even though it may still have a region with a list of
subtractions. Take advantage of this knowledge and cheaply discard that
damage without having to evaluate it.
This should prevent a paranoid assertion that there is no cpu damage
when discarding the CPU bo for an active pixmap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index bcffecb9..e7ac2151 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -298,9 +298,14 @@ static inline uint32_t default_tiling(PixmapPtr pixmap) return I915_TILING_X; } - return sna_damage_is_all(&priv->cpu_damage, + if (sna_damage_is_all(&priv->cpu_damage, pixmap->drawable.width, - pixmap->drawable.height) ? I915_TILING_Y : sna->default_tiling; + pixmap->drawable.height)) { + sna_damage_destroy(&priv->gpu_damage); + return I915_TILING_Y; + } + + return sna->default_tiling; } constant static uint32_t sna_pixmap_choose_tiling(PixmapPtr pixmap) @@ -1919,10 +1924,8 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region, if (!priv->pinned && priv->gpu_bo && region_subsumes_gpu_damage(region, priv) && - kgem_bo_map_will_stall(&sna->kgem, priv->gpu_bo)) { - sna_damage_destroy(&priv->gpu_damage); + kgem_bo_map_will_stall(&sna->kgem, priv->gpu_bo)) sna_pixmap_free_gpu(sna, priv); - } /* XXX performing the upload inplace is currently about 20x slower * for putimage10 on gen6 -- mostly due to slow page faulting in kernel. @@ -9663,6 +9666,7 @@ static void sna_accel_inactive(struct sna *sna) priv->pixmap->drawable.height)) { DBG(("%s: discarding inactive CPU shadow\n", __FUNCTION__)); + sna_damage_destroy(&priv->cpu_damage); sna_pixmap_free_cpu(sna, priv); list_add(&priv->inactive, &preserve); } else { |