diff options
author | Anthony Koo <Anthony.Koo@amd.com> | 2018-04-24 22:36:27 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-19 00:08:27 +0300 |
commit | 5103c5688518ea16c7f2f864b784c1266cd13c89 (patch) | |
tree | c874d1a033ed174dce7917647b2fd0bf0af8061a /drivers/gpu | |
parent | 66dec27a987bfcd2572bfc7520826b11340d264f (diff) | |
download | linux-5103c5688518ea16c7f2f864b784c1266cd13c89.tar.xz |
drm/amd/display: use macro for logs
Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/display/include/logger_interface.h | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/stats/stats.c | 19 |
2 files changed, 15 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/display/include/logger_interface.h b/drivers/gpu/drm/amd/display/include/logger_interface.h index 28dee960d509..dc98d6d4b2bd 100644 --- a/drivers/gpu/drm/amd/display/include/logger_interface.h +++ b/drivers/gpu/drm/amd/display/include/logger_interface.h @@ -190,4 +190,13 @@ void context_clock_trace( } \ } 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__ */ diff --git a/drivers/gpu/drm/amd/display/modules/stats/stats.c b/drivers/gpu/drm/amd/display/modules/stats/stats.c index ae2d92b73cf1..45acdbc3c08a 100644 --- a/drivers/gpu/drm/amd/display/modules/stats/stats.c +++ b/drivers/gpu/drm/amd/display/modules/stats/stats.c @@ -178,19 +178,13 @@ void mod_stats_dump(struct mod_stats *mod_stats) logger = dc->ctx->logger; time = core_stats->time; - dm_logger_open( - dc->ctx->logger, - &log_entry, - LOG_DISPLAYSTATS); + DISPLAY_STATS_BEGIN(log_entry); - dm_logger_append(&log_entry, "==Display Caps==\n"); - dm_logger_append(&log_entry, "\n"); + DISPLAY_STATS("==Display Caps==\n"); - dm_logger_append(&log_entry, "==Display Stats==\n"); - dm_logger_append(&log_entry, "\n"); + DISPLAY_STATS("==Display Stats==\n"); - dm_logger_append(&log_entry, - "%10s %10s %10s %10s %10s" + DISPLAY_STATS("%10s %10s %10s %10s %10s" " %11s %11s %17s %10s %14s" " %10s %10s %10s %10s %10s" " %10s %10s %10s %10s\n", @@ -203,8 +197,7 @@ void mod_stats_dump(struct mod_stats *mod_stats) "vSyncTime4", "vSyncTime5", "flags"); for (int i = 0; i < core_stats->index && i < core_stats->entries; i++) { - dm_logger_append(&log_entry, - "%10u %10u %10u %10u %10u" + DISPLAY_STATS("%10u %10u %10u %10u %10u" " %11u %11u %17u %10u %14u" " %10u %10u %10u %10u %10u" " %10u %10u %10u %10u\n", @@ -229,7 +222,7 @@ void mod_stats_dump(struct mod_stats *mod_stats) time[i].flags); } - dm_logger_close(&log_entry); + DISPLAY_STATS_END(log_entry); } void mod_stats_reset_data(struct mod_stats *mod_stats) |