]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/gpu/drm/amd/display/dc/core/dc_debug.c
4 * Created on: Nov 3, 2016
8 #include "dm_services.h"
12 #include "core_status.h"
13 #include "core_types.h"
14 #include "hw_sequencer.h"
18 #define SURFACE_TRACE(...) do {\
19 if (dc->debug.surface_trace) \
20 dm_logger_write(logger, \
25 #define TIMING_TRACE(...) do {\
26 if (dc->debug.timing_trace) \
27 dm_logger_write(logger, \
32 void pre_surface_trace(
34 const struct dc_surface
*const *surfaces
,
38 struct core_dc
*core_dc
= DC_TO_CORE(dc
);
39 struct dal_logger
*logger
= core_dc
->ctx
->logger
;
41 for (i
= 0; i
< surface_count
; i
++) {
42 const struct dc_surface
*surface
= surfaces
[i
];
44 SURFACE_TRACE("Surface %d:\n", i
);
47 "surface->visible = %d;\n"
48 "surface->flip_immediate = %d;\n"
49 "surface->address.type = %d;\n"
50 "surface->address.grph.addr.quad_part = 0x%X;\n"
51 "surface->address.grph.meta_addr.quad_part = 0x%X;\n"
52 "surface->scaling_quality.h_taps = %d;\n"
53 "surface->scaling_quality.v_taps = %d;\n"
54 "surface->scaling_quality.h_taps_c = %d;\n"
55 "surface->scaling_quality.v_taps_c = %d;\n",
57 surface
->flip_immediate
,
58 surface
->address
.type
,
59 surface
->address
.grph
.addr
.quad_part
,
60 surface
->address
.grph
.meta_addr
.quad_part
,
61 surface
->scaling_quality
.h_taps
,
62 surface
->scaling_quality
.v_taps
,
63 surface
->scaling_quality
.h_taps_c
,
64 surface
->scaling_quality
.v_taps_c
);
67 "surface->src_rect.x = %d;\n"
68 "surface->src_rect.y = %d;\n"
69 "surface->src_rect.width = %d;\n"
70 "surface->src_rect.height = %d;\n"
71 "surface->dst_rect.x = %d;\n"
72 "surface->dst_rect.y = %d;\n"
73 "surface->dst_rect.width = %d;\n"
74 "surface->dst_rect.height = %d;\n"
75 "surface->clip_rect.x = %d;\n"
76 "surface->clip_rect.y = %d;\n"
77 "surface->clip_rect.width = %d;\n"
78 "surface->clip_rect.height = %d;\n",
81 surface
->src_rect
.width
,
82 surface
->src_rect
.height
,
85 surface
->dst_rect
.width
,
86 surface
->dst_rect
.height
,
89 surface
->clip_rect
.width
,
90 surface
->clip_rect
.height
);
93 "surface->plane_size.grph.surface_size.x = %d;\n"
94 "surface->plane_size.grph.surface_size.y = %d;\n"
95 "surface->plane_size.grph.surface_size.width = %d;\n"
96 "surface->plane_size.grph.surface_size.height = %d;\n"
97 "surface->plane_size.grph.surface_pitch = %d;\n",
98 surface
->plane_size
.grph
.surface_size
.x
,
99 surface
->plane_size
.grph
.surface_size
.y
,
100 surface
->plane_size
.grph
.surface_size
.width
,
101 surface
->plane_size
.grph
.surface_size
.height
,
102 surface
->plane_size
.grph
.surface_pitch
);
106 "surface->tiling_info.gfx8.num_banks = %d;\n"
107 "surface->tiling_info.gfx8.bank_width = %d;\n"
108 "surface->tiling_info.gfx8.bank_width_c = %d;\n"
109 "surface->tiling_info.gfx8.bank_height = %d;\n"
110 "surface->tiling_info.gfx8.bank_height_c = %d;\n"
111 "surface->tiling_info.gfx8.tile_aspect = %d;\n"
112 "surface->tiling_info.gfx8.tile_aspect_c = %d;\n"
113 "surface->tiling_info.gfx8.tile_split = %d;\n"
114 "surface->tiling_info.gfx8.tile_split_c = %d;\n"
115 "surface->tiling_info.gfx8.tile_mode = %d;\n"
116 "surface->tiling_info.gfx8.tile_mode_c = %d;\n",
117 surface
->tiling_info
.gfx8
.num_banks
,
118 surface
->tiling_info
.gfx8
.bank_width
,
119 surface
->tiling_info
.gfx8
.bank_width_c
,
120 surface
->tiling_info
.gfx8
.bank_height
,
121 surface
->tiling_info
.gfx8
.bank_height_c
,
122 surface
->tiling_info
.gfx8
.tile_aspect
,
123 surface
->tiling_info
.gfx8
.tile_aspect_c
,
124 surface
->tiling_info
.gfx8
.tile_split
,
125 surface
->tiling_info
.gfx8
.tile_split_c
,
126 surface
->tiling_info
.gfx8
.tile_mode
,
127 surface
->tiling_info
.gfx8
.tile_mode_c
);
130 "surface->tiling_info.gfx8.pipe_config = %d;\n"
131 "surface->tiling_info.gfx8.array_mode = %d;\n"
132 "surface->color_space = %d;\n"
133 "surface->dcc.enable = %d;\n"
134 "surface->format = %d;\n"
135 "surface->rotation = %d;\n"
136 "surface->stereo_format = %d;\n",
137 surface
->tiling_info
.gfx8
.pipe_config
,
138 surface
->tiling_info
.gfx8
.array_mode
,
139 surface
->color_space
,
143 surface
->stereo_format
);
145 SURFACE_TRACE("surface->tiling_info.gfx9.swizzle = %d;\n",
146 surface
->tiling_info
.gfx9
.swizzle
);
153 void update_surface_trace(
155 const struct dc_surface_update
*updates
,
159 struct core_dc
*core_dc
= DC_TO_CORE(dc
);
160 struct dal_logger
*logger
= core_dc
->ctx
->logger
;
162 for (i
= 0; i
< surface_count
; i
++) {
163 const struct dc_surface_update
*update
= &updates
[i
];
165 SURFACE_TRACE("Update %d\n", i
);
166 if (update
->flip_addr
) {
167 SURFACE_TRACE("flip_addr->address.type = %d;\n"
168 "flip_addr->address.grph.addr.quad_part = 0x%X;\n"
169 "flip_addr->address.grph.meta_addr.quad_part = 0x%X;\n"
170 "flip_addr->flip_immediate = %d;\n",
171 update
->flip_addr
->address
.type
,
172 update
->flip_addr
->address
.grph
.addr
.quad_part
,
173 update
->flip_addr
->address
.grph
.meta_addr
.quad_part
,
174 update
->flip_addr
->flip_immediate
);
177 if (update
->plane_info
) {
179 "plane_info->color_space = %d;\n"
180 "plane_info->format = %d;\n"
181 "plane_info->plane_size.grph.surface_pitch = %d;\n"
182 "plane_info->plane_size.grph.surface_size.height = %d;\n"
183 "plane_info->plane_size.grph.surface_size.width = %d;\n"
184 "plane_info->plane_size.grph.surface_size.x = %d;\n"
185 "plane_info->plane_size.grph.surface_size.y = %d;\n"
186 "plane_info->rotation = %d;\n",
187 update
->plane_info
->color_space
,
188 update
->plane_info
->format
,
189 update
->plane_info
->plane_size
.grph
.surface_pitch
,
190 update
->plane_info
->plane_size
.grph
.surface_size
.height
,
191 update
->plane_info
->plane_size
.grph
.surface_size
.width
,
192 update
->plane_info
->plane_size
.grph
.surface_size
.x
,
193 update
->plane_info
->plane_size
.grph
.surface_size
.y
,
194 update
->plane_info
->rotation
,
195 update
->plane_info
->stereo_format
);
198 "plane_info->tiling_info.gfx8.num_banks = %d;\n"
199 "plane_info->tiling_info.gfx8.bank_width = %d;\n"
200 "plane_info->tiling_info.gfx8.bank_width_c = %d;\n"
201 "plane_info->tiling_info.gfx8.bank_height = %d;\n"
202 "plane_info->tiling_info.gfx8.bank_height_c = %d;\n"
203 "plane_info->tiling_info.gfx8.tile_aspect = %d;\n"
204 "plane_info->tiling_info.gfx8.tile_aspect_c = %d;\n"
205 "plane_info->tiling_info.gfx8.tile_split = %d;\n"
206 "plane_info->tiling_info.gfx8.tile_split_c = %d;\n"
207 "plane_info->tiling_info.gfx8.tile_mode = %d;\n"
208 "plane_info->tiling_info.gfx8.tile_mode_c = %d;\n",
209 update
->plane_info
->tiling_info
.gfx8
.num_banks
,
210 update
->plane_info
->tiling_info
.gfx8
.bank_width
,
211 update
->plane_info
->tiling_info
.gfx8
.bank_width_c
,
212 update
->plane_info
->tiling_info
.gfx8
.bank_height
,
213 update
->plane_info
->tiling_info
.gfx8
.bank_height_c
,
214 update
->plane_info
->tiling_info
.gfx8
.tile_aspect
,
215 update
->plane_info
->tiling_info
.gfx8
.tile_aspect_c
,
216 update
->plane_info
->tiling_info
.gfx8
.tile_split
,
217 update
->plane_info
->tiling_info
.gfx8
.tile_split_c
,
218 update
->plane_info
->tiling_info
.gfx8
.tile_mode
,
219 update
->plane_info
->tiling_info
.gfx8
.tile_mode_c
);
222 "plane_info->tiling_info.gfx8.pipe_config = %d;\n"
223 "plane_info->tiling_info.gfx8.array_mode = %d;\n"
224 "plane_info->visible = %d;\n",
225 update
->plane_info
->tiling_info
.gfx8
.pipe_config
,
226 update
->plane_info
->tiling_info
.gfx8
.array_mode
,
227 update
->plane_info
->visible
);
229 SURFACE_TRACE("surface->tiling_info.gfx9.swizzle = %d;\n",
230 update
->plane_info
->tiling_info
.gfx9
.swizzle
);
233 if (update
->scaling_info
) {
235 "scaling_info->src_rect.x = %d;\n"
236 "scaling_info->src_rect.y = %d;\n"
237 "scaling_info->src_rect.width = %d;\n"
238 "scaling_info->src_rect.height = %d;\n"
239 "scaling_info->dst_rect.x = %d;\n"
240 "scaling_info->dst_rect.y = %d;\n"
241 "scaling_info->dst_rect.width = %d;\n"
242 "scaling_info->dst_rect.height = %d;\n"
243 "scaling_info->clip_rect.x = %d;\n"
244 "scaling_info->clip_rect.y = %d;\n"
245 "scaling_info->clip_rect.width = %d;\n"
246 "scaling_info->clip_rect.height = %d;\n"
247 "scaling_info->scaling_quality.h_taps = %d;\n"
248 "scaling_info->scaling_quality.v_taps = %d;\n"
249 "scaling_info->scaling_quality.h_taps_c = %d;\n"
250 "scaling_info->scaling_quality.v_taps_c = %d;\n",
251 update
->scaling_info
->src_rect
.x
,
252 update
->scaling_info
->src_rect
.y
,
253 update
->scaling_info
->src_rect
.width
,
254 update
->scaling_info
->src_rect
.height
,
255 update
->scaling_info
->dst_rect
.x
,
256 update
->scaling_info
->dst_rect
.y
,
257 update
->scaling_info
->dst_rect
.width
,
258 update
->scaling_info
->dst_rect
.height
,
259 update
->scaling_info
->clip_rect
.x
,
260 update
->scaling_info
->clip_rect
.y
,
261 update
->scaling_info
->clip_rect
.width
,
262 update
->scaling_info
->clip_rect
.height
,
263 update
->scaling_info
->scaling_quality
.h_taps
,
264 update
->scaling_info
->scaling_quality
.v_taps
,
265 update
->scaling_info
->scaling_quality
.h_taps_c
,
266 update
->scaling_info
->scaling_quality
.v_taps_c
);
273 void post_surface_trace(const struct dc
*dc
)
275 struct core_dc
*core_dc
= DC_TO_CORE(dc
);
276 struct dal_logger
*logger
= core_dc
->ctx
->logger
;
278 SURFACE_TRACE("post surface process.\n");
282 void context_timing_trace(
284 struct resource_context
*res_ctx
)
287 struct core_dc
*core_dc
= DC_TO_CORE(dc
);
288 struct dal_logger
*logger
= core_dc
->ctx
->logger
;
289 int h_pos
[MAX_PIPES
], v_pos
[MAX_PIPES
];
290 struct crtc_position position
;
292 for (i
= 0; i
< core_dc
->res_pool
->pipe_count
; i
++) {
293 struct pipe_ctx
*pipe_ctx
= &res_ctx
->pipe_ctx
[i
];
295 if (pipe_ctx
->stream
== NULL
)
298 pipe_ctx
->tg
->funcs
->get_position(pipe_ctx
->tg
, &position
);
299 h_pos
[i
] = position
.horizontal_count
;
300 v_pos
[i
] = position
.vertical_count
;
302 for (i
= 0; i
< core_dc
->res_pool
->pipe_count
; i
++) {
303 struct pipe_ctx
*pipe_ctx
= &res_ctx
->pipe_ctx
[i
];
305 if (pipe_ctx
->stream
== NULL
)
308 TIMING_TRACE("OTG_%d H_tot:%d V_tot:%d H_pos:%d V_pos:%d\n",
310 pipe_ctx
->stream
->public.timing
.h_total
,
311 pipe_ctx
->stream
->public.timing
.v_total
,