summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-19 20:39:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-19 20:40:30 +0100
commitdf89b4941130b5ff020c6ef3e244dcf5fec45f2a (patch)
treeb3a95aa2ef668d354587a1cc26b8170da5f9209f /src/sna/sna_accel.c
parent6b32cf3a3c908bd29496fcf5d190fd0f8c657ae6 (diff)
sna: Mark upload from SHM segment as read-only
As this may be mapped by the Xserver using a read-only SHM segment, we are forced to treat it always as read-only. And this being X, that it is using a SHM segment is opaque to the driver. Fantastic middlelayer. This was incorrectly removed in commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jun 11 10:48:26 2014 +0100 sna: Ignore setting read-only for temporary userptr maps Reported-by: Christoph Haag <haagch.christoph@googlemail.com> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r--src/sna/sna_accel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b0e7967a..e53f1b8b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4736,17 +4736,19 @@ try_upload__blt(PixmapPtr pixmap, RegionRec *region,
return false;
}
- if (!sna_pixmap_move_area_to_gpu(pixmap, &region->extents,
- MOVE_WRITE | MOVE_ASYNC_HINT | (region->data ? MOVE_READ : 0)))
- return false;
-
- src_bo = kgem_create_map(&sna->kgem, bits, stride * h, false);
+ src_bo = kgem_create_map(&sna->kgem, bits, stride * h, true);
if (src_bo == NULL)
return false;
src_bo->pitch = stride;
kgem_bo_mark_unreusable(src_bo);
+ if (!sna_pixmap_move_area_to_gpu(pixmap, &region->extents,
+ MOVE_WRITE | MOVE_ASYNC_HINT | (region->data ? MOVE_READ : 0))) {
+ kgem_bo_destroy(&sna->kgem, src_bo);
+ return false;
+ }
+
DBG(("%s: upload(%d, %d, %d, %d) x %d through a temporary map\n",
__FUNCTION__, x, y, w, h, region_num_rects(region)));