xf86-video-intel: src/sna/sna_io.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 26 07:53:27 PDT 2013


 src/sna/sna_io.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit b4dbdd28ae05839645912f8aeb5100f6d05f11a1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 26 15:49:00 2013 +0100

    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 at chris-wilson.co.uk>

diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index be81968..2bd6b82 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


More information about the xorg-commit mailing list