diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-10 16:40:35 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-10 18:51:39 +0000 |
commit | 210d474a96d3adf7338b49ee2c234893b54bbb2c (patch) | |
tree | 1eb965204da576a494e28106ee47901bf97d9fd1 | |
parent | 35f50a98fde7a4ebe6871bd23475948a2a530633 (diff) |
sna: Tweak CPU mappings to be only used if a read is required
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index ae6d3c16..e9f29d09 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1634,6 +1634,7 @@ skip_inplace_map: list_del(&priv->list); priv->clear = false; } + priv->cpu = false; assert_pixmap_damage(pixmap); DBG(("%s: operate inplace (GTT)\n", __FUNCTION__)); @@ -1649,6 +1650,7 @@ skip_inplace_map: } if (priv->gpu_damage && priv->cpu_damage == NULL && + (flags & MOVE_READ || priv->gpu_bo->domain == DOMAIN_CPU || sna->kgem.has_llc) && priv->gpu_bo->tiling == I915_TILING_NONE && ((flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == 0 || !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) { @@ -1672,6 +1674,7 @@ skip_inplace_map: priv->clear = false; } + assert(IS_CPU_MAP(priv->gpu_bo->map)); kgem_bo_sync__cpu_full(&sna->kgem, priv->gpu_bo, FORCE_FULL_SYNC || flags & MOVE_WRITE); assert_pixmap_damage(pixmap); @@ -1781,6 +1784,7 @@ done: if (priv->cpu_bo) { if ((flags & MOVE_ASYNC_HINT) == 0) { DBG(("%s: syncing CPU bo\n", __FUNCTION__)); + assert(IS_CPU_MAP(priv->cpu_bo->map)); kgem_bo_sync__cpu_full(&sna->kgem, priv->cpu_bo, FORCE_FULL_SYNC || flags & MOVE_WRITE); assert(!priv->shm || !kgem_bo_is_busy(priv->cpu_bo)); @@ -2312,6 +2316,7 @@ out: } if ((flags & MOVE_ASYNC_HINT) == 0 && priv->cpu_bo) { DBG(("%s: syncing cpu bo\n", __FUNCTION__)); + assert(IS_CPU_MAP(priv->cpu_bo->map)); kgem_bo_sync__cpu_full(&sna->kgem, priv->cpu_bo, FORCE_FULL_SYNC || flags & MOVE_WRITE); } |