diff options
Diffstat (limited to 'src/gallium/drivers/ddebug')
-rw-r--r-- | src/gallium/drivers/ddebug/dd_draw.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/ddebug/dd_pipe.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/ddebug/dd_screen.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/ddebug/dd_util.h | 5 |
4 files changed, 19 insertions, 7 deletions
diff --git a/src/gallium/drivers/ddebug/dd_draw.c b/src/gallium/drivers/ddebug/dd_draw.c index 0d7ee9a1686..45e4e10d500 100644 --- a/src/gallium/drivers/ddebug/dd_draw.c +++ b/src/gallium/drivers/ddebug/dd_draw.c @@ -88,8 +88,9 @@ struct dd_call static FILE * dd_get_file_stream(struct dd_context *dctx) { + struct dd_screen *dscreen = dd_screen(dctx->base.screen); struct pipe_screen *screen = dctx->pipe->screen; - FILE *f = dd_get_debug_file(); + FILE *f = dd_get_debug_file(dscreen->verbose); if (!f) return NULL; @@ -602,6 +603,7 @@ static void dd_after_draw(struct dd_context *dctx, struct dd_call *call) { struct dd_screen *dscreen = dd_screen(dctx->base.screen); + struct pipe_context *pipe = dctx->pipe; if (dctx->num_draw_calls >= dscreen->skip_count) { switch (dscreen->mode) { @@ -615,6 +617,8 @@ dd_after_draw(struct dd_context *dctx, struct dd_call *call) } break; case DD_DUMP_ALL_CALLS: + if (!dscreen->no_flush) + pipe->flush(pipe, NULL, 0); dd_dump_call(dctx, call, 0); break; default: diff --git a/src/gallium/drivers/ddebug/dd_pipe.h b/src/gallium/drivers/ddebug/dd_pipe.h index a045518dc16..80098dcb644 100644 --- a/src/gallium/drivers/ddebug/dd_pipe.h +++ b/src/gallium/drivers/ddebug/dd_pipe.h @@ -45,6 +45,7 @@ struct dd_screen unsigned timeout_ms; enum dd_mode mode; bool no_flush; + bool verbose; unsigned skip_count; }; diff --git a/src/gallium/drivers/ddebug/dd_screen.c b/src/gallium/drivers/ddebug/dd_screen.c index 2716845f58f..3706b2d63f5 100644 --- a/src/gallium/drivers/ddebug/dd_screen.c +++ b/src/gallium/drivers/ddebug/dd_screen.c @@ -270,7 +270,7 @@ ddebug_screen_create(struct pipe_screen *screen) { struct dd_screen *dscreen; const char *option = debug_get_option("GALLIUM_DDEBUG", NULL); - bool dump_always = option && !strcmp(option, "always"); + bool dump_always = option && !strncmp(option, "always", 6); bool no_flush = option && strstr(option, "noflush"); bool help = option && !strcmp(option, "help"); unsigned timeout = 0; @@ -280,15 +280,18 @@ ddebug_screen_create(struct pipe_screen *screen) puts(""); puts("Usage:"); puts(""); - puts(" GALLIUM_DDEBUG=always"); - puts(" Dump context and driver information after every draw call into"); + puts(" GALLIUM_DDEBUG=\"always [noflush] [verbose]\""); + puts(" Flush and dump context and driver information after every draw call into"); puts(" $HOME/"DD_DIR"/."); puts(""); - puts(" GALLIUM_DDEBUG=[timeout in ms] noflush"); + puts(" GALLIUM_DDEBUG=\"[timeout in ms] [noflush] [verbose]\""); puts(" Flush and detect a device hang after every draw call based on the given"); puts(" fence timeout and dump context and driver information into"); puts(" $HOME/"DD_DIR"/ when a hang is detected."); - puts(" If 'noflush' is specified, only detect hangs in pipe->flush."); + puts(""); + puts(" If 'noflush' is specified, do not flush on every draw call. In hang"); + puts(" detection mode, this only detect hangs in pipe->flush."); + puts(" If 'verbose' is specified, additional information is written to stderr."); puts(""); puts(" GALLIUM_DDEBUG_SKIP=[count]"); puts(" Skip flush and hang detection for the given initial number of draw calls."); @@ -339,6 +342,7 @@ ddebug_screen_create(struct pipe_screen *screen) dscreen->timeout_ms = timeout; dscreen->mode = dump_always ? DD_DUMP_ALL_CALLS : DD_DETECT_HANGS; dscreen->no_flush = no_flush; + dscreen->verbose = strstr(option, "verbose") != NULL; switch (dscreen->mode) { case DD_DUMP_ALL_CALLS: diff --git a/src/gallium/drivers/ddebug/dd_util.h b/src/gallium/drivers/ddebug/dd_util.h index c217c8eed68..093bdff4a92 100644 --- a/src/gallium/drivers/ddebug/dd_util.h +++ b/src/gallium/drivers/ddebug/dd_util.h @@ -40,7 +40,7 @@ #define DD_DIR "ddebug_dumps" static inline FILE * -dd_get_debug_file() +dd_get_debug_file(bool verbose) { static unsigned index; char proc_name[128], dir[256], name[512]; @@ -65,6 +65,9 @@ dd_get_debug_file() return NULL; } + if (verbose) + fprintf(stderr, "dd: dumping to file %s\n", name); + return f; } |