sna: Be explicit in not marking an upload buffer as being on the cpu

Since the upload buffer is special in that it simultaneously exists on
both the CPU and GPU, we need to be extremely careful in marking the cpu
hint flag and asserting it. In particular, the new stricter assert was
firing in the CompositeTrapezoids fallback path.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-06-15 12:27:19 +01:00
parent cafa33a522
commit 7ebcf94736
1 changed files with 6 additions and 4 deletions

View File

@ -2062,8 +2062,9 @@ done:
sna_pixmap_free_gpu(sna, priv);
}
}
priv->cpu = (flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0;
assert(priv->cpu == false || !DAMAGE_IS_ALL(priv->gpu_damage));
priv->cpu =
(flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0 &&
!DAMAGE_IS_ALL(priv->gpu_damage);
assert(pixmap->devPrivate.ptr);
assert(pixmap->devKind);
assert_pixmap_damage(pixmap);
@ -2610,8 +2611,9 @@ out:
assert(pixmap->devPrivate.ptr == (void *)((unsigned long)priv->cpu_bo->map & ~3));
assert((flags & MOVE_WRITE) == 0 || !kgem_bo_is_busy(priv->cpu_bo));
}
priv->cpu = (flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0;
assert(priv->cpu == false || !DAMAGE_IS_ALL(priv->gpu_damage));
priv->cpu =
(flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0 &&
!DAMAGE_IS_ALL(priv->gpu_damage);
assert(pixmap->devPrivate.ptr);
assert(pixmap->devKind);
assert_pixmap_damage(pixmap);