]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/gpu/drm/amd/display/include/logger_interface.h
0e978d921fdf105b31c58894b7185889946c0a4d
2 * Copyright 2012-15 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #ifndef __DAL_LOGGER_INTERFACE_H__
27 #define __DAL_LOGGER_INTERFACE_H__
29 #include "logger_types.h"
33 struct dc_surface_update
;
34 struct resource_context
;
35 struct validate_context
;
39 * DAL logger functionality
43 struct dal_logger
*dal_logger_create(struct dc_context
*ctx
);
45 uint32_t dal_logger_destroy(struct dal_logger
**logger
);
48 struct dal_logger
*logger
,
49 enum dc_log_type log_type
,
53 void dm_logger_append(
54 struct log_entry
*entry
,
59 struct dal_logger
*logger
,
60 struct log_entry
*entry
,
61 enum dc_log_type log_type
);
63 void dm_logger_close(struct log_entry
*entry
);
65 void dc_conn_log(struct dc_context
*ctx
,
66 const struct dc_link
*link
,
69 enum dc_log_type event
,
73 void logger_write(struct dal_logger
*logger
,
74 enum dc_log_type log_type
,
78 void pre_surface_trace(
80 const struct dc_plane_state
*const *surfaces
,
83 void update_surface_trace(
85 const struct dc_surface_update
*updates
,
88 void post_surface_trace(const struct dc
*dc
);
90 void context_timing_trace(
92 struct resource_context
*res_ctx
);
94 void context_clock_trace(
96 struct validate_context
*context
);
98 /* Any function which is empty or have incomplete implementation should be
99 * marked by this macro.
100 * Note that the message will be printed exactly once for every function
101 * it is used in order to avoid repeating of the same message. */
102 #define DAL_LOGGER_NOT_IMPL(fmt, ...) \
104 static bool print_not_impl = true; \
106 if (print_not_impl == true) { \
107 print_not_impl = false; \
108 dm_logger_write(ctx->logger, LOG_WARNING, \
109 "DAL_NOT_IMPL: " fmt, ##__VA_ARGS__); \
113 /******************************************************************************
114 * Convenience macros to save on typing.
115 *****************************************************************************/
117 #define DC_ERROR(...) \
118 dm_logger_write(dc_ctx->logger, LOG_ERROR, \
121 #define DC_SYNC_INFO(...) \
122 dm_logger_write(dc_ctx->logger, LOG_SYNC, \
125 /* Connectivity log format:
126 * [time stamp] [drm] [Major_minor] [connector name] message.....
128 * [ 26.590965] [drm] [Conn_LKTN] [DP-1] HBRx4 pass VS=0, PE=0^
129 * [ 26.881060] [drm] [Conn_Mode] [DP-1] {2560x1080, 2784x1111@185580Khz}^
132 #define CONN_DATA_DETECT(link, hex_data, hex_len, ...) \
133 dc_conn_log(link->ctx, link, hex_data, hex_len, \
134 LOG_EVENT_DETECTION, ##__VA_ARGS__)
136 #define CONN_DATA_LINK_LOSS(link, hex_data, hex_len, ...) \
137 dc_conn_log(link->ctx, link, hex_data, hex_len, \
138 LOG_EVENT_LINK_LOSS, ##__VA_ARGS__)
140 #define CONN_MSG_LT(link, ...) \
141 dc_conn_log(link->ctx, link, NULL, 0, \
142 LOG_EVENT_LINK_TRAINING, ##__VA_ARGS__)
144 #define CONN_MSG_MODE(link, ...) \
145 dc_conn_log(link->ctx, link, NULL, 0, \
146 LOG_EVENT_MODE_SET, ##__VA_ARGS__)
149 * Display Test Next logging
151 #define DTN_INFO_BEGIN() \
152 dm_dtn_log_begin(dc_ctx)
154 #define DTN_INFO(msg, ...) \
155 dm_dtn_log_append_v(dc_ctx, msg, ##__VA_ARGS__)
157 #define DTN_INFO_END() \
158 dm_dtn_log_end(dc_ctx)
160 #endif /* __DAL_LOGGER_INTERFACE_H__ */