summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-02-21 13:17:35 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-02-21 13:17:35 +0000
commit1541f1afca028453379083e564bc82debf0ba39a (patch)
tree9172c1bcfc7382299efcfac357e8d75c2cf86266 /src
parent74fd55a96bd6c63e9c49a4b7fee7ef91f6b00a2c (diff)
sna: Skip the CPU synchronization when marking a pixmap as inactive
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_accel.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 575c213c..00fc80a2 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -442,6 +442,7 @@ struct kgem_bo *sna_pixmap_change_tiling(PixmapPtr pixmap, uint32_t tiling);
#define MOVE_WRITE 0x1
#define MOVE_READ 0x2
#define MOVE_INPLACE_HINT 0x4
+#define MOVE_ASYNC_HINT 0x8
bool must_check _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned flags);
static inline bool must_check sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned flags)
{
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 72c3907d..3b417cc5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1058,7 +1058,7 @@ skip_inplace_map:
}
done:
- if (priv->cpu_bo) {
+ 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);
}
@@ -11763,7 +11763,7 @@ static void sna_accel_inactive(struct sna *sna)
DBG(("%s: discarding inactive GPU bo handle=%d\n",
__FUNCTION__, priv->gpu_bo->handle));
if (!sna_pixmap_move_to_cpu(priv->pixmap,
- MOVE_READ | MOVE_WRITE))
+ MOVE_READ | MOVE_WRITE | MOVE_ASYNC_HINT))
list_add(&priv->inactive, &preserve);
}
}