summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-27 11:49:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-27 12:34:34 +0100
commit18ee5c20d5f8f1752b89f2377e9b9c3f1c140d53 (patch)
treed259cf2553745886d847e9dfef844a3964d744db /src
parent36993618b4c5d4fa1fde7800eaaa711b074bd623 (diff)
sna: We can read from cloned pixmaps inplace - so long as we don't write
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_accel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index efe00ee1..2bbca72f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1770,7 +1770,7 @@ static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags)
assert((flags & MOVE_ASYNC_HINT) == 0);
- if (priv->cow) {
+ if (priv->cow && flags & MOVE_WRITE) {
DBG(("%s: no, has COW\n", __FUNCTION__));
return false;
}
@@ -1837,7 +1837,7 @@ _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned int flags)
pixmap_inplace(sna, pixmap, priv, true) &&
sna_pixmap_create_mappable_gpu(pixmap, true)) {
DBG(("%s: write inplace\n", __FUNCTION__));
- assert(priv->cow == NULL);
+ assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
assert(!priv->shm);
assert(priv->gpu_bo->exec == NULL);
assert((flags & MOVE_READ) == 0 || priv->cpu_damage == NULL);
@@ -1899,7 +1899,7 @@ skip_inplace_map:
pixmap_inplace(sna, pixmap, priv, (flags & MOVE_READ) == 0) &&
sna_pixmap_create_mappable_gpu(pixmap, (flags & MOVE_READ) == 0)) {
DBG(("%s: try to operate inplace (GTT)\n", __FUNCTION__));
- assert(priv->cow == NULL);
+ assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
assert((flags & MOVE_READ) == 0 || priv->cpu_damage == NULL);
/* XXX only sync for writes? */
kgem_bo_submit(&sna->kgem, priv->gpu_bo);
@@ -1941,7 +1941,7 @@ skip_inplace_map:
((flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == 0 ||
!__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) {
DBG(("%s: try to operate inplace (CPU)\n", __FUNCTION__));
- assert(priv->cow == NULL);
+ assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
assert(!priv->mapped);
pixmap->devPrivate.ptr =
@@ -2292,7 +2292,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
region_inplace(sna, pixmap, region, priv, (flags & MOVE_READ) == 0) &&
sna_pixmap_create_mappable_gpu(pixmap, false)) {
DBG(("%s: try to operate inplace\n", __FUNCTION__));
- assert(priv->cow == NULL);
+ assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
/* XXX only sync for writes? */
kgem_bo_submit(&sna->kgem, priv->gpu_bo);
assert(priv->gpu_bo->exec == NULL);