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

Chris Wilson ickle at kemper.freedesktop.org
Mon Dec 1 05:28:08 PST 2014


 src/sna/sna_render.c |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 263d10998617ba935179942d2440a1607cd3c21c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 1 13:26:46 2014 +0000

    sna: Clamp downsampling tile size
    
    For very large scale factors, it is possible for the current calculation
    to underflow and try negative tile sizes.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 22bc491..3fbb9ec 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -829,9 +829,15 @@ fixup:
 	size = sna->render.max_3d_size - 4096 / pixmap->drawable.bitsPerPixel;
 	while (size * size * 4 > max_size)
 		size /= 2;
+	DBG(("%s: size=%d (max=%d), scale %dx%d\n",
+	     __FUNCTION__, size, max_size, sx, sy));
 
 	sw = size / sx - 2 * sx;
+	if (sw < 1)
+		sw = 1;
 	sh = size / sy - 2 * sy;
+	if (sh < 1)
+		sh = 1;
 	DBG(("%s %d:%d downsampling using %dx%d GPU tiles\n",
 	     __FUNCTION__, (width + sw-1)/sw, (height + sh-1)/sh, sw, sh));
 


More information about the xorg-commit mailing list