pipe->transfer_unmap(pipe, dctx->fence_transfer);
pipe_resource_reference(&dctx->fence, NULL);
}
+
+ if (pipe->set_log_context)
+ pipe->set_log_context(pipe, NULL);
+ u_log_context_destroy(&dctx->log);
+
pipe->destroy(pipe);
FREE(dctx);
}
dd_init_draw_functions(dctx);
+ u_log_context_init(&dctx->log);
+ if (pipe->set_log_context)
+ pipe->set_log_context(pipe, &dctx->log);
+
dctx->draw_state.sample_mask = ~0;
if (dscreen->mode == DD_DETECT_HANGS_PIPELINED) {
dd_dump_call(f, &dctx->draw_state, call);
dd_dump_driver_state(dctx, f, flags);
+
+ fprintf(f,"\n\n**************************************************"
+ "***************************\n");
+ fprintf(f, "Context Log:\n\n");
+ u_log_new_page_print(&dctx->log, f);
+
if (dump_dmesg)
dd_dump_dmesg(f);
dd_close_file_stream(f);
{
struct dd_draw_record *next = (*record)->next;
+ u_log_page_destroy((*record)->log_page);
dd_unreference_copy_of_call(&(*record)->call);
dd_unreference_copy_of_draw_state(&(*record)->draw_state);
FREE((*record)->driver_state_log);
dd_dump_call(f, &record->draw_state.base, &record->call);
fprintf(f, "%s\n", record->driver_state_log);
+ fprintf(f,"\n\n**************************************************"
+ "***************************\n");
+ fprintf(f, "Context Log:\n\n");
+ u_log_page_print(record->log_page, f);
+
dctx->pipe->dump_debug_state(dctx->pipe, f,
PIPE_DUMP_DEVICE_STATUS_REGISTERS);
dd_dump_dmesg(f);
record->timestamp = os_time_get();
record->sequence_no = dctx->sequence_no;
record->driver_state_log = log;
+ record->log_page = u_log_new_page(&dctx->log);
memset(&record->call, 0, sizeof(record->call));
dd_copy_call(&record->call, call);
/* Terminate the process to prevent future hangs. */
dd_kill_process();
+ } else {
+ u_log_page_destroy(u_log_new_page(&dctx->log));
}
break;
case DD_DETECT_HANGS_PIPELINED:
false);
/* No need to continue. */
exit(0);
+ } else {
+ u_log_page_destroy(u_log_new_page(&dctx->log));
}
break;
default:
#include "pipe/p_screen.h"
#include "dd_util.h"
#include "os/os_thread.h"
+#include "util/u_log.h"
enum dd_mode {
DD_DETECT_HANGS,
struct dd_call call;
struct dd_draw_state_copy draw_state;
+ struct u_log_page *log_page;
char *driver_state_log;
};
struct dd_draw_state draw_state;
unsigned num_draw_calls;
+ struct u_log_context log;
+
/* Pipelined hang detection.
*
* This is without unnecessary flushes and waits. There is a memory-based