Mesa (9.1): llvmpipe: tweak CMD_BLOCK_MAX and LP_SCENE_MAX_SIZE

Ian Romanick idr at kemper.freedesktop.org
Mon Mar 25 21:23:58 UTC 2013


Module: Mesa
Branch: 9.1
Commit: 7ddda678353e6a1327ac7a292afc112cadd7c556
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ddda678353e6a1327ac7a292afc112cadd7c556

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Mar  4 14:33:04 2013 -0700

llvmpipe: tweak CMD_BLOCK_MAX and LP_SCENE_MAX_SIZE

We advertise a max texture/surfaces size of 8K x 8K but the old values
for these limits didn't actually allow us to handle that surface size.

For 8K x 8K we'll have 16384 bins.  Each bin needs at least one cmd_block
object which was 2192 bytes in size.  Since 16384 * 2192 exceeded
LP_SCENE_MAX_SIZE we'd silently fail in lp_scene_new_data_block() and not
draw the complete scene.

By reducing CMD_BLOCK_MAX to 29 we get nice 512-byte cmd_blocks.  And
by increasing LP_SCENE_MAX_SIZE to 9 MB we can allocate enough command
blocks for 8K x 8K, plus a few regular data blocks.

Fixes the (improved) piglit fbo-maxsize test.

Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca at vmware.com>
(cherry picked from commit a31ebdffa048e3f7ff10a6742c3d1f10c2d8e494)

---

 src/gallium/drivers/llvmpipe/lp_scene.h |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h
index b1db61b..801829d 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.h
+++ b/src/gallium/drivers/llvmpipe/lp_scene.h
@@ -49,12 +49,18 @@ struct lp_rast_state;
 #define TILES_Y (LP_MAX_HEIGHT / TILE_SIZE)
 
 
-#define CMD_BLOCK_MAX 128
+/* Commands per command block (ideally so sizeof(cmd_block) is a power of
+ * two in size.)
+ */
+#define CMD_BLOCK_MAX 29
+
+/* Bytes per data block.
+ */
 #define DATA_BLOCK_SIZE (64 * 1024)
 
 /* Scene temporary storage is clamped to this size:
  */
-#define LP_SCENE_MAX_SIZE (4*1024*1024)
+#define LP_SCENE_MAX_SIZE (9*1024*1024)
 
 /* The maximum amount of texture storage referenced by a scene is
  * clamped ot this size:




More information about the mesa-commit mailing list