From 7ebcf94736926d4c7bb5ba1627be0a62b15c1663 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 15 Jun 2013 12:27:19 +0100 Subject: [PATCH] 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 References: https://bugs.freedesktop.org/show_bug.cgi?id=47597 Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 4ec21fdc..203d40f0 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -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);