diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-17 12:27:55 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-17 12:27:55 +0000 |
commit | dc643ef753bcfb69685f1eb10828d0c8f830c30e (patch) | |
tree | 9255bc40339b256d797af9459175089449243915 | |
parent | 18035a21e147788bea03ab2175ca03ae951701ce (diff) |
sna: Apply read-only synchronization hints for move-to-cpu
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 02941700..e4852487 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1607,7 +1607,8 @@ skip_inplace_map: if (priv->mapped) { assert(!priv->shm); - pixmap->devPrivate.ptr = NULL; + pixmap->devPrivate.ptr = PTR(priv->ptr); + pixmap->devKind = priv->stride; priv->mapped = false; } @@ -1637,7 +1638,8 @@ skip_inplace_map: priv->clear = false; } - kgem_bo_sync__cpu_full(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE); + kgem_bo_sync__cpu_full(&sna->kgem, + priv->gpu_bo, flags & MOVE_WRITE); assert_pixmap_damage(pixmap); DBG(("%s: operate inplace (CPU)\n", __FUNCTION__)); return true; @@ -1729,11 +1731,11 @@ skip_inplace_map: done: if (flags & MOVE_WRITE) { + assert(DAMAGE_IS_ALL(priv->cpu_damage)); priv->source_count = SOURCE_BIAS; assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL); if (priv->gpu_bo && priv->gpu_bo->domain != DOMAIN_GPU) { DBG(("%s: discarding inactive GPU bo\n", __FUNCTION__)); - assert(DAMAGE_IS_ALL(priv->cpu_damage)); sna_pixmap_free_gpu(sna, priv); } } @@ -1741,7 +1743,8 @@ done: if (priv->cpu_bo) { if ((flags & MOVE_ASYNC_HINT) == 0) { DBG(("%s: syncing CPU bo\n", __FUNCTION__)); - kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); + kgem_bo_sync__cpu_full(&sna->kgem, + priv->cpu_bo, flags & MOVE_WRITE); } if (flags & MOVE_WRITE) { DBG(("%s: discarding GPU bo in favour of CPU bo\n", __FUNCTION__)); @@ -2263,7 +2266,8 @@ out: } if ((flags & MOVE_ASYNC_HINT) == 0 && priv->cpu_bo) { DBG(("%s: syncing cpu bo\n", __FUNCTION__)); - kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); + kgem_bo_sync__cpu_full(&sna->kgem, + priv->cpu_bo, flags & MOVE_WRITE); assert(!kgem_bo_is_busy(priv->cpu_bo)); } priv->cpu = (flags & MOVE_ASYNC_HINT) == 0; |