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>
This commit is contained in:
parent
6f5fd772c7
commit
b4dbdd28ae
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue