Commit 5103c568 authored by Anthony Koo's avatar Anthony Koo Committed by Alex Deucher

drm/amd/display: use macro for logs

Signed-off-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 66dec27a
...@@ -190,4 +190,13 @@ void context_clock_trace( ...@@ -190,4 +190,13 @@ void context_clock_trace(
} \ } \
} while (0) } while (0)
#define DISPLAY_STATS_BEGIN(entry) \
dm_logger_open(dc->ctx->logger, &entry, LOG_DISPLAYSTATS)
#define DISPLAY_STATS(msg, ...) \
dm_logger_append(&log_entry, msg, ##__VA_ARGS__)
#define DISPLAY_STATS_END(entry) \
dm_logger_close(&entry)
#endif /* __DAL_LOGGER_INTERFACE_H__ */ #endif /* __DAL_LOGGER_INTERFACE_H__ */
...@@ -178,19 +178,13 @@ void mod_stats_dump(struct mod_stats *mod_stats) ...@@ -178,19 +178,13 @@ void mod_stats_dump(struct mod_stats *mod_stats)
logger = dc->ctx->logger; logger = dc->ctx->logger;
time = core_stats->time; time = core_stats->time;
dm_logger_open( DISPLAY_STATS_BEGIN(log_entry);
dc->ctx->logger,
&log_entry,
LOG_DISPLAYSTATS);
dm_logger_append(&log_entry, "==Display Caps==\n"); DISPLAY_STATS("==Display Caps==\n");
dm_logger_append(&log_entry, "\n");
dm_logger_append(&log_entry, "==Display Stats==\n"); DISPLAY_STATS("==Display Stats==\n");
dm_logger_append(&log_entry, "\n");
dm_logger_append(&log_entry, DISPLAY_STATS("%10s %10s %10s %10s %10s"
"%10s %10s %10s %10s %10s"
" %11s %11s %17s %10s %14s" " %11s %11s %17s %10s %14s"
" %10s %10s %10s %10s %10s" " %10s %10s %10s %10s %10s"
" %10s %10s %10s %10s\n", " %10s %10s %10s %10s\n",
...@@ -203,8 +197,7 @@ void mod_stats_dump(struct mod_stats *mod_stats) ...@@ -203,8 +197,7 @@ void mod_stats_dump(struct mod_stats *mod_stats)
"vSyncTime4", "vSyncTime5", "flags"); "vSyncTime4", "vSyncTime5", "flags");
for (int i = 0; i < core_stats->index && i < core_stats->entries; i++) { for (int i = 0; i < core_stats->index && i < core_stats->entries; i++) {
dm_logger_append(&log_entry, DISPLAY_STATS("%10u %10u %10u %10u %10u"
"%10u %10u %10u %10u %10u"
" %11u %11u %17u %10u %14u" " %11u %11u %17u %10u %14u"
" %10u %10u %10u %10u %10u" " %10u %10u %10u %10u %10u"
" %10u %10u %10u %10u\n", " %10u %10u %10u %10u\n",
...@@ -229,7 +222,7 @@ void mod_stats_dump(struct mod_stats *mod_stats) ...@@ -229,7 +222,7 @@ void mod_stats_dump(struct mod_stats *mod_stats)
time[i].flags); time[i].flags);
} }
dm_logger_close(&log_entry); DISPLAY_STATS_END(log_entry);
} }
void mod_stats_reset_data(struct mod_stats *mod_stats) void mod_stats_reset_data(struct mod_stats *mod_stats)
......
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