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

Chris Wilson ickle at kemper.freedesktop.org
Wed Jan 16 03:16:08 PST 2013


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

New commits:
commit 47caffc50b5cdd288ad868fa9a697f0d4e2d28dc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 16 10:49:24 2013 +0000

    sna: Restrict upload buffers to reduce sampler TLB misses
    
    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 368d880..f672c3e 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -691,14 +691,18 @@ fallback:
 		     sna->render.max_3d_size, sna->render.max_3d_size));
 		if (must_tile(sna, tmp.drawable.width, tmp.drawable.height)) {
 			BoxRec tile, stack[64], *clipped, *c;
-			int step;
+			int cpp, step;
 
 tile:
-			step = MIN(sna->render.max_3d_size - 4096 / dst->drawable.bitsPerPixel,
-				   8*(MAXSHORT&~63) / dst->drawable.bitsPerPixel);
-			while (step * step * 4 > sna->kgem.max_upload_tile_size)
+			cpp = dst->drawable.bitsPerPixel / 8;
+			step = MIN(sna->render.max_3d_size,
+				   (MAXSHORT&~63) / cpp);
+			while (step * step * cpp > sna->kgem.max_upload_tile_size)
 				step /= 2;
 
+			if (step * cpp > 4096)
+				step = 4096 / cpp;
+
 			DBG(("%s: tiling upload, using %dx%d tiles\n",
 			     __FUNCTION__, step, step));
 


More information about the xorg-commit mailing list