]>
Commit | Line | Data |
---|---|---|
fd2b94a5 JN |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | |
3 | * Copyright © 2021 Intel Corporation | |
4 | */ | |
5 | ||
6 | #undef TRACE_SYSTEM | |
7 | #define TRACE_SYSTEM i915 | |
8 | ||
9 | #if !defined(__INTEL_DISPLAY_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ) | |
10 | #define __INTEL_DISPLAY_TRACE_H__ | |
11 | ||
f79a568a | 12 | #include <linux/string_helpers.h> |
fd2b94a5 JN |
13 | #include <linux/types.h> |
14 | #include <linux/tracepoint.h> | |
15 | ||
16 | #include "i915_drv.h" | |
17 | #include "intel_crtc.h" | |
18 | #include "intel_display_types.h" | |
62fe4515 | 19 | #include "intel_vblank.h" |
fd2b94a5 | 20 | |
6b3960b1 VS |
21 | #define __dev_name_i915(i915) dev_name((i915)->drm.dev) |
22 | #define __dev_name_kms(obj) dev_name((obj)->base.dev->dev) | |
23 | ||
fd2b94a5 JN |
24 | TRACE_EVENT(intel_pipe_enable, |
25 | TP_PROTO(struct intel_crtc *crtc), | |
26 | TP_ARGS(crtc), | |
27 | ||
28 | TP_STRUCT__entry( | |
6b3960b1 | 29 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
30 | __array(u32, frame, 3) |
31 | __array(u32, scanline, 3) | |
32 | __field(enum pipe, pipe) | |
33 | ), | |
34 | TP_fast_assign( | |
35 | struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); | |
36 | struct intel_crtc *it__; | |
2c92ca84 | 37 | __assign_str(dev); |
fd2b94a5 JN |
38 | for_each_intel_crtc(&dev_priv->drm, it__) { |
39 | __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__); | |
40 | __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__); | |
41 | } | |
42 | __entry->pipe = crtc->pipe; | |
43 | ), | |
44 | ||
6b3960b1 VS |
45 | TP_printk("dev %s, pipe %c enable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u", |
46 | __get_str(dev), pipe_name(__entry->pipe), | |
fd2b94a5 JN |
47 | __entry->frame[PIPE_A], __entry->scanline[PIPE_A], |
48 | __entry->frame[PIPE_B], __entry->scanline[PIPE_B], | |
49 | __entry->frame[PIPE_C], __entry->scanline[PIPE_C]) | |
50 | ); | |
51 | ||
52 | TRACE_EVENT(intel_pipe_disable, | |
53 | TP_PROTO(struct intel_crtc *crtc), | |
54 | TP_ARGS(crtc), | |
55 | ||
56 | TP_STRUCT__entry( | |
6b3960b1 | 57 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
58 | __array(u32, frame, 3) |
59 | __array(u32, scanline, 3) | |
60 | __field(enum pipe, pipe) | |
61 | ), | |
62 | ||
63 | TP_fast_assign( | |
64 | struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); | |
65 | struct intel_crtc *it__; | |
2c92ca84 | 66 | __assign_str(dev); |
fd2b94a5 JN |
67 | for_each_intel_crtc(&dev_priv->drm, it__) { |
68 | __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__); | |
69 | __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__); | |
70 | } | |
71 | __entry->pipe = crtc->pipe; | |
72 | ), | |
73 | ||
6b3960b1 VS |
74 | TP_printk("dev %s, pipe %c disable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u", |
75 | __get_str(dev), pipe_name(__entry->pipe), | |
fd2b94a5 JN |
76 | __entry->frame[PIPE_A], __entry->scanline[PIPE_A], |
77 | __entry->frame[PIPE_B], __entry->scanline[PIPE_B], | |
78 | __entry->frame[PIPE_C], __entry->scanline[PIPE_C]) | |
79 | ); | |
80 | ||
81 | TRACE_EVENT(intel_pipe_crc, | |
82 | TP_PROTO(struct intel_crtc *crtc, const u32 *crcs), | |
83 | TP_ARGS(crtc, crcs), | |
84 | ||
85 | TP_STRUCT__entry( | |
6b3960b1 | 86 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
87 | __field(enum pipe, pipe) |
88 | __field(u32, frame) | |
89 | __field(u32, scanline) | |
90 | __array(u32, crcs, 5) | |
91 | ), | |
92 | ||
93 | TP_fast_assign( | |
2c92ca84 | 94 | __assign_str(dev); |
fd2b94a5 JN |
95 | __entry->pipe = crtc->pipe; |
96 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
97 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
98 | memcpy(__entry->crcs, crcs, sizeof(__entry->crcs)); | |
99 | ), | |
100 | ||
6b3960b1 VS |
101 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u crc=%08x %08x %08x %08x %08x", |
102 | __get_str(dev), pipe_name(__entry->pipe), | |
103 | __entry->frame, __entry->scanline, | |
104 | __entry->crcs[0], __entry->crcs[1], | |
105 | __entry->crcs[2], __entry->crcs[3], | |
106 | __entry->crcs[4]) | |
fd2b94a5 JN |
107 | ); |
108 | ||
109 | TRACE_EVENT(intel_cpu_fifo_underrun, | |
110 | TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe), | |
111 | TP_ARGS(dev_priv, pipe), | |
112 | ||
113 | TP_STRUCT__entry( | |
6b3960b1 | 114 | __string(dev, __dev_name_i915(dev_priv)) |
fd2b94a5 JN |
115 | __field(enum pipe, pipe) |
116 | __field(u32, frame) | |
117 | __field(u32, scanline) | |
118 | ), | |
119 | ||
120 | TP_fast_assign( | |
121 | struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe); | |
2c92ca84 | 122 | __assign_str(dev); |
fd2b94a5 JN |
123 | __entry->pipe = pipe; |
124 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
125 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
126 | ), | |
127 | ||
6b3960b1 VS |
128 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u", |
129 | __get_str(dev), pipe_name(__entry->pipe), | |
fd2b94a5 JN |
130 | __entry->frame, __entry->scanline) |
131 | ); | |
132 | ||
133 | TRACE_EVENT(intel_pch_fifo_underrun, | |
134 | TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pch_transcoder), | |
135 | TP_ARGS(dev_priv, pch_transcoder), | |
136 | ||
137 | TP_STRUCT__entry( | |
6b3960b1 | 138 | __string(dev, __dev_name_i915(dev_priv)) |
fd2b94a5 JN |
139 | __field(enum pipe, pipe) |
140 | __field(u32, frame) | |
141 | __field(u32, scanline) | |
142 | ), | |
143 | ||
144 | TP_fast_assign( | |
145 | enum pipe pipe = pch_transcoder; | |
146 | struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe); | |
2c92ca84 | 147 | __assign_str(dev); |
fd2b94a5 JN |
148 | __entry->pipe = pipe; |
149 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
150 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
151 | ), | |
152 | ||
6b3960b1 VS |
153 | TP_printk("dev %s, pch transcoder %c, frame=%u, scanline=%u", |
154 | __get_str(dev), pipe_name(__entry->pipe), | |
fd2b94a5 JN |
155 | __entry->frame, __entry->scanline) |
156 | ); | |
157 | ||
158 | TRACE_EVENT(intel_memory_cxsr, | |
159 | TP_PROTO(struct drm_i915_private *dev_priv, bool old, bool new), | |
160 | TP_ARGS(dev_priv, old, new), | |
161 | ||
162 | TP_STRUCT__entry( | |
6b3960b1 | 163 | __string(dev, __dev_name_i915(dev_priv)) |
fd2b94a5 JN |
164 | __array(u32, frame, 3) |
165 | __array(u32, scanline, 3) | |
166 | __field(bool, old) | |
167 | __field(bool, new) | |
168 | ), | |
169 | ||
170 | TP_fast_assign( | |
171 | struct intel_crtc *crtc; | |
2c92ca84 | 172 | __assign_str(dev); |
fd2b94a5 JN |
173 | for_each_intel_crtc(&dev_priv->drm, crtc) { |
174 | __entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc); | |
175 | __entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc); | |
176 | } | |
177 | __entry->old = old; | |
178 | __entry->new = new; | |
179 | ), | |
180 | ||
6b3960b1 VS |
181 | TP_printk("dev %s, cxsr %s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u", |
182 | __get_str(dev), str_on_off(__entry->old), str_on_off(__entry->new), | |
fd2b94a5 JN |
183 | __entry->frame[PIPE_A], __entry->scanline[PIPE_A], |
184 | __entry->frame[PIPE_B], __entry->scanline[PIPE_B], | |
185 | __entry->frame[PIPE_C], __entry->scanline[PIPE_C]) | |
186 | ); | |
187 | ||
188 | TRACE_EVENT(g4x_wm, | |
189 | TP_PROTO(struct intel_crtc *crtc, const struct g4x_wm_values *wm), | |
190 | TP_ARGS(crtc, wm), | |
191 | ||
192 | TP_STRUCT__entry( | |
6b3960b1 | 193 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
194 | __field(enum pipe, pipe) |
195 | __field(u32, frame) | |
196 | __field(u32, scanline) | |
197 | __field(u16, primary) | |
198 | __field(u16, sprite) | |
199 | __field(u16, cursor) | |
200 | __field(u16, sr_plane) | |
201 | __field(u16, sr_cursor) | |
202 | __field(u16, sr_fbc) | |
203 | __field(u16, hpll_plane) | |
204 | __field(u16, hpll_cursor) | |
205 | __field(u16, hpll_fbc) | |
206 | __field(bool, cxsr) | |
207 | __field(bool, hpll) | |
208 | __field(bool, fbc) | |
209 | ), | |
210 | ||
211 | TP_fast_assign( | |
2c92ca84 | 212 | __assign_str(dev); |
fd2b94a5 JN |
213 | __entry->pipe = crtc->pipe; |
214 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
215 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
216 | __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY]; | |
217 | __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0]; | |
218 | __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR]; | |
219 | __entry->sr_plane = wm->sr.plane; | |
220 | __entry->sr_cursor = wm->sr.cursor; | |
221 | __entry->sr_fbc = wm->sr.fbc; | |
222 | __entry->hpll_plane = wm->hpll.plane; | |
223 | __entry->hpll_cursor = wm->hpll.cursor; | |
224 | __entry->hpll_fbc = wm->hpll.fbc; | |
225 | __entry->cxsr = wm->cxsr; | |
226 | __entry->hpll = wm->hpll_en; | |
227 | __entry->fbc = wm->fbc_en; | |
228 | ), | |
229 | ||
6b3960b1 VS |
230 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, wm %d/%d/%d, sr %s/%d/%d/%d, hpll %s/%d/%d/%d, fbc %s", |
231 | __get_str(dev), pipe_name(__entry->pipe), | |
232 | __entry->frame, __entry->scanline, | |
fd2b94a5 | 233 | __entry->primary, __entry->sprite, __entry->cursor, |
01fabda8 LDM |
234 | str_yes_no(__entry->cxsr), __entry->sr_plane, __entry->sr_cursor, __entry->sr_fbc, |
235 | str_yes_no(__entry->hpll), __entry->hpll_plane, __entry->hpll_cursor, __entry->hpll_fbc, | |
236 | str_yes_no(__entry->fbc)) | |
fd2b94a5 JN |
237 | ); |
238 | ||
239 | TRACE_EVENT(vlv_wm, | |
240 | TP_PROTO(struct intel_crtc *crtc, const struct vlv_wm_values *wm), | |
241 | TP_ARGS(crtc, wm), | |
242 | ||
243 | TP_STRUCT__entry( | |
6b3960b1 | 244 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
245 | __field(enum pipe, pipe) |
246 | __field(u32, frame) | |
247 | __field(u32, scanline) | |
248 | __field(u32, level) | |
249 | __field(u32, cxsr) | |
250 | __field(u32, primary) | |
251 | __field(u32, sprite0) | |
252 | __field(u32, sprite1) | |
253 | __field(u32, cursor) | |
254 | __field(u32, sr_plane) | |
255 | __field(u32, sr_cursor) | |
256 | ), | |
257 | ||
258 | TP_fast_assign( | |
2c92ca84 | 259 | __assign_str(dev); |
fd2b94a5 JN |
260 | __entry->pipe = crtc->pipe; |
261 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
262 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
263 | __entry->level = wm->level; | |
264 | __entry->cxsr = wm->cxsr; | |
265 | __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY]; | |
266 | __entry->sprite0 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0]; | |
267 | __entry->sprite1 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE1]; | |
268 | __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR]; | |
269 | __entry->sr_plane = wm->sr.plane; | |
270 | __entry->sr_cursor = wm->sr.cursor; | |
271 | ), | |
272 | ||
6b3960b1 VS |
273 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d", |
274 | __get_str(dev), pipe_name(__entry->pipe), | |
275 | __entry->frame, __entry->scanline, | |
276 | __entry->level, __entry->cxsr, | |
fd2b94a5 JN |
277 | __entry->primary, __entry->sprite0, __entry->sprite1, __entry->cursor, |
278 | __entry->sr_plane, __entry->sr_cursor) | |
279 | ); | |
280 | ||
281 | TRACE_EVENT(vlv_fifo_size, | |
282 | TP_PROTO(struct intel_crtc *crtc, u32 sprite0_start, u32 sprite1_start, u32 fifo_size), | |
283 | TP_ARGS(crtc, sprite0_start, sprite1_start, fifo_size), | |
284 | ||
285 | TP_STRUCT__entry( | |
6b3960b1 | 286 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
287 | __field(enum pipe, pipe) |
288 | __field(u32, frame) | |
289 | __field(u32, scanline) | |
290 | __field(u32, sprite0_start) | |
291 | __field(u32, sprite1_start) | |
292 | __field(u32, fifo_size) | |
293 | ), | |
294 | ||
295 | TP_fast_assign( | |
2c92ca84 | 296 | __assign_str(dev); |
fd2b94a5 JN |
297 | __entry->pipe = crtc->pipe; |
298 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
299 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
300 | __entry->sprite0_start = sprite0_start; | |
301 | __entry->sprite1_start = sprite1_start; | |
302 | __entry->fifo_size = fifo_size; | |
303 | ), | |
304 | ||
6b3960b1 VS |
305 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, %d/%d/%d", |
306 | __get_str(dev), pipe_name(__entry->pipe), | |
307 | __entry->frame, __entry->scanline, | |
308 | __entry->sprite0_start, __entry->sprite1_start, __entry->fifo_size) | |
fd2b94a5 JN |
309 | ); |
310 | ||
311 | TRACE_EVENT(intel_plane_update_noarm, | |
b5423d1f | 312 | TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc), |
fd2b94a5 JN |
313 | TP_ARGS(plane, crtc), |
314 | ||
315 | TP_STRUCT__entry( | |
6b3960b1 | 316 | __string(dev, __dev_name_kms(plane)) |
fd2b94a5 JN |
317 | __field(enum pipe, pipe) |
318 | __field(u32, frame) | |
319 | __field(u32, scanline) | |
320 | __array(int, src, 4) | |
321 | __array(int, dst, 4) | |
b5423d1f | 322 | __string(name, plane->base.name) |
fd2b94a5 JN |
323 | ), |
324 | ||
325 | TP_fast_assign( | |
2c92ca84 SRG |
326 | __assign_str(dev); |
327 | __assign_str(name); | |
fd2b94a5 JN |
328 | __entry->pipe = crtc->pipe; |
329 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
330 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
b5423d1f VS |
331 | memcpy(__entry->src, &plane->base.state->src, sizeof(__entry->src)); |
332 | memcpy(__entry->dst, &plane->base.state->dst, sizeof(__entry->dst)); | |
fd2b94a5 JN |
333 | ), |
334 | ||
6b3960b1 VS |
335 | TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT, |
336 | __get_str(dev), pipe_name(__entry->pipe), __get_str(name), | |
fd2b94a5 JN |
337 | __entry->frame, __entry->scanline, |
338 | DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src), | |
339 | DRM_RECT_ARG((const struct drm_rect *)__entry->dst)) | |
340 | ); | |
341 | ||
342 | TRACE_EVENT(intel_plane_update_arm, | |
b5423d1f | 343 | TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc), |
fd2b94a5 JN |
344 | TP_ARGS(plane, crtc), |
345 | ||
346 | TP_STRUCT__entry( | |
6b3960b1 | 347 | __string(dev, __dev_name_kms(plane)) |
fd2b94a5 JN |
348 | __field(enum pipe, pipe) |
349 | __field(u32, frame) | |
350 | __field(u32, scanline) | |
351 | __array(int, src, 4) | |
352 | __array(int, dst, 4) | |
b5423d1f | 353 | __string(name, plane->base.name) |
fd2b94a5 JN |
354 | ), |
355 | ||
356 | TP_fast_assign( | |
2c92ca84 SRG |
357 | __assign_str(dev); |
358 | __assign_str(name); | |
fd2b94a5 JN |
359 | __entry->pipe = crtc->pipe; |
360 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
361 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
b5423d1f VS |
362 | memcpy(__entry->src, &plane->base.state->src, sizeof(__entry->src)); |
363 | memcpy(__entry->dst, &plane->base.state->dst, sizeof(__entry->dst)); | |
fd2b94a5 JN |
364 | ), |
365 | ||
6b3960b1 VS |
366 | TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT, |
367 | __get_str(dev), pipe_name(__entry->pipe), __get_str(name), | |
fd2b94a5 JN |
368 | __entry->frame, __entry->scanline, |
369 | DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src), | |
370 | DRM_RECT_ARG((const struct drm_rect *)__entry->dst)) | |
371 | ); | |
372 | ||
373 | TRACE_EVENT(intel_plane_disable_arm, | |
b5423d1f | 374 | TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc), |
fd2b94a5 JN |
375 | TP_ARGS(plane, crtc), |
376 | ||
377 | TP_STRUCT__entry( | |
6b3960b1 | 378 | __string(dev, __dev_name_kms(plane)) |
fd2b94a5 JN |
379 | __field(enum pipe, pipe) |
380 | __field(u32, frame) | |
381 | __field(u32, scanline) | |
b5423d1f | 382 | __string(name, plane->base.name) |
fd2b94a5 JN |
383 | ), |
384 | ||
385 | TP_fast_assign( | |
2c92ca84 SRG |
386 | __assign_str(dev); |
387 | __assign_str(name); | |
fd2b94a5 JN |
388 | __entry->pipe = crtc->pipe; |
389 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
390 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
391 | ), | |
392 | ||
6b3960b1 VS |
393 | TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u", |
394 | __get_str(dev), pipe_name(__entry->pipe), __get_str(name), | |
fd2b94a5 JN |
395 | __entry->frame, __entry->scanline) |
396 | ); | |
397 | ||
398 | TRACE_EVENT(intel_fbc_activate, | |
399 | TP_PROTO(struct intel_plane *plane), | |
400 | TP_ARGS(plane), | |
401 | ||
402 | TP_STRUCT__entry( | |
6b3960b1 | 403 | __string(dev, __dev_name_kms(plane)) |
2ceea5d8 | 404 | __string(name, plane->base.name) |
fd2b94a5 JN |
405 | __field(enum pipe, pipe) |
406 | __field(u32, frame) | |
407 | __field(u32, scanline) | |
408 | ), | |
409 | ||
410 | TP_fast_assign( | |
411 | struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), | |
412 | plane->pipe); | |
2c92ca84 SRG |
413 | __assign_str(dev); |
414 | __assign_str(name); | |
fd2b94a5 JN |
415 | __entry->pipe = crtc->pipe; |
416 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
417 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
418 | ), | |
419 | ||
6b3960b1 VS |
420 | TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u", |
421 | __get_str(dev), pipe_name(__entry->pipe), __get_str(name), | |
2ceea5d8 | 422 | __entry->frame, __entry->scanline) |
fd2b94a5 JN |
423 | ); |
424 | ||
425 | TRACE_EVENT(intel_fbc_deactivate, | |
426 | TP_PROTO(struct intel_plane *plane), | |
427 | TP_ARGS(plane), | |
428 | ||
429 | TP_STRUCT__entry( | |
6b3960b1 | 430 | __string(dev, __dev_name_kms(plane)) |
2ceea5d8 | 431 | __string(name, plane->base.name) |
fd2b94a5 JN |
432 | __field(enum pipe, pipe) |
433 | __field(u32, frame) | |
434 | __field(u32, scanline) | |
435 | ), | |
436 | ||
437 | TP_fast_assign( | |
438 | struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), | |
439 | plane->pipe); | |
2c92ca84 SRG |
440 | __assign_str(dev); |
441 | __assign_str(name); | |
fd2b94a5 JN |
442 | __entry->pipe = crtc->pipe; |
443 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
444 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
445 | ), | |
446 | ||
6b3960b1 VS |
447 | TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u", |
448 | __get_str(dev), pipe_name(__entry->pipe), __get_str(name), | |
2ceea5d8 | 449 | __entry->frame, __entry->scanline) |
fd2b94a5 JN |
450 | ); |
451 | ||
452 | TRACE_EVENT(intel_fbc_nuke, | |
453 | TP_PROTO(struct intel_plane *plane), | |
454 | TP_ARGS(plane), | |
455 | ||
456 | TP_STRUCT__entry( | |
6b3960b1 | 457 | __string(dev, __dev_name_kms(plane)) |
2ceea5d8 | 458 | __string(name, plane->base.name) |
fd2b94a5 JN |
459 | __field(enum pipe, pipe) |
460 | __field(u32, frame) | |
461 | __field(u32, scanline) | |
462 | ), | |
463 | ||
464 | TP_fast_assign( | |
465 | struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), | |
466 | plane->pipe); | |
2c92ca84 SRG |
467 | __assign_str(dev); |
468 | __assign_str(name); | |
fd2b94a5 JN |
469 | __entry->pipe = crtc->pipe; |
470 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
471 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
472 | ), | |
473 | ||
6b3960b1 VS |
474 | TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u", |
475 | __get_str(dev), pipe_name(__entry->pipe), __get_str(name), | |
2ceea5d8 | 476 | __entry->frame, __entry->scanline) |
fd2b94a5 JN |
477 | ); |
478 | ||
479 | TRACE_EVENT(intel_crtc_vblank_work_start, | |
480 | TP_PROTO(struct intel_crtc *crtc), | |
481 | TP_ARGS(crtc), | |
482 | ||
483 | TP_STRUCT__entry( | |
6b3960b1 | 484 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
485 | __field(enum pipe, pipe) |
486 | __field(u32, frame) | |
487 | __field(u32, scanline) | |
488 | ), | |
489 | ||
490 | TP_fast_assign( | |
2c92ca84 | 491 | __assign_str(dev); |
fd2b94a5 JN |
492 | __entry->pipe = crtc->pipe; |
493 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
494 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
495 | ), | |
496 | ||
6b3960b1 VS |
497 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u", |
498 | __get_str(dev), pipe_name(__entry->pipe), | |
499 | __entry->frame, __entry->scanline) | |
fd2b94a5 JN |
500 | ); |
501 | ||
502 | TRACE_EVENT(intel_crtc_vblank_work_end, | |
503 | TP_PROTO(struct intel_crtc *crtc), | |
504 | TP_ARGS(crtc), | |
505 | ||
506 | TP_STRUCT__entry( | |
6b3960b1 | 507 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
508 | __field(enum pipe, pipe) |
509 | __field(u32, frame) | |
510 | __field(u32, scanline) | |
511 | ), | |
512 | ||
513 | TP_fast_assign( | |
2c92ca84 | 514 | __assign_str(dev); |
fd2b94a5 JN |
515 | __entry->pipe = crtc->pipe; |
516 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
517 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
518 | ), | |
519 | ||
6b3960b1 VS |
520 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u", |
521 | __get_str(dev), pipe_name(__entry->pipe), | |
522 | __entry->frame, __entry->scanline) | |
fd2b94a5 JN |
523 | ); |
524 | ||
525 | TRACE_EVENT(intel_pipe_update_start, | |
526 | TP_PROTO(struct intel_crtc *crtc), | |
527 | TP_ARGS(crtc), | |
528 | ||
529 | TP_STRUCT__entry( | |
6b3960b1 | 530 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
531 | __field(enum pipe, pipe) |
532 | __field(u32, frame) | |
533 | __field(u32, scanline) | |
534 | __field(u32, min) | |
535 | __field(u32, max) | |
536 | ), | |
537 | ||
538 | TP_fast_assign( | |
2c92ca84 | 539 | __assign_str(dev); |
fd2b94a5 JN |
540 | __entry->pipe = crtc->pipe; |
541 | __entry->frame = intel_crtc_get_vblank_counter(crtc); | |
542 | __entry->scanline = intel_get_crtc_scanline(crtc); | |
543 | __entry->min = crtc->debug.min_vbl; | |
544 | __entry->max = crtc->debug.max_vbl; | |
545 | ), | |
546 | ||
6b3960b1 VS |
547 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, min=%u, max=%u", |
548 | __get_str(dev), pipe_name(__entry->pipe), | |
549 | __entry->frame, __entry->scanline, | |
550 | __entry->min, __entry->max) | |
fd2b94a5 JN |
551 | ); |
552 | ||
553 | TRACE_EVENT(intel_pipe_update_vblank_evaded, | |
554 | TP_PROTO(struct intel_crtc *crtc), | |
555 | TP_ARGS(crtc), | |
556 | ||
557 | TP_STRUCT__entry( | |
6b3960b1 | 558 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
559 | __field(enum pipe, pipe) |
560 | __field(u32, frame) | |
561 | __field(u32, scanline) | |
562 | __field(u32, min) | |
563 | __field(u32, max) | |
564 | ), | |
565 | ||
566 | TP_fast_assign( | |
2c92ca84 | 567 | __assign_str(dev); |
fd2b94a5 JN |
568 | __entry->pipe = crtc->pipe; |
569 | __entry->frame = crtc->debug.start_vbl_count; | |
570 | __entry->scanline = crtc->debug.scanline_start; | |
571 | __entry->min = crtc->debug.min_vbl; | |
572 | __entry->max = crtc->debug.max_vbl; | |
573 | ), | |
574 | ||
6b3960b1 VS |
575 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, min=%u, max=%u", |
576 | __get_str(dev), pipe_name(__entry->pipe), | |
577 | __entry->frame, __entry->scanline, | |
578 | __entry->min, __entry->max) | |
fd2b94a5 JN |
579 | ); |
580 | ||
581 | TRACE_EVENT(intel_pipe_update_end, | |
582 | TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end), | |
583 | TP_ARGS(crtc, frame, scanline_end), | |
584 | ||
585 | TP_STRUCT__entry( | |
6b3960b1 | 586 | __string(dev, __dev_name_kms(crtc)) |
fd2b94a5 JN |
587 | __field(enum pipe, pipe) |
588 | __field(u32, frame) | |
589 | __field(u32, scanline) | |
590 | ), | |
591 | ||
592 | TP_fast_assign( | |
2c92ca84 | 593 | __assign_str(dev); |
fd2b94a5 JN |
594 | __entry->pipe = crtc->pipe; |
595 | __entry->frame = frame; | |
596 | __entry->scanline = scanline_end; | |
597 | ), | |
598 | ||
6b3960b1 VS |
599 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u", |
600 | __get_str(dev), pipe_name(__entry->pipe), | |
601 | __entry->frame, __entry->scanline) | |
fd2b94a5 JN |
602 | ); |
603 | ||
604 | TRACE_EVENT(intel_frontbuffer_invalidate, | |
44aad8d0 VS |
605 | TP_PROTO(struct drm_i915_private *i915, |
606 | unsigned int frontbuffer_bits, unsigned int origin), | |
607 | TP_ARGS(i915, frontbuffer_bits, origin), | |
fd2b94a5 JN |
608 | |
609 | TP_STRUCT__entry( | |
6b3960b1 | 610 | __string(dev, __dev_name_i915(i915)) |
fd2b94a5 JN |
611 | __field(unsigned int, frontbuffer_bits) |
612 | __field(unsigned int, origin) | |
613 | ), | |
614 | ||
615 | TP_fast_assign( | |
2c92ca84 | 616 | __assign_str(dev); |
fd2b94a5 JN |
617 | __entry->frontbuffer_bits = frontbuffer_bits; |
618 | __entry->origin = origin; | |
619 | ), | |
620 | ||
6b3960b1 VS |
621 | TP_printk("dev %s, frontbuffer_bits=0x%08x, origin=%u", |
622 | __get_str(dev), __entry->frontbuffer_bits, __entry->origin) | |
fd2b94a5 JN |
623 | ); |
624 | ||
625 | TRACE_EVENT(intel_frontbuffer_flush, | |
44aad8d0 VS |
626 | TP_PROTO(struct drm_i915_private *i915, |
627 | unsigned int frontbuffer_bits, unsigned int origin), | |
628 | TP_ARGS(i915, frontbuffer_bits, origin), | |
fd2b94a5 JN |
629 | |
630 | TP_STRUCT__entry( | |
6b3960b1 | 631 | __string(dev, __dev_name_i915(i915)) |
fd2b94a5 JN |
632 | __field(unsigned int, frontbuffer_bits) |
633 | __field(unsigned int, origin) | |
634 | ), | |
635 | ||
636 | TP_fast_assign( | |
2c92ca84 | 637 | __assign_str(dev); |
fd2b94a5 JN |
638 | __entry->frontbuffer_bits = frontbuffer_bits; |
639 | __entry->origin = origin; | |
640 | ), | |
641 | ||
6b3960b1 VS |
642 | TP_printk("dev %s, frontbuffer_bits=0x%08x, origin=%u", |
643 | __get_str(dev), __entry->frontbuffer_bits, __entry->origin) | |
fd2b94a5 JN |
644 | ); |
645 | ||
646 | #endif /* __INTEL_DISPLAY_TRACE_H__ */ | |
647 | ||
648 | /* This part must be outside protection */ | |
649 | #undef TRACE_INCLUDE_PATH | |
650 | #undef TRACE_INCLUDE_FILE | |
651 | #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display | |
652 | #define TRACE_INCLUDE_FILE intel_display_trace | |
653 | #include <trace/define_trace.h> |