diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-16 10:49:24 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-16 11:10:03 +0000 |
commit | 47caffc50b5cdd288ad868fa9a697f0d4e2d28dc (patch) | |
tree | d30d9a200fc41aa1936cbc91079c9a3e57116190 | |
parent | ab36300a22222086b94857f356612106ffbeb480 (diff) |
sna: Restrict upload buffers to reduce sampler TLB misses
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_io.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 368d8801..f672c3e5 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)); |