summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-19 11:54:14 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-19 12:00:13 +0000
commit9db6b9fad808175184849f3030862ea115ef0708 (patch)
tree6bbe28056a5157ffa4d79e262aedae9247f8a68f
parentd3f7d5d614748306cc376d1929da2bbc14494a6e (diff)
sna: Also check for the inplace hint when migrating the whole pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index dd13eba7..4645c685 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -866,6 +866,28 @@ skip_inplace_map:
goto done;
}
+ if (flags & MOVE_INPLACE_HINT &&
+ priv->stride && priv->gpu_bo &&
+ sna_pixmap_move_to_gpu(pixmap, flags)) {
+ assert(flags & MOVE_WRITE);
+ kgem_bo_submit(&sna->kgem, priv->gpu_bo);
+
+ DBG(("%s: operate inplace\n", __FUNCTION__));
+
+ pixmap->devPrivate.ptr =
+ kgem_bo_map(&sna->kgem, priv->gpu_bo);
+ if (pixmap->devPrivate.ptr != NULL) {
+ priv->mapped = true;
+ pixmap->devKind = priv->gpu_bo->pitch;
+ sna_damage_all(&priv->gpu_damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height);
+ return true;
+ }
+
+ priv->mapped = false;
+ }
+
if (priv->mapped) {
pixmap->devPrivate.ptr = NULL;
priv->mapped = false;
@@ -1149,6 +1171,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (flags & MOVE_INPLACE_HINT &&
priv->stride && priv->gpu_bo &&
sna_pixmap_move_area_to_gpu(pixmap, &region->extents)) {
+ assert(flags & MOVE_WRITE);
kgem_bo_submit(&sna->kgem, priv->gpu_bo);
DBG(("%s: operate inplace\n", __FUNCTION__));