xf86-video-intel: 2 commits - src/sna/sna_accel.c src/sna/sna_io.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Dec 28 02:58:01 PST 2011


 src/sna/sna_accel.c |    7 +------
 src/sna/sna_io.c    |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 337635ab97bbfc9b4455eadb63214783bb90bb2b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Dec 28 10:56:57 2011 +0000

    sna: Add some more debugging to find the source of a read-boxes error
    
    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 489c1cc..0386cef 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -100,6 +100,20 @@ void sna_read_boxes(struct sna *sna,
 	     __FUNCTION__, nbox, src_bo->handle, src_dx, src_dy,
 	     dst->drawable.width, dst->drawable.height, dst_dx, dst_dy));
 
+#ifndef NDEBUG
+	for (n = 0; n < nbox; n++) {
+		if (box[n].x1 + src_dx < 0 || box[n].y1 + src_dy < 0 ||
+		    (box[n].x2 + src_dx) * dst->drawable.bitsPerPixel/8 > src_bo->pitch ||
+		    (box[n].y2 + src_dy) * src_bo->pitch > src_bo->size)
+		{
+			FatalError("source out-of-bounds box[%d]=(%d, %d), (%d, %d) + (%d, %d), pitch=%d, size=%d\n",
+				   box[n].x1, box[n].y1,
+				   box[n].x2, box[n].y2,
+				   src_bo->pitch, src_bo->size);
+		}
+	}
+#endif
+
 	if (DEBUG_NO_IO || kgem->wedged || src_bo->tiling == I915_TILING_Y) {
 		read_boxes_inplace(kgem,
 				   src_bo, src_dx, src_dy,
commit 3bf81241cbc97763e5f3cbc82772437ccbff5a6c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Dec 27 17:09:59 2011 +0000

    sna: Skip zero-sized glyphs
    
    Similar to the empty glyphs make sure that we just advance by the
    character width without drawing anything.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 746464b..8d319db 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -7917,13 +7917,8 @@ static bool sna_set_glyph(CharInfoPtr in, CharInfoPtr out)
 	int stride = GLYPHWIDTHBYTESPADDED(in);
 	uint8_t *dst, *src;
 
-	if (w == 0 || h == 0) {
-		out->bits = (void *)-1;
-		return false;
-	}
-
 	/* Skip empty glyphs */
-	if ((w|h) == 1 && (in->bits[0] & 1) == 0) {
+	if (w == 0 || h == 0 || ((w|h) == 1 && (in->bits[0] & 1) == 0)) {
 		out->bits = (void *)1;
 		return true;
 	}


More information about the xorg-commit mailing list