diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-03 11:46:57 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-03 11:46:57 +0100 |
commit | b3a502a7057649b284601bdd5110b136ab1f5fbb (patch) | |
tree | 12e05b16ded8d0eb632a95b81608be51d025603c /src | |
parent | bf44d9965b5cc0f0ee31ba2579783d8194fff756 (diff) |
sna: Review sna_pixmap->cpu tracking
Notably 52b211cb15b3 was triggering a few assertions.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 62bf1d46..cbcdcf6e 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2687,6 +2687,7 @@ sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box, if (priv->cpu_damage == NULL) { list_del(&priv->list); priv->undamaged = false; + priv->cpu = false; } } @@ -2715,6 +2716,7 @@ create_gpu_bo: if (priv->gpu_damage) { if (!priv->cpu_damage) { + assert(priv->cpu == false); if (sna_damage_contains_box__no_reduce(priv->gpu_damage, ®ion.extents)) { DBG(("%s: region wholly contained within GPU damage\n", @@ -2997,6 +2999,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags) DBG(("%s: already all-damaged\n", __FUNCTION__)); sna_damage_destroy(&priv->cpu_damage); priv->undamaged = true; + assert(priv->cpu == false); goto active; } @@ -3126,6 +3129,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags) __sna_damage_destroy(DAMAGE_PTR(priv->cpu_damage)); priv->cpu_damage = NULL; priv->undamaged = true; + priv->cpu = false; if (priv->shm) { assert(!priv->flush); @@ -3155,10 +3159,9 @@ done: } active: - if (flags & MOVE_WRITE) { + if (flags & MOVE_WRITE) priv->clear = false; - priv->cpu = false; - } + assert(priv->cpu == false); assert(!priv->gpu_bo->proxy || (flags & MOVE_WRITE) == 0); return sna_pixmap_mark_active(sna, priv); } @@ -14088,7 +14091,8 @@ static void sna_accel_flush(struct sna *sna) sna->kgem.busy = busy; if (priv) { - sna_pixmap_force_to_gpu(priv->pixmap, MOVE_READ); + sna_pixmap_force_to_gpu(priv->pixmap, + MOVE_READ | MOVE_ASYNC_HINT); kgem_bo_flush(&sna->kgem, priv->gpu_bo); assert(!priv->cpu); } |