sna: Promote no COWs assertion to a condition check before operating inplace

We can arrive there with a COW and wanting to a CPU mapping, which is
unfortunate and requires the indirect path instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-08-26 22:07:49 +01:00
parent 3b267e52a0
commit 6997c4c2bd
1 changed files with 1 additions and 1 deletions

View File

@ -2363,6 +2363,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (USE_INPLACE &&
priv->gpu_damage &&
priv->gpu_bo->tiling == I915_TILING_NONE &&
(priv->cow == NULL || (flags & MOVE_WRITE) == 0) &&
(DAMAGE_IS_ALL(priv->gpu_damage) ||
sna_damage_contains_box__no_reduce(priv->gpu_damage,
&region->extents)) &&
@ -2371,7 +2372,6 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
!__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) {
DBG(("%s: try to operate inplace (CPU), read? %d, write? %d\n",
__FUNCTION__, !!(flags & MOVE_READ), !!(flags & MOVE_WRITE)));
assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
assert(sna_damage_contains_box(priv->gpu_damage, &region->extents) == PIXMAN_REGION_IN);
assert(sna_damage_contains_box(priv->cpu_damage, &region->extents) == PIXMAN_REGION_OUT);