ddebug: write out final driver log messages with GALLIUM_DDEBUG=always

If the last operation happens to be a non-draw, such as a
transfer_map that triggers a decompress blit, there may be
interesting messages left in the driver log.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2017-09-06 10:11:40 +02:00
parent 000e2958f5
commit 81f398dcb1
3 changed files with 15 additions and 2 deletions

View File

@@ -584,8 +584,19 @@ dd_context_destroy(struct pipe_context *_pipe)
pipe_resource_reference(&dctx->fence, NULL); pipe_resource_reference(&dctx->fence, NULL);
} }
if (pipe->set_log_context) if (pipe->set_log_context) {
pipe->set_log_context(pipe, NULL); pipe->set_log_context(pipe, NULL);
if (dd_screen(dctx->base.screen)->mode == DD_DUMP_ALL_CALLS) {
FILE *f = dd_get_file_stream(dd_screen(dctx->base.screen), 0);
if (f) {
fprintf(f, "Remainder of driver log:\n\n");
}
u_log_new_page_print(&dctx->log, f);
fclose(f);
}
}
u_log_context_destroy(&dctx->log); u_log_context_destroy(&dctx->log);
pipe->destroy(pipe); pipe->destroy(pipe);

View File

@@ -39,7 +39,7 @@
#include <inttypes.h> #include <inttypes.h>
static FILE * FILE *
dd_get_file_stream(struct dd_screen *dscreen, unsigned apitrace_call_number) dd_get_file_stream(struct dd_screen *dscreen, unsigned apitrace_call_number)
{ {
struct pipe_screen *screen = dscreen->screen; struct pipe_screen *screen = dscreen->screen;

View File

@@ -274,6 +274,8 @@ dd_init_draw_functions(struct dd_context *dctx);
int int
dd_thread_pipelined_hang_detect(void *input); dd_thread_pipelined_hang_detect(void *input);
FILE *
dd_get_file_stream(struct dd_screen *dscreen, unsigned apitrace_call_number);
static inline struct dd_context * static inline struct dd_context *
dd_context(struct pipe_context *pipe) dd_context(struct pipe_context *pipe)