diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index 64db62e609eb186a6f470948e134d05c09e66951..df4d221e46c147ff25c070d168adbad468cd44a0 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -322,7 +322,7 @@ bool dm_helpers_dp_mst_send_payload_allocation( return true; } -bool dm_helpers_dc_conn_log(struct dc_context*ctx, const char *msg) +bool dm_helpers_dc_conn_log(struct dc_context *ctx, struct log_entry *entry, enum dc_log_type event) { return true; } 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 1268be9ebaf3c58eaf464bf7b5f4ce580d9b652f..070ae6f680e1f4f9f10b04c2f81e2b814aa3e40f 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); diff --git a/drivers/gpu/drm/amd/display/dc/basics/logger.c b/drivers/gpu/drm/amd/display/dc/basics/logger.c index 4be83703b8099ed69836d301e4f8241901aefe26..0b17374b1535963a5a0176acf043f453ed024846 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/logger.c +++ b/drivers/gpu/drm/amd/display/dc/basics/logger.c @@ -59,7 +59,8 @@ static const struct dc_log_type_info log_type_info_tbl[] = { {LOG_EVENT_LINK_TRAINING, "LKTN"}, {LOG_EVENT_LINK_LOSS, "LinkLoss"}, {LOG_EVENT_UNDERFLOW, "Underflow"}, - {LOG_IF_TRACE, "InterfaceTrace"} + {LOG_IF_TRACE, "InterfaceTrace"}, + {LOG_DTN, "DTN"} }; @@ -84,7 +85,8 @@ static const struct dc_log_type_info log_type_info_tbl[] = { (1 << LOG_DETECTION_DP_CAPS) | \ (1 << LOG_BACKLIGHT)) | \ (1 << LOG_I2C_AUX) | \ - (1 << LOG_IF_TRACE) /* | \ + (1 << LOG_IF_TRACE) | \ + (1 << LOG_DTN) /* | \ (1 << LOG_DEBUG) | \ (1 << LOG_BIOS) | \ (1 << LOG_SURFACE) | \ diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 51e4cb30f8586e7a074de65def7f9491ba433ba5..c113c1a259d4355923948652383624c634f32272 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -944,9 +944,14 @@ bool dc_commit_streams( dc_enable_stereo(dc, context, streams, stream_count); } - CONN_MSG_MODE(sink->link, "{%dx%d, %dx%d@%dKhz}", + CONN_MSG_MODE(sink->link, "{%ux%u, %ux%u@%u, %ux%u@%uKhz}", + context->streams[i]->public.src.width, + context->streams[i]->public.src.height, context->streams[i]->public.timing.h_addressable, context->streams[i]->public.timing.v_addressable, + context->streams[i]->public.timing.pix_clk_khz * 1000 / + context->streams[i]->public.timing.h_total / + context->streams[i]->public.timing.v_total, // Refresh rate context->streams[i]->public.timing.h_total, context->streams[i]->public.timing.v_total, context->streams[i]->public.timing.pix_clk_khz); diff --git a/drivers/gpu/drm/amd/display/dc/dm_helpers.h b/drivers/gpu/drm/amd/display/dc/dm_helpers.h index 9fb606c49217b07417193ae3598ffab0a6b3e122..a831421c7ea0a90ee47ab7a56694a3a711c11d2f 100644 --- a/drivers/gpu/drm/amd/display/dc/dm_helpers.h +++ b/drivers/gpu/drm/amd/display/dc/dm_helpers.h @@ -70,7 +70,8 @@ bool dm_helpers_dp_mst_start_top_mgr( bool dm_helpers_dc_conn_log( struct dc_context*ctx, - const char *msg); + struct log_entry *entry, + enum dc_log_type event); void dm_helpers_dp_mst_stop_top_mgr( struct dc_context *ctx, diff --git a/drivers/gpu/drm/amd/display/include/logger_interface.h b/drivers/gpu/drm/amd/display/include/logger_interface.h index b75c343f86808d50ecc8d9b063a140328e331e1d..ce5fef243b09a98c0f6fee24e626f7d64735c8b6 100644 --- a/drivers/gpu/drm/amd/display/include/logger_interface.h +++ b/drivers/gpu/drm/amd/display/include/logger_interface.h @@ -70,6 +70,11 @@ void dc_conn_log(struct dc_context *ctx, const char *msg, ...); +void dc_raw_log(struct dc_context *ctx, + enum dc_log_type event, + const char *msg, + ...); + void logger_write(struct dal_logger *logger, enum dc_log_type log_type, const char *msg, diff --git a/drivers/gpu/drm/amd/display/include/logger_types.h b/drivers/gpu/drm/amd/display/include/logger_types.h index dfc0f102b33d8dd3234ae75b90fca018dd1f4f66..42ffb93e3172fe1d64c88118870cd91f313fb01f 100644 --- a/drivers/gpu/drm/amd/display/include/logger_types.h +++ b/drivers/gpu/drm/amd/display/include/logger_types.h @@ -37,6 +37,7 @@ enum dc_log_type { LOG_WARNING, LOG_DEBUG, LOG_DC, + LOG_DTN, LOG_SURFACE, LOG_HW_HOTPLUG, LOG_HW_LINK_TRAINING,