From 9ff1bb090b40949cddfbb904e613395ad2633fc7 Mon Sep 17 00:00:00 2001 From: Corbin McElhanney Date: Fri, 23 Jun 2017 17:45:50 -0400 Subject: drm/amd/display: Add extra mode and clock info to DTN logs Adds some additional information to logs in dc_commit_streams to better match Dal2. Also adds a new function, dc_raw_log, that has the same functionality as dc_conn_log, but does not attach display specific prefixes to the log output. Finally, adds a new DC log type, LOG_DTN, that logs to LogMinor_DispConnect_dtn in DM. This new log type and dc_raw_log are used to generate clock info in the logs to match Dal2. Signed-off-by: Corbin McElhanney Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- .../gpu/drm/amd/display/dc/basics/log_helpers.c | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/amd/display/dc/basics/log_helpers.c') diff --git a/drivers/gpu/drm/amd/display/dc/basics/log_helpers.c b/drivers/gpu/drm/amd/display/dc/basics/log_helpers.c index 1268be9ebaf3..070ae6f680e1 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/log_helpers.c +++ b/drivers/gpu/drm/amd/display/dc/basics/log_helpers.c @@ -95,7 +95,35 @@ void dc_conn_log(struct dc_context *ctx, dm_logger_append(&entry, "%2.2X ", hex_data[i]); dm_logger_append(&entry, "^\n"); - dm_helpers_dc_conn_log(ctx, entry.buf); + dm_helpers_dc_conn_log(ctx, &entry, event); + dm_logger_close(&entry); + + va_end(args); +} + +void dc_raw_log(struct dc_context *ctx, + enum dc_log_type event, + const char *msg, + ...) +{ + va_list args; + struct log_entry entry = { 0 }; + + dm_logger_open(ctx->logger, &entry, event); + + va_start(args, msg); + entry.buf_offset += dm_log_to_buffer( + &entry.buf[entry.buf_offset], + LOG_MAX_LINE_SIZE - entry.buf_offset, + msg, args); + + if (entry.buf[strlen(entry.buf) - 1] == '\n') { + entry.buf[strlen(entry.buf) - 1] = '\0'; + entry.buf_offset--; + } + + dm_logger_append(&entry, "^\n"); + dm_helpers_dc_conn_log(ctx, &entry, event); dm_logger_close(&entry); va_end(args); -- cgit