Mesa (master): r300g: add debugging options "notiling" and "noimmd" ( for testing)

Marek Olšák mareko at kemper.freedesktop.org
Sun Apr 18 00:59:10 UTC 2010


Module: Mesa
Branch: master
Commit: 5b609badf7682da2377c5e67ab827b2dc3a06b9b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b609badf7682da2377c5e67ab827b2dc3a06b9b

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sun Apr 18 02:32:54 2010 +0200

r300g: add debugging options "notiling" and "noimmd" (for testing)

notiling = Disable texture tiling
noimmd = Disable immediate mode (this optimization was really worth it!)

---

 src/gallium/drivers/r300/r300_debug.c   |   16 +++++++++-------
 src/gallium/drivers/r300/r300_render.c  |    2 +-
 src/gallium/drivers/r300/r300_screen.h  |    2 ++
 src/gallium/drivers/r300/r300_texture.c |    7 ++++++-
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index 016e8d6..6e84bf8 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -32,13 +32,15 @@ struct debug_option {
 
 static struct debug_option debug_options[] = {
     { "help", DBG_HELP, "Helpful meta-information about the driver" },
-    { "fp", DBG_FP, "Fragment program handling" },
-    { "vp", DBG_VP, "Vertex program handling" },
-    { "cs", DBG_CS, "Command submissions" },
-    { "draw", DBG_DRAW, "Draw and emit" },
-    { "tex", DBG_TEX, "Textures" },
-    { "fall", DBG_FALL, "Fallbacks" },
-    { "anisohq", DBG_ANISOHQ, "High quality anisotropic filtering (for benchmarking purposes only!)" },
+    { "fp", DBG_FP, "Fragment program handling (for debugging)" },
+    { "vp", DBG_VP, "Vertex program handling (for debugging)" },
+    { "cs", DBG_CS, "Command submissions (for debugging)" },
+    { "draw", DBG_DRAW, "Draw and emit (for debugging)" },
+    { "tex", DBG_TEX, "Textures (for debugging)" },
+    { "fall", DBG_FALL, "Fallbacks (for debugging)" },
+    { "anisohq", DBG_ANISOHQ, "High quality anisotropic filtering (for benchmarking)" },
+    { "notiling", DBG_NO_TILING, "Disable tiling (for benchmarking)" },
+    { "noimmd", DBG_NO_IMMD, "Disable immediate mode (for benchmarking)" },
 
     { "all", ~0, "Convenience option that enables all debug flags" },
 
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 751a7e6..fa7b70b 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -138,7 +138,7 @@ static boolean immd_is_good_idea(struct r300_context *r300,
     unsigned vertex_element_count = r300->velems->count;
     unsigned i, vbi;
 
-    if (count > 10) {
+    if (count > 10 || DBG_ON(r300, DBG_NO_IMMD)) {
         return FALSE;
     }
 
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
index 2f951c7..4077424 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -69,6 +69,8 @@ static INLINE struct r300_screen* r300_screen(struct pipe_screen* screen) {
 #define DBG_TEX     0x0000020
 #define DBG_FALL    0x0000040
 #define DBG_ANISOHQ 0x0000080
+#define DBG_NO_TILING 0x0000100
+#define DBG_NO_IMMD 0x0000200
 /*@}*/
 
 static INLINE boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned flags)
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index a37b33e..0c3502f 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -836,13 +836,14 @@ static void r300_setup_tiling(struct pipe_screen *screen,
     enum pipe_format format = tex->b.b.format;
     boolean rv350_mode = r300_screen(screen)->caps.family >= CHIP_FAMILY_RV350;
     boolean is_zb = util_format_is_depth_or_stencil(format);
+    boolean dbg_no_tiling = SCREEN_DBG_ON(r300_screen(screen), DBG_NO_TILING);
 
     if (!r300_format_is_plain(format)) {
         return;
     }
 
     /* If height == 1, disable microtiling except for zbuffer. */
-    if (!is_zb && tex->b.b.height0 == 1) {
+    if (!is_zb && (tex->b.b.height0 == 1 || dbg_no_tiling)) {
         return;
     }
 
@@ -861,6 +862,10 @@ static void r300_setup_tiling(struct pipe_screen *screen,
             break;
     }
 
+    if (dbg_no_tiling) {
+        return;
+    }
+
     /* Set macrotiling. */
     if (r300_texture_macro_switch(tex, 0, rv350_mode, TILE_WIDTH) &&
         r300_texture_macro_switch(tex, 0, rv350_mode, TILE_HEIGHT)) {




More information about the mesa-commit mailing list