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