0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #ifndef __DAL_LOGGER_INTERFACE_H__
0027 #define __DAL_LOGGER_INTERFACE_H__
0028
0029 #include "logger_types.h"
0030
0031 struct dc_context;
0032 struct dc_link;
0033 struct dc_surface_update;
0034 struct resource_context;
0035 struct dc_state;
0036
0037
0038
0039
0040
0041
0042
0043 void pre_surface_trace(
0044 struct dc *dc,
0045 const struct dc_plane_state *const *plane_states,
0046 int surface_count);
0047
0048 void update_surface_trace(
0049 struct dc *dc,
0050 const struct dc_surface_update *updates,
0051 int surface_count);
0052
0053 void post_surface_trace(struct dc *dc);
0054
0055 void context_timing_trace(
0056 struct dc *dc,
0057 struct resource_context *res_ctx);
0058
0059 void context_clock_trace(
0060 struct dc *dc,
0061 struct dc_state *context);
0062
0063
0064
0065
0066
0067
0068 #define DAL_LOGGER_NOT_IMPL(fmt, ...) \
0069 do { \
0070 static bool print_not_impl = true; \
0071 if (print_not_impl == true) { \
0072 print_not_impl = false; \
0073 DRM_WARN("DAL_NOT_IMPL: " fmt, ##__VA_ARGS__); \
0074 } \
0075 } while (0)
0076
0077
0078
0079
0080
0081 #define DC_ERROR(...) \
0082 do { \
0083 (void)(dc_ctx); \
0084 DC_LOG_ERROR(__VA_ARGS__); \
0085 } while (0)
0086
0087 #define DC_SYNC_INFO(...) \
0088 do { \
0089 (void)(dc_ctx); \
0090 DC_LOG_SYNC(__VA_ARGS__); \
0091 } while (0)
0092
0093
0094
0095
0096
0097
0098
0099
0100 #define CONN_DATA_DETECT(link, hex_data, hex_len, ...) \
0101 do { \
0102 (void)(link); \
0103 DC_LOG_EVENT_DETECTION(__VA_ARGS__); \
0104 } while (0)
0105
0106 #define CONN_DATA_LINK_LOSS(link, hex_data, hex_len, ...) \
0107 do { \
0108 (void)(link); \
0109 DC_LOG_EVENT_LINK_LOSS(__VA_ARGS__); \
0110 } while (0)
0111
0112 #define CONN_MSG_LT(link, ...) \
0113 do { \
0114 (void)(link); \
0115 DC_LOG_EVENT_LINK_TRAINING(__VA_ARGS__); \
0116 } while (0)
0117
0118 #define CONN_MSG_MODE(link, ...) \
0119 do { \
0120 (void)(link); \
0121 DC_LOG_EVENT_MODE_SET(__VA_ARGS__); \
0122 } while (0)
0123
0124
0125
0126
0127 #define DTN_INFO_BEGIN() \
0128 dm_dtn_log_begin(dc_ctx, log_ctx)
0129
0130 #define DTN_INFO(msg, ...) \
0131 dm_dtn_log_append_v(dc_ctx, log_ctx, msg, ##__VA_ARGS__)
0132
0133 #define DTN_INFO_END() \
0134 dm_dtn_log_end(dc_ctx, log_ctx)
0135
0136 #define PERFORMANCE_TRACE_START() \
0137 unsigned long long perf_trc_start_stmp = dm_get_timestamp(dc->ctx)
0138
0139 #define PERFORMANCE_TRACE_END() \
0140 do { \
0141 unsigned long long perf_trc_end_stmp = dm_get_timestamp(dc->ctx); \
0142 if (dc->debug.performance_trace) { \
0143 DC_LOG_PERF_TRACE("%s duration: %lld ticks\n", __func__, \
0144 perf_trc_end_stmp - perf_trc_start_stmp); \
0145 } \
0146 } while (0)
0147
0148 #define DISPLAY_STATS_BEGIN(entry) (void)(entry)
0149
0150 #define DISPLAY_STATS(msg, ...) DC_LOG_PERF_TRACE(msg, __VA_ARGS__)
0151
0152 #define DISPLAY_STATS_END(entry) (void)(entry)
0153
0154 #define LOG_GAMMA_WRITE(msg, ...)
0155
0156 #endif