summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-26 15:49:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-26 15:53:01 +0100
commitb4dbdd28ae05839645912f8aeb5100f6d05f11a1 (patch)
treee5919dd0c573f7353f79d21be7be4b7604cbec9a /src
parent6f5fd772c7ca656b86394a0f036d4e0cf5b33d8e (diff)
sna: Try the indirect upload if we elect to use a mmap and it fails
This allows us to avoid the occassional kernel bug if mmap() fails and the upload is possible via our indirect upload paths. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_io.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index be819688..2bd6b82d 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -700,13 +700,12 @@ bool sna_write_boxes(struct sna *sna, PixmapPtr dst,
DBG(("%s x %d, src stride=%d, src dx=(%d, %d)\n", __FUNCTION__, nbox, stride, src_dx, src_dy));
- if (upload_inplace(kgem, dst_bo, box, nbox, dst->drawable.bitsPerPixel)) {
-fallback:
- return write_boxes_inplace(kgem,
- src, stride, dst->drawable.bitsPerPixel, src_dx, src_dy,
- dst_bo, dst_dx, dst_dy,
- box, nbox);
- }
+ if (upload_inplace(kgem, dst_bo, box, nbox, dst->drawable.bitsPerPixel)&&
+ write_boxes_inplace(kgem,
+ src, stride, dst->drawable.bitsPerPixel, src_dx, src_dy,
+ dst_bo, dst_dx, dst_dy,
+ box, nbox))
+ return true;
can_blt = kgem_bo_can_blt(kgem, dst_bo) &&
(box[0].x2 - box[0].x1) * dst->drawable.bitsPerPixel < 8 * (MAXSHORT - 4);
@@ -996,6 +995,12 @@ tile:
sna->blt_state.fill_bo = 0;
return true;
+
+fallback:
+ return write_boxes_inplace(kgem,
+ src, stride, dst->drawable.bitsPerPixel, src_dx, src_dy,
+ dst_bo, dst_dx, dst_dy,
+ box, nbox);
}
static void