Commit 1f9a6156 authored by Chris Wilson's avatar Chris Wilson

sna: remove short-circuit for move-to-CPU when damage covers region

The short-circuit path missed translating the damage from drawable space
into the pixmap (for Composite setups) which may have resulted in
corruption. The path was also failing to consider the impact of reusing
an active CPU bo when it could be discarding the unwanted damage and
reallocating.
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 539b7494
......@@ -2424,17 +2424,11 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (flags & MOVE_WRITE)
sna_pixmap_free_gpu(sna, priv);
goto contains_damage;
}
if (priv->cpu &&
priv->cpu_damage &&
sna_damage_contains_box__no_reduce(priv->cpu_damage,
&region->extents)) {
DBG(("%s: pixmap=%ld CPU damage contains region\n",
__FUNCTION__, pixmap->drawable.serialNumber));
if ((flags & MOVE_READ) == 0 &&
priv->cpu_bo && !priv->cpu_bo->flush &&
__kgem_bo_is_busy(&sna->kgem, priv->cpu_bo))
sna_pixmap_free_cpu(sna, priv, false);
contains_damage:
sna_pixmap_unmap(pixmap, priv);
assert(priv->mapped == MAPPED_NONE);
if (pixmap->devPrivate.ptr == NULL &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment