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