1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 #ifndef __DAL_LOGGER_INTERFACE_H__
27 #define __DAL_LOGGER_INTERFACE_H__
28
29 #include "logger_types.h"
30
31 struct dc_context;
32 struct dc_link;
33 struct dc_surface_update;
34 struct resource_context;
35 struct dc_state;
36
37
38
39
40
41
42
43 void dc_conn_log_hex_linux(const uint8_t *hex_data, int hex_data_count);
44
45 void pre_surface_trace(
46 struct dc *dc,
47 const struct dc_plane_state *const *plane_states,
48 int surface_count);
49
50 void update_surface_trace(
51 struct dc *dc,
52 const struct dc_surface_update *updates,
53 int surface_count);
54
55 void post_surface_trace(struct dc *dc);
56
57 void context_timing_trace(
58 struct dc *dc,
59 struct resource_context *res_ctx);
60
61 void context_clock_trace(
62 struct dc *dc,
63 struct dc_state *context);
64
65
66
67
68
69
70 #define DAL_LOGGER_NOT_IMPL(fmt, ...) \
71 do { \
72 static bool print_not_impl = true; \
73 if (print_not_impl == true) { \
74 print_not_impl = false; \
75 DRM_WARN("DAL_NOT_IMPL: " fmt, ##__VA_ARGS__); \
76 } \
77 } while (0)
78
79
80
81
82
83 #define DC_ERROR(...) \
84 do { \
85 (void)(dc_ctx); \
86 DC_LOG_ERROR(__VA_ARGS__); \
87 } while (0)
88
89 #define DC_SYNC_INFO(...) \
90 do { \
91 (void)(dc_ctx); \
92 DC_LOG_SYNC(__VA_ARGS__); \
93 } while (0)
94
95
96
97
98
99
100
101
102 #define CONN_DATA_DETECT(link, hex_data, hex_len, ...) \
103 do { \
104 (void)(link); \
105 dc_conn_log_hex_linux(hex_data, hex_len); \
106 DC_LOG_EVENT_DETECTION(__VA_ARGS__); \
107 } while (0)
108
109 #define CONN_DATA_LINK_LOSS(link, hex_data, hex_len, ...) \
110 do { \
111 (void)(link); \
112 dc_conn_log_hex_linux(hex_data, hex_len); \
113 DC_LOG_EVENT_LINK_LOSS(__VA_ARGS__); \
114 } while (0)
115
116 #define CONN_MSG_LT(link, ...) \
117 do { \
118 (void)(link); \
119 DC_LOG_EVENT_LINK_TRAINING(__VA_ARGS__); \
120 } while (0)
121
122 #define CONN_MSG_MODE(link, ...) \
123 do { \
124 (void)(link); \
125 DC_LOG_EVENT_MODE_SET(__VA_ARGS__); \
126 } while (0)
127
128
129
130
131 #define DTN_INFO_BEGIN() \
132 dm_dtn_log_begin(dc_ctx, log_ctx)
133
134 #define DTN_INFO(msg, ...) \
135 dm_dtn_log_append_v(dc_ctx, log_ctx, msg, ##__VA_ARGS__)
136
137 #define DTN_INFO_END() \
138 dm_dtn_log_end(dc_ctx, log_ctx)
139
140 #define PERFORMANCE_TRACE_START() \
141 unsigned long long perf_trc_start_stmp = dm_get_timestamp(dc->ctx)
142
143 #define PERFORMANCE_TRACE_END() \
144 do { \
145 unsigned long long perf_trc_end_stmp = dm_get_timestamp(dc->ctx); \
146 if (dc->debug.performance_trace) { \
147 DC_LOG_PERF_TRACE("%s duration: %lld ticks\n", __func__, \
148 perf_trc_end_stmp - perf_trc_start_stmp); \
149 } \
150 } while (0)
151
152 #define DISPLAY_STATS_BEGIN(entry) (void)(entry)
153
154 #define DISPLAY_STATS(msg, ...) DC_LOG_PERF_TRACE(msg, __VA_ARGS__)
155
156 #define DISPLAY_STATS_END(entry) (void)(entry)
157
158 #define LOG_GAMMA_WRITE(msg, ...)
159
160 #endif