Commit 38636603 authored by Michel Dänzer's avatar Michel Dänzer Committed by Alex Deucher

drm/amd/display: Don't call dm_log_to_buffer directly in dc_conn_log

dm_log_to_buffer logs unconditionally, so calling it directly resulted
in the main message being logged even when the event type isn't enabled
in the event mask.

To fix this, use the new dm_logger_append_va API.

Fixes spurious messages like

 [drm] {1920x1200, 2080x1235@154000Khz}

in dmesg when a mode is set.

v2:
* Use new dm_logger_append_va API, fixes incorrect va_list usage in v1
* Just use and decrease entry.buf_offset to get rid of the trailing
  newline
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d6f068a5
...@@ -83,15 +83,11 @@ void dc_conn_log(struct dc_context *ctx, ...@@ -83,15 +83,11 @@ void dc_conn_log(struct dc_context *ctx,
link->link_index); link->link_index);
va_start(args, msg); va_start(args, msg);
entry.buf_offset += dm_log_to_buffer( dm_logger_append_va(&entry, msg, args);
&entry.buf[entry.buf_offset],
LOG_MAX_LINE_SIZE - entry.buf_offset,
msg, args);
if (entry.buf[strlen(entry.buf) - 1] == '\n') { if (entry.buf_offset > 0 &&
entry.buf[strlen(entry.buf) - 1] = '\0'; entry.buf[entry.buf_offset - 1] == '\n')
entry.buf_offset--; entry.buf_offset--;
}
if (hex_data) if (hex_data)
for (i = 0; i < hex_data_count; i++) for (i = 0; i < hex_data_count; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment