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, __dev_name_kms(crtc));
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, __dev_name_kms(crtc));
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_pipe_crc,
82 	    TP_PROTO(struct intel_crtc *crtc, const u32 *crcs),
83 	    TP_ARGS(crtc, crcs),
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 			     __array(u32, crcs, 5)
91 			     ),
92 
93 	    TP_fast_assign(
94 			   __assign_str(dev, __dev_name_kms(crtc));
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 
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])
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(
114 			     __string(dev, __dev_name_i915(dev_priv))
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);
122 			   __assign_str(dev, __dev_name_kms(crtc));
123 			   __entry->pipe = pipe;
124 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
125 			   __entry->scanline = intel_get_crtc_scanline(crtc);
126 			   ),
127 
128 	    TP_printk("dev %s, pipe %c, frame=%u, scanline=%u",
129 		      __get_str(dev), pipe_name(__entry->pipe),
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(
138 			     __string(dev, __dev_name_i915(dev_priv))
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);
147 			   __assign_str(dev, __dev_name_i915(dev_priv));
148 			   __entry->pipe = pipe;
149 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
150 			   __entry->scanline = intel_get_crtc_scanline(crtc);
151 			   ),
152 
153 	    TP_printk("dev %s, pch transcoder %c, frame=%u, scanline=%u",
154 		      __get_str(dev), pipe_name(__entry->pipe),
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(
163 			     __string(dev, __dev_name_i915(dev_priv))
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;
172 			   __assign_str(dev, __dev_name_i915(dev_priv));
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 
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),
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(
193 			     __string(dev, __dev_name_kms(crtc))
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(
212 			   __assign_str(dev, __dev_name_kms(crtc));
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 
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,
233 		      __entry->primary, __entry->sprite, __entry->cursor,
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))
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(
244 			     __string(dev, __dev_name_kms(crtc))
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(
259 			   __assign_str(dev, __dev_name_kms(crtc));
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 
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,
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(
286 			     __string(dev, __dev_name_kms(crtc))
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(
296 			   __assign_str(dev, __dev_name_kms(crtc));
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 
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)
309 );
310 
311 TRACE_EVENT(intel_plane_update_noarm,
312 	    TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc),
313 	    TP_ARGS(plane, crtc),
314 
315 	    TP_STRUCT__entry(
316 			     __string(dev, __dev_name_kms(plane))
317 			     __field(enum pipe, pipe)
318 			     __field(u32, frame)
319 			     __field(u32, scanline)
320 			     __array(int, src, 4)
321 			     __array(int, dst, 4)
322 			     __string(name, plane->base.name)
323 			     ),
324 
325 	    TP_fast_assign(
326 			   __assign_str(dev, __dev_name_kms(plane));
327 			   __assign_str(name, plane->base.name);
328 			   __entry->pipe = crtc->pipe;
329 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
330 			   __entry->scanline = intel_get_crtc_scanline(crtc);
331 			   memcpy(__entry->src, &plane->base.state->src, sizeof(__entry->src));
332 			   memcpy(__entry->dst, &plane->base.state->dst, sizeof(__entry->dst));
333 			   ),
334 
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),
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,
343 	    TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc),
344 	    TP_ARGS(plane, crtc),
345 
346 	    TP_STRUCT__entry(
347 			     __string(dev, __dev_name_kms(plane))
348 			     __field(enum pipe, pipe)
349 			     __field(u32, frame)
350 			     __field(u32, scanline)
351 			     __array(int, src, 4)
352 			     __array(int, dst, 4)
353 			     __string(name, plane->base.name)
354 			     ),
355 
356 	    TP_fast_assign(
357 			   __assign_str(dev, __dev_name_kms(plane));
358 			   __assign_str(name, plane->base.name);
359 			   __entry->pipe = crtc->pipe;
360 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
361 			   __entry->scanline = intel_get_crtc_scanline(crtc);
362 			   memcpy(__entry->src, &plane->base.state->src, sizeof(__entry->src));
363 			   memcpy(__entry->dst, &plane->base.state->dst, sizeof(__entry->dst));
364 			   ),
365 
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),
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,
374 	    TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc),
375 	    TP_ARGS(plane, crtc),
376 
377 	    TP_STRUCT__entry(
378 			     __string(dev, __dev_name_kms(plane))
379 			     __field(enum pipe, pipe)
380 			     __field(u32, frame)
381 			     __field(u32, scanline)
382 			     __string(name, plane->base.name)
383 			     ),
384 
385 	    TP_fast_assign(
386 			   __assign_str(dev, __dev_name_kms(plane));
387 			   __assign_str(name, plane->base.name);
388 			   __entry->pipe = crtc->pipe;
389 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
390 			   __entry->scanline = intel_get_crtc_scanline(crtc);
391 			   ),
392 
393 	    TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u",
394 		      __get_str(dev), pipe_name(__entry->pipe), __get_str(name),
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(
403 			     __string(dev, __dev_name_kms(plane))
404 			     __string(name, plane->base.name)
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);
413 			   __assign_str(dev, __dev_name_kms(plane));
414 			   __assign_str(name, plane->base.name);
415 			   __entry->pipe = crtc->pipe;
416 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
417 			   __entry->scanline = intel_get_crtc_scanline(crtc);
418 			   ),
419 
420 	    TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u",
421 		      __get_str(dev), pipe_name(__entry->pipe), __get_str(name),
422 		      __entry->frame, __entry->scanline)
423 );
424 
425 TRACE_EVENT(intel_fbc_deactivate,
426 	    TP_PROTO(struct intel_plane *plane),
427 	    TP_ARGS(plane),
428 
429 	    TP_STRUCT__entry(
430 			     __string(dev, __dev_name_kms(plane))
431 			     __string(name, plane->base.name)
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);
440 			   __assign_str(dev, __dev_name_kms(plane));
441 			   __assign_str(name, plane->base.name);
442 			   __entry->pipe = crtc->pipe;
443 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
444 			   __entry->scanline = intel_get_crtc_scanline(crtc);
445 			   ),
446 
447 	    TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u",
448 		      __get_str(dev), pipe_name(__entry->pipe), __get_str(name),
449 		      __entry->frame, __entry->scanline)
450 );
451 
452 TRACE_EVENT(intel_fbc_nuke,
453 	    TP_PROTO(struct intel_plane *plane),
454 	    TP_ARGS(plane),
455 
456 	    TP_STRUCT__entry(
457 			     __string(dev, __dev_name_kms(plane))
458 			     __string(name, plane->base.name)
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);
467 			   __assign_str(dev, __dev_name_kms(plane));
468 			   __assign_str(name, plane->base.name);
469 			   __entry->pipe = crtc->pipe;
470 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
471 			   __entry->scanline = intel_get_crtc_scanline(crtc);
472 			   ),
473 
474 	    TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u",
475 		      __get_str(dev), pipe_name(__entry->pipe), __get_str(name),
476 		      __entry->frame, __entry->scanline)
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(
484 			     __string(dev, __dev_name_kms(crtc))
485 			     __field(enum pipe, pipe)
486 			     __field(u32, frame)
487 			     __field(u32, scanline)
488 			     ),
489 
490 	    TP_fast_assign(
491 			   __assign_str(dev, __dev_name_kms(crtc));
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, frame=%u, scanline=%u",
498 		      __get_str(dev), pipe_name(__entry->pipe),
499 		      __entry->frame, __entry->scanline)
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(
507 			     __string(dev, __dev_name_kms(crtc))
508 			     __field(enum pipe, pipe)
509 			     __field(u32, frame)
510 			     __field(u32, scanline)
511 			     ),
512 
513 	    TP_fast_assign(
514 			   __assign_str(dev, __dev_name_kms(crtc));
515 			   __entry->pipe = crtc->pipe;
516 			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
517 			   __entry->scanline = intel_get_crtc_scanline(crtc);
518 			   ),
519 
520 	    TP_printk("dev %s, pipe %c, frame=%u, scanline=%u",
521 		      __get_str(dev), pipe_name(__entry->pipe),
522 		      __entry->frame, __entry->scanline)
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(
530 			     __string(dev, __dev_name_kms(crtc))
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(
539 			   __assign_str(dev, __dev_name_kms(crtc));
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 
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)
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(
558 			     __string(dev, __dev_name_kms(crtc))
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(
567 			   __assign_str(dev, __dev_name_kms(crtc));
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 
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)
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(
586 			     __string(dev, __dev_name_kms(crtc))
587 			     __field(enum pipe, pipe)
588 			     __field(u32, frame)
589 			     __field(u32, scanline)
590 			     ),
591 
592 	    TP_fast_assign(
593 			   __assign_str(dev, __dev_name_kms(crtc));
594 			   __entry->pipe = crtc->pipe;
595 			   __entry->frame = frame;
596 			   __entry->scanline = scanline_end;
597 			   ),
598 
599 	    TP_printk("dev %s, pipe %c, frame=%u, scanline=%u",
600 		      __get_str(dev), pipe_name(__entry->pipe),
601 		      __entry->frame, __entry->scanline)
602 );
603 
604 TRACE_EVENT(intel_frontbuffer_invalidate,
605 	    TP_PROTO(struct drm_i915_private *i915,
606 		     unsigned int frontbuffer_bits, unsigned int origin),
607 	    TP_ARGS(i915, frontbuffer_bits, origin),
608 
609 	    TP_STRUCT__entry(
610 			     __string(dev, __dev_name_i915(i915))
611 			     __field(unsigned int, frontbuffer_bits)
612 			     __field(unsigned int, origin)
613 			     ),
614 
615 	    TP_fast_assign(
616 			   __assign_str(dev, __dev_name_i915(i915));
617 			   __entry->frontbuffer_bits = frontbuffer_bits;
618 			   __entry->origin = origin;
619 			   ),
620 
621 	    TP_printk("dev %s, frontbuffer_bits=0x%08x, origin=%u",
622 		      __get_str(dev), __entry->frontbuffer_bits, __entry->origin)
623 );
624 
625 TRACE_EVENT(intel_frontbuffer_flush,
626 	    TP_PROTO(struct drm_i915_private *i915,
627 		     unsigned int frontbuffer_bits, unsigned int origin),
628 	    TP_ARGS(i915, frontbuffer_bits, origin),
629 
630 	    TP_STRUCT__entry(
631 			     __string(dev, __dev_name_i915(i915))
632 			     __field(unsigned int, frontbuffer_bits)
633 			     __field(unsigned int, origin)
634 			     ),
635 
636 	    TP_fast_assign(
637 			   __assign_str(dev, __dev_name_i915(i915));
638 			   __entry->frontbuffer_bits = frontbuffer_bits;
639 			   __entry->origin = origin;
640 			   ),
641 
642 	    TP_printk("dev %s, frontbuffer_bits=0x%08x, origin=%u",
643 		      __get_str(dev), __entry->frontbuffer_bits, __entry->origin)
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>
654