aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2013-03-25 14:57:24 -0400
committerRob Clark <[email protected]>2013-03-25 15:05:44 -0400
commit634fb837ef7533171cb78f33bebdbacaa4b8511d (patch)
treea05b82dca9a4dca0ddaba1d30ea2dd0ebf034a18 /src/gallium
parente207c330203473830fcc1a36c5b7bbb7a574682d (diff)
freedreno: use u_debug for debug env vars
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index cb9dfff4140..79eef5e1340 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -36,6 +36,7 @@
#include "util/u_format.h"
#include "util/u_format_s3tc.h"
#include "util/u_string.h"
+#include "util/u_debug.h"
#include "os/os_time.h"
@@ -52,6 +53,14 @@
/* XXX this should go away */
#include "state_tracker/drm_driver.h"
+static const struct debug_named_value debug_options[] = {
+ {"msgs", FD_DBG_MSGS, "Print debug messages"},
+ {"disasm", FD_DBG_DISASM, "Dump TGSI and adreno shader disassembly"},
+ DEBUG_NAMED_VALUE_END
+};
+
+DEBUG_GET_ONCE_FLAGS_OPTION(fd_mesa_debug, "FD_MESA_DEBUG", debug_options, 0)
+
int fd_mesa_debug = 0;
static const char *
@@ -429,9 +438,7 @@ fd_screen_create(struct fd_device *dev)
struct pipe_screen *pscreen;
uint64_t val;
- char *fd_dbg = getenv("FD_MESA_DEBUG");
- if (fd_dbg)
- fd_mesa_debug = atoi(fd_dbg);
+ fd_mesa_debug = debug_get_option_fd_mesa_debug();
if (!screen)
return NULL;