Merge drm/drm-next into drm-intel-next
[platform/kernel/linux-rpi.git] / drivers / gpu / drm / i915 / i915_trace.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
3 #define _I915_TRACE_H_
4
5 #include <linux/stringify.h>
6 #include <linux/types.h>
7 #include <linux/tracepoint.h>
8
9 #include <drm/drm_drv.h>
10
11 #include "display/intel_crtc.h"
12 #include "display/intel_display_types.h"
13 #include "gt/intel_engine.h"
14
15 #include "i915_drv.h"
16 #include "i915_irq.h"
17
18 #undef TRACE_SYSTEM
19 #define TRACE_SYSTEM i915
20 #define TRACE_INCLUDE_FILE i915_trace
21
22 /* watermark/fifo updates */
23
24 TRACE_EVENT(intel_pipe_enable,
25             TP_PROTO(struct intel_crtc *crtc),
26             TP_ARGS(crtc),
27
28             TP_STRUCT__entry(
29                              __array(u32, frame, 3)
30                              __array(u32, scanline, 3)
31                              __field(enum pipe, pipe)
32                              ),
33             TP_fast_assign(
34                            struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
35                            struct intel_crtc *it__;
36                            for_each_intel_crtc(&dev_priv->drm, it__) {
37                                    __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
38                                    __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
39                            }
40                            __entry->pipe = crtc->pipe;
41                            ),
42
43             TP_printk("pipe %c enable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
44                       pipe_name(__entry->pipe),
45                       __entry->frame[PIPE_A], __entry->scanline[PIPE_A],
46                       __entry->frame[PIPE_B], __entry->scanline[PIPE_B],
47                       __entry->frame[PIPE_C], __entry->scanline[PIPE_C])
48 );
49
50 TRACE_EVENT(intel_pipe_disable,
51             TP_PROTO(struct intel_crtc *crtc),
52             TP_ARGS(crtc),
53
54             TP_STRUCT__entry(
55                              __array(u32, frame, 3)
56                              __array(u32, scanline, 3)
57                              __field(enum pipe, pipe)
58                              ),
59
60             TP_fast_assign(
61                            struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
62                            struct intel_crtc *it__;
63                            for_each_intel_crtc(&dev_priv->drm, it__) {
64                                    __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
65                                    __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
66                            }
67                            __entry->pipe = crtc->pipe;
68                            ),
69
70             TP_printk("pipe %c disable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
71                       pipe_name(__entry->pipe),
72                       __entry->frame[PIPE_A], __entry->scanline[PIPE_A],
73                       __entry->frame[PIPE_B], __entry->scanline[PIPE_B],
74                       __entry->frame[PIPE_C], __entry->scanline[PIPE_C])
75 );
76
77 TRACE_EVENT(intel_pipe_crc,
78             TP_PROTO(struct intel_crtc *crtc, const u32 *crcs),
79             TP_ARGS(crtc, crcs),
80
81             TP_STRUCT__entry(
82                              __field(enum pipe, pipe)
83                              __field(u32, frame)
84                              __field(u32, scanline)
85                              __array(u32, crcs, 5)
86                              ),
87
88             TP_fast_assign(
89                            __entry->pipe = crtc->pipe;
90                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
91                            __entry->scanline = intel_get_crtc_scanline(crtc);
92                            memcpy(__entry->crcs, crcs, sizeof(__entry->crcs));
93                            ),
94
95             TP_printk("pipe %c, frame=%u, scanline=%u crc=%08x %08x %08x %08x %08x",
96                       pipe_name(__entry->pipe), __entry->frame, __entry->scanline,
97                       __entry->crcs[0], __entry->crcs[1], __entry->crcs[2],
98                       __entry->crcs[3], __entry->crcs[4])
99 );
100
101 TRACE_EVENT(intel_cpu_fifo_underrun,
102             TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),
103             TP_ARGS(dev_priv, pipe),
104
105             TP_STRUCT__entry(
106                              __field(enum pipe, pipe)
107                              __field(u32, frame)
108                              __field(u32, scanline)
109                              ),
110
111             TP_fast_assign(
112                             struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
113                            __entry->pipe = pipe;
114                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
115                            __entry->scanline = intel_get_crtc_scanline(crtc);
116                            ),
117
118             TP_printk("pipe %c, frame=%u, scanline=%u",
119                       pipe_name(__entry->pipe),
120                       __entry->frame, __entry->scanline)
121 );
122
123 TRACE_EVENT(intel_pch_fifo_underrun,
124             TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pch_transcoder),
125             TP_ARGS(dev_priv, pch_transcoder),
126
127             TP_STRUCT__entry(
128                              __field(enum pipe, pipe)
129                              __field(u32, frame)
130                              __field(u32, scanline)
131                              ),
132
133             TP_fast_assign(
134                            enum pipe pipe = pch_transcoder;
135                            struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
136                            __entry->pipe = pipe;
137                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
138                            __entry->scanline = intel_get_crtc_scanline(crtc);
139                            ),
140
141             TP_printk("pch transcoder %c, frame=%u, scanline=%u",
142                       pipe_name(__entry->pipe),
143                       __entry->frame, __entry->scanline)
144 );
145
146 TRACE_EVENT(intel_memory_cxsr,
147             TP_PROTO(struct drm_i915_private *dev_priv, bool old, bool new),
148             TP_ARGS(dev_priv, old, new),
149
150             TP_STRUCT__entry(
151                              __array(u32, frame, 3)
152                              __array(u32, scanline, 3)
153                              __field(bool, old)
154                              __field(bool, new)
155                              ),
156
157             TP_fast_assign(
158                            struct intel_crtc *crtc;
159                            for_each_intel_crtc(&dev_priv->drm, crtc) {
160                                    __entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc);
161                                    __entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc);
162                            }
163                            __entry->old = old;
164                            __entry->new = new;
165                            ),
166
167             TP_printk("%s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
168                       onoff(__entry->old), onoff(__entry->new),
169                       __entry->frame[PIPE_A], __entry->scanline[PIPE_A],
170                       __entry->frame[PIPE_B], __entry->scanline[PIPE_B],
171                       __entry->frame[PIPE_C], __entry->scanline[PIPE_C])
172 );
173
174 TRACE_EVENT(g4x_wm,
175             TP_PROTO(struct intel_crtc *crtc, const struct g4x_wm_values *wm),
176             TP_ARGS(crtc, wm),
177
178             TP_STRUCT__entry(
179                              __field(enum pipe, pipe)
180                              __field(u32, frame)
181                              __field(u32, scanline)
182                              __field(u16, primary)
183                              __field(u16, sprite)
184                              __field(u16, cursor)
185                              __field(u16, sr_plane)
186                              __field(u16, sr_cursor)
187                              __field(u16, sr_fbc)
188                              __field(u16, hpll_plane)
189                              __field(u16, hpll_cursor)
190                              __field(u16, hpll_fbc)
191                              __field(bool, cxsr)
192                              __field(bool, hpll)
193                              __field(bool, fbc)
194                              ),
195
196             TP_fast_assign(
197                            __entry->pipe = crtc->pipe;
198                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
199                            __entry->scanline = intel_get_crtc_scanline(crtc);
200                            __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
201                            __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
202                            __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
203                            __entry->sr_plane = wm->sr.plane;
204                            __entry->sr_cursor = wm->sr.cursor;
205                            __entry->sr_fbc = wm->sr.fbc;
206                            __entry->hpll_plane = wm->hpll.plane;
207                            __entry->hpll_cursor = wm->hpll.cursor;
208                            __entry->hpll_fbc = wm->hpll.fbc;
209                            __entry->cxsr = wm->cxsr;
210                            __entry->hpll = wm->hpll_en;
211                            __entry->fbc = wm->fbc_en;
212                            ),
213
214             TP_printk("pipe %c, frame=%u, scanline=%u, wm %d/%d/%d, sr %s/%d/%d/%d, hpll %s/%d/%d/%d, fbc %s",
215                       pipe_name(__entry->pipe), __entry->frame, __entry->scanline,
216                       __entry->primary, __entry->sprite, __entry->cursor,
217                       yesno(__entry->cxsr), __entry->sr_plane, __entry->sr_cursor, __entry->sr_fbc,
218                       yesno(__entry->hpll), __entry->hpll_plane, __entry->hpll_cursor, __entry->hpll_fbc,
219                       yesno(__entry->fbc))
220 );
221
222 TRACE_EVENT(vlv_wm,
223             TP_PROTO(struct intel_crtc *crtc, const struct vlv_wm_values *wm),
224             TP_ARGS(crtc, wm),
225
226             TP_STRUCT__entry(
227                              __field(enum pipe, pipe)
228                              __field(u32, frame)
229                              __field(u32, scanline)
230                              __field(u32, level)
231                              __field(u32, cxsr)
232                              __field(u32, primary)
233                              __field(u32, sprite0)
234                              __field(u32, sprite1)
235                              __field(u32, cursor)
236                              __field(u32, sr_plane)
237                              __field(u32, sr_cursor)
238                              ),
239
240             TP_fast_assign(
241                            __entry->pipe = crtc->pipe;
242                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
243                            __entry->scanline = intel_get_crtc_scanline(crtc);
244                            __entry->level = wm->level;
245                            __entry->cxsr = wm->cxsr;
246                            __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
247                            __entry->sprite0 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
248                            __entry->sprite1 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE1];
249                            __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
250                            __entry->sr_plane = wm->sr.plane;
251                            __entry->sr_cursor = wm->sr.cursor;
252                            ),
253
254             TP_printk("pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d",
255                       pipe_name(__entry->pipe), __entry->frame,
256                       __entry->scanline, __entry->level, __entry->cxsr,
257                       __entry->primary, __entry->sprite0, __entry->sprite1, __entry->cursor,
258                       __entry->sr_plane, __entry->sr_cursor)
259 );
260
261 TRACE_EVENT(vlv_fifo_size,
262             TP_PROTO(struct intel_crtc *crtc, u32 sprite0_start, u32 sprite1_start, u32 fifo_size),
263             TP_ARGS(crtc, sprite0_start, sprite1_start, fifo_size),
264
265             TP_STRUCT__entry(
266                              __field(enum pipe, pipe)
267                              __field(u32, frame)
268                              __field(u32, scanline)
269                              __field(u32, sprite0_start)
270                              __field(u32, sprite1_start)
271                              __field(u32, fifo_size)
272                              ),
273
274             TP_fast_assign(
275                            __entry->pipe = crtc->pipe;
276                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
277                            __entry->scanline = intel_get_crtc_scanline(crtc);
278                            __entry->sprite0_start = sprite0_start;
279                            __entry->sprite1_start = sprite1_start;
280                            __entry->fifo_size = fifo_size;
281                            ),
282
283             TP_printk("pipe %c, frame=%u, scanline=%u, %d/%d/%d",
284                       pipe_name(__entry->pipe), __entry->frame,
285                       __entry->scanline, __entry->sprite0_start,
286                       __entry->sprite1_start, __entry->fifo_size)
287 );
288
289 /* plane updates */
290
291 TRACE_EVENT(intel_plane_update_noarm,
292             TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
293             TP_ARGS(plane, crtc),
294
295             TP_STRUCT__entry(
296                              __field(enum pipe, pipe)
297                              __field(u32, frame)
298                              __field(u32, scanline)
299                              __array(int, src, 4)
300                              __array(int, dst, 4)
301                              __string(name, plane->name)
302                              ),
303
304             TP_fast_assign(
305                            __assign_str(name, plane->name);
306                            __entry->pipe = crtc->pipe;
307                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
308                            __entry->scanline = intel_get_crtc_scanline(crtc);
309                            memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
310                            memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
311                            ),
312
313             TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
314                       pipe_name(__entry->pipe), __get_str(name),
315                       __entry->frame, __entry->scanline,
316                       DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
317                       DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
318 );
319
320 TRACE_EVENT(intel_plane_update_arm,
321             TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
322             TP_ARGS(plane, crtc),
323
324             TP_STRUCT__entry(
325                              __field(enum pipe, pipe)
326                              __field(u32, frame)
327                              __field(u32, scanline)
328                              __array(int, src, 4)
329                              __array(int, dst, 4)
330                              __string(name, plane->name)
331                              ),
332
333             TP_fast_assign(
334                            __assign_str(name, plane->name);
335                            __entry->pipe = crtc->pipe;
336                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
337                            __entry->scanline = intel_get_crtc_scanline(crtc);
338                            memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
339                            memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
340                            ),
341
342             TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
343                       pipe_name(__entry->pipe), __get_str(name),
344                       __entry->frame, __entry->scanline,
345                       DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
346                       DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
347 );
348
349 TRACE_EVENT(intel_plane_disable_arm,
350             TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
351             TP_ARGS(plane, crtc),
352
353             TP_STRUCT__entry(
354                              __field(enum pipe, pipe)
355                              __field(u32, frame)
356                              __field(u32, scanline)
357                              __string(name, plane->name)
358                              ),
359
360             TP_fast_assign(
361                            __assign_str(name, plane->name);
362                            __entry->pipe = crtc->pipe;
363                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
364                            __entry->scanline = intel_get_crtc_scanline(crtc);
365                            ),
366
367             TP_printk("pipe %c, plane %s, frame=%u, scanline=%u",
368                       pipe_name(__entry->pipe), __get_str(name),
369                       __entry->frame, __entry->scanline)
370 );
371
372 /* fbc */
373
374 TRACE_EVENT(intel_fbc_activate,
375             TP_PROTO(struct intel_crtc *crtc),
376             TP_ARGS(crtc),
377
378             TP_STRUCT__entry(
379                              __field(enum pipe, pipe)
380                              __field(u32, frame)
381                              __field(u32, scanline)
382                              ),
383
384             TP_fast_assign(
385                            __entry->pipe = crtc->pipe;
386                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
387                            __entry->scanline = intel_get_crtc_scanline(crtc);
388                            ),
389
390             TP_printk("pipe %c, frame=%u, scanline=%u",
391                       pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
392 );
393
394 TRACE_EVENT(intel_fbc_deactivate,
395             TP_PROTO(struct intel_crtc *crtc),
396             TP_ARGS(crtc),
397
398             TP_STRUCT__entry(
399                              __field(enum pipe, pipe)
400                              __field(u32, frame)
401                              __field(u32, scanline)
402                              ),
403
404             TP_fast_assign(
405                            __entry->pipe = crtc->pipe;
406                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
407                            __entry->scanline = intel_get_crtc_scanline(crtc);
408                            ),
409
410             TP_printk("pipe %c, frame=%u, scanline=%u",
411                       pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
412 );
413
414 TRACE_EVENT(intel_fbc_nuke,
415             TP_PROTO(struct intel_crtc *crtc),
416             TP_ARGS(crtc),
417
418             TP_STRUCT__entry(
419                              __field(enum pipe, pipe)
420                              __field(u32, frame)
421                              __field(u32, scanline)
422                              ),
423
424             TP_fast_assign(
425                            __entry->pipe = crtc->pipe;
426                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
427                            __entry->scanline = intel_get_crtc_scanline(crtc);
428                            ),
429
430             TP_printk("pipe %c, frame=%u, scanline=%u",
431                       pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
432 );
433
434 /* pipe updates */
435
436 TRACE_EVENT(intel_crtc_vblank_work_start,
437             TP_PROTO(struct intel_crtc *crtc),
438             TP_ARGS(crtc),
439
440             TP_STRUCT__entry(
441                              __field(enum pipe, pipe)
442                              __field(u32, frame)
443                              __field(u32, scanline)
444                              ),
445
446             TP_fast_assign(
447                            __entry->pipe = crtc->pipe;
448                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
449                            __entry->scanline = intel_get_crtc_scanline(crtc);
450                            ),
451
452             TP_printk("pipe %c, frame=%u, scanline=%u",
453                       pipe_name(__entry->pipe), __entry->frame,
454                        __entry->scanline)
455 );
456
457 TRACE_EVENT(intel_crtc_vblank_work_end,
458             TP_PROTO(struct intel_crtc *crtc),
459             TP_ARGS(crtc),
460
461             TP_STRUCT__entry(
462                              __field(enum pipe, pipe)
463                              __field(u32, frame)
464                              __field(u32, scanline)
465                              ),
466
467             TP_fast_assign(
468                            __entry->pipe = crtc->pipe;
469                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
470                            __entry->scanline = intel_get_crtc_scanline(crtc);
471                            ),
472
473             TP_printk("pipe %c, frame=%u, scanline=%u",
474                       pipe_name(__entry->pipe), __entry->frame,
475                        __entry->scanline)
476 );
477
478 TRACE_EVENT(intel_pipe_update_start,
479             TP_PROTO(struct intel_crtc *crtc),
480             TP_ARGS(crtc),
481
482             TP_STRUCT__entry(
483                              __field(enum pipe, pipe)
484                              __field(u32, frame)
485                              __field(u32, scanline)
486                              __field(u32, min)
487                              __field(u32, max)
488                              ),
489
490             TP_fast_assign(
491                            __entry->pipe = crtc->pipe;
492                            __entry->frame = intel_crtc_get_vblank_counter(crtc);
493                            __entry->scanline = intel_get_crtc_scanline(crtc);
494                            __entry->min = crtc->debug.min_vbl;
495                            __entry->max = crtc->debug.max_vbl;
496                            ),
497
498             TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
499                       pipe_name(__entry->pipe), __entry->frame,
500                        __entry->scanline, __entry->min, __entry->max)
501 );
502
503 TRACE_EVENT(intel_pipe_update_vblank_evaded,
504             TP_PROTO(struct intel_crtc *crtc),
505             TP_ARGS(crtc),
506
507             TP_STRUCT__entry(
508                              __field(enum pipe, pipe)
509                              __field(u32, frame)
510                              __field(u32, scanline)
511                              __field(u32, min)
512                              __field(u32, max)
513                              ),
514
515             TP_fast_assign(
516                            __entry->pipe = crtc->pipe;
517                            __entry->frame = crtc->debug.start_vbl_count;
518                            __entry->scanline = crtc->debug.scanline_start;
519                            __entry->min = crtc->debug.min_vbl;
520                            __entry->max = crtc->debug.max_vbl;
521                            ),
522
523             TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
524                       pipe_name(__entry->pipe), __entry->frame,
525                        __entry->scanline, __entry->min, __entry->max)
526 );
527
528 TRACE_EVENT(intel_pipe_update_end,
529             TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end),
530             TP_ARGS(crtc, frame, scanline_end),
531
532             TP_STRUCT__entry(
533                              __field(enum pipe, pipe)
534                              __field(u32, frame)
535                              __field(u32, scanline)
536                              ),
537
538             TP_fast_assign(
539                            __entry->pipe = crtc->pipe;
540                            __entry->frame = frame;
541                            __entry->scanline = scanline_end;
542                            ),
543
544             TP_printk("pipe %c, frame=%u, scanline=%u",
545                       pipe_name(__entry->pipe), __entry->frame,
546                       __entry->scanline)
547 );
548
549 /* frontbuffer tracking */
550
551 TRACE_EVENT(intel_frontbuffer_invalidate,
552             TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
553             TP_ARGS(frontbuffer_bits, origin),
554
555             TP_STRUCT__entry(
556                              __field(unsigned int, frontbuffer_bits)
557                              __field(unsigned int, origin)
558                              ),
559
560             TP_fast_assign(
561                            __entry->frontbuffer_bits = frontbuffer_bits;
562                            __entry->origin = origin;
563                            ),
564
565             TP_printk("frontbuffer_bits=0x%08x, origin=%u",
566                       __entry->frontbuffer_bits, __entry->origin)
567 );
568
569 TRACE_EVENT(intel_frontbuffer_flush,
570             TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
571             TP_ARGS(frontbuffer_bits, origin),
572
573             TP_STRUCT__entry(
574                              __field(unsigned int, frontbuffer_bits)
575                              __field(unsigned int, origin)
576                              ),
577
578             TP_fast_assign(
579                            __entry->frontbuffer_bits = frontbuffer_bits;
580                            __entry->origin = origin;
581                            ),
582
583             TP_printk("frontbuffer_bits=0x%08x, origin=%u",
584                       __entry->frontbuffer_bits, __entry->origin)
585 );
586
587 /* object tracking */
588
589 TRACE_EVENT(i915_gem_object_create,
590             TP_PROTO(struct drm_i915_gem_object *obj),
591             TP_ARGS(obj),
592
593             TP_STRUCT__entry(
594                              __field(struct drm_i915_gem_object *, obj)
595                              __field(u64, size)
596                              ),
597
598             TP_fast_assign(
599                            __entry->obj = obj;
600                            __entry->size = obj->base.size;
601                            ),
602
603             TP_printk("obj=%p, size=0x%llx", __entry->obj, __entry->size)
604 );
605
606 TRACE_EVENT(i915_gem_shrink,
607             TP_PROTO(struct drm_i915_private *i915, unsigned long target, unsigned flags),
608             TP_ARGS(i915, target, flags),
609
610             TP_STRUCT__entry(
611                              __field(int, dev)
612                              __field(unsigned long, target)
613                              __field(unsigned, flags)
614                              ),
615
616             TP_fast_assign(
617                            __entry->dev = i915->drm.primary->index;
618                            __entry->target = target;
619                            __entry->flags = flags;
620                            ),
621
622             TP_printk("dev=%d, target=%lu, flags=%x",
623                       __entry->dev, __entry->target, __entry->flags)
624 );
625
626 TRACE_EVENT(i915_vma_bind,
627             TP_PROTO(struct i915_vma *vma, unsigned flags),
628             TP_ARGS(vma, flags),
629
630             TP_STRUCT__entry(
631                              __field(struct drm_i915_gem_object *, obj)
632                              __field(struct i915_address_space *, vm)
633                              __field(u64, offset)
634                              __field(u64, size)
635                              __field(unsigned, flags)
636                              ),
637
638             TP_fast_assign(
639                            __entry->obj = vma->obj;
640                            __entry->vm = vma->vm;
641                            __entry->offset = vma->node.start;
642                            __entry->size = vma->node.size;
643                            __entry->flags = flags;
644                            ),
645
646             TP_printk("obj=%p, offset=0x%016llx size=0x%llx%s vm=%p",
647                       __entry->obj, __entry->offset, __entry->size,
648                       __entry->flags & PIN_MAPPABLE ? ", mappable" : "",
649                       __entry->vm)
650 );
651
652 TRACE_EVENT(i915_vma_unbind,
653             TP_PROTO(struct i915_vma *vma),
654             TP_ARGS(vma),
655
656             TP_STRUCT__entry(
657                              __field(struct drm_i915_gem_object *, obj)
658                              __field(struct i915_address_space *, vm)
659                              __field(u64, offset)
660                              __field(u64, size)
661                              ),
662
663             TP_fast_assign(
664                            __entry->obj = vma->obj;
665                            __entry->vm = vma->vm;
666                            __entry->offset = vma->node.start;
667                            __entry->size = vma->node.size;
668                            ),
669
670             TP_printk("obj=%p, offset=0x%016llx size=0x%llx vm=%p",
671                       __entry->obj, __entry->offset, __entry->size, __entry->vm)
672 );
673
674 TRACE_EVENT(i915_gem_object_pwrite,
675             TP_PROTO(struct drm_i915_gem_object *obj, u64 offset, u64 len),
676             TP_ARGS(obj, offset, len),
677
678             TP_STRUCT__entry(
679                              __field(struct drm_i915_gem_object *, obj)
680                              __field(u64, offset)
681                              __field(u64, len)
682                              ),
683
684             TP_fast_assign(
685                            __entry->obj = obj;
686                            __entry->offset = offset;
687                            __entry->len = len;
688                            ),
689
690             TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
691                       __entry->obj, __entry->offset, __entry->len)
692 );
693
694 TRACE_EVENT(i915_gem_object_pread,
695             TP_PROTO(struct drm_i915_gem_object *obj, u64 offset, u64 len),
696             TP_ARGS(obj, offset, len),
697
698             TP_STRUCT__entry(
699                              __field(struct drm_i915_gem_object *, obj)
700                              __field(u64, offset)
701                              __field(u64, len)
702                              ),
703
704             TP_fast_assign(
705                            __entry->obj = obj;
706                            __entry->offset = offset;
707                            __entry->len = len;
708                            ),
709
710             TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
711                       __entry->obj, __entry->offset, __entry->len)
712 );
713
714 TRACE_EVENT(i915_gem_object_fault,
715             TP_PROTO(struct drm_i915_gem_object *obj, u64 index, bool gtt, bool write),
716             TP_ARGS(obj, index, gtt, write),
717
718             TP_STRUCT__entry(
719                              __field(struct drm_i915_gem_object *, obj)
720                              __field(u64, index)
721                              __field(bool, gtt)
722                              __field(bool, write)
723                              ),
724
725             TP_fast_assign(
726                            __entry->obj = obj;
727                            __entry->index = index;
728                            __entry->gtt = gtt;
729                            __entry->write = write;
730                            ),
731
732             TP_printk("obj=%p, %s index=%llu %s",
733                       __entry->obj,
734                       __entry->gtt ? "GTT" : "CPU",
735                       __entry->index,
736                       __entry->write ? ", writable" : "")
737 );
738
739 DECLARE_EVENT_CLASS(i915_gem_object,
740             TP_PROTO(struct drm_i915_gem_object *obj),
741             TP_ARGS(obj),
742
743             TP_STRUCT__entry(
744                              __field(struct drm_i915_gem_object *, obj)
745                              ),
746
747             TP_fast_assign(
748                            __entry->obj = obj;
749                            ),
750
751             TP_printk("obj=%p", __entry->obj)
752 );
753
754 DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush,
755              TP_PROTO(struct drm_i915_gem_object *obj),
756              TP_ARGS(obj)
757 );
758
759 DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy,
760             TP_PROTO(struct drm_i915_gem_object *obj),
761             TP_ARGS(obj)
762 );
763
764 TRACE_EVENT(i915_gem_evict,
765             TP_PROTO(struct i915_address_space *vm, u64 size, u64 align, unsigned int flags),
766             TP_ARGS(vm, size, align, flags),
767
768             TP_STRUCT__entry(
769                              __field(u32, dev)
770                              __field(struct i915_address_space *, vm)
771                              __field(u64, size)
772                              __field(u64, align)
773                              __field(unsigned int, flags)
774                             ),
775
776             TP_fast_assign(
777                            __entry->dev = vm->i915->drm.primary->index;
778                            __entry->vm = vm;
779                            __entry->size = size;
780                            __entry->align = align;
781                            __entry->flags = flags;
782                           ),
783
784             TP_printk("dev=%d, vm=%p, size=0x%llx, align=0x%llx %s",
785                       __entry->dev, __entry->vm, __entry->size, __entry->align,
786                       __entry->flags & PIN_MAPPABLE ? ", mappable" : "")
787 );
788
789 TRACE_EVENT(i915_gem_evict_node,
790             TP_PROTO(struct i915_address_space *vm, struct drm_mm_node *node, unsigned int flags),
791             TP_ARGS(vm, node, flags),
792
793             TP_STRUCT__entry(
794                              __field(u32, dev)
795                              __field(struct i915_address_space *, vm)
796                              __field(u64, start)
797                              __field(u64, size)
798                              __field(unsigned long, color)
799                              __field(unsigned int, flags)
800                             ),
801
802             TP_fast_assign(
803                            __entry->dev = vm->i915->drm.primary->index;
804                            __entry->vm = vm;
805                            __entry->start = node->start;
806                            __entry->size = node->size;
807                            __entry->color = node->color;
808                            __entry->flags = flags;
809                           ),
810
811             TP_printk("dev=%d, vm=%p, start=0x%llx size=0x%llx, color=0x%lx, flags=%x",
812                       __entry->dev, __entry->vm,
813                       __entry->start, __entry->size,
814                       __entry->color, __entry->flags)
815 );
816
817 TRACE_EVENT(i915_gem_evict_vm,
818             TP_PROTO(struct i915_address_space *vm),
819             TP_ARGS(vm),
820
821             TP_STRUCT__entry(
822                              __field(u32, dev)
823                              __field(struct i915_address_space *, vm)
824                             ),
825
826             TP_fast_assign(
827                            __entry->dev = vm->i915->drm.primary->index;
828                            __entry->vm = vm;
829                           ),
830
831             TP_printk("dev=%d, vm=%p", __entry->dev, __entry->vm)
832 );
833
834 TRACE_EVENT(i915_request_queue,
835             TP_PROTO(struct i915_request *rq, u32 flags),
836             TP_ARGS(rq, flags),
837
838             TP_STRUCT__entry(
839                              __field(u32, dev)
840                              __field(u64, ctx)
841                              __field(u16, class)
842                              __field(u16, instance)
843                              __field(u32, seqno)
844                              __field(u32, flags)
845                              ),
846
847             TP_fast_assign(
848                            __entry->dev = rq->engine->i915->drm.primary->index;
849                            __entry->class = rq->engine->uabi_class;
850                            __entry->instance = rq->engine->uabi_instance;
851                            __entry->ctx = rq->fence.context;
852                            __entry->seqno = rq->fence.seqno;
853                            __entry->flags = flags;
854                            ),
855
856             TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, flags=0x%x",
857                       __entry->dev, __entry->class, __entry->instance,
858                       __entry->ctx, __entry->seqno, __entry->flags)
859 );
860
861 DECLARE_EVENT_CLASS(i915_request,
862             TP_PROTO(struct i915_request *rq),
863             TP_ARGS(rq),
864
865             TP_STRUCT__entry(
866                              __field(u32, dev)
867                              __field(u64, ctx)
868                              __field(u16, class)
869                              __field(u16, instance)
870                              __field(u32, seqno)
871                              __field(u32, tail)
872                              ),
873
874             TP_fast_assign(
875                            __entry->dev = rq->engine->i915->drm.primary->index;
876                            __entry->class = rq->engine->uabi_class;
877                            __entry->instance = rq->engine->uabi_instance;
878                            __entry->ctx = rq->fence.context;
879                            __entry->seqno = rq->fence.seqno;
880                            __entry->tail = rq->tail;
881                            ),
882
883             TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, tail=%u",
884                       __entry->dev, __entry->class, __entry->instance,
885                       __entry->ctx, __entry->seqno, __entry->tail)
886 );
887
888 DEFINE_EVENT(i915_request, i915_request_add,
889              TP_PROTO(struct i915_request *rq),
890              TP_ARGS(rq)
891 );
892
893 #if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
894 DEFINE_EVENT(i915_request, i915_request_guc_submit,
895              TP_PROTO(struct i915_request *rq),
896              TP_ARGS(rq)
897 );
898
899 DEFINE_EVENT(i915_request, i915_request_submit,
900              TP_PROTO(struct i915_request *rq),
901              TP_ARGS(rq)
902 );
903
904 DEFINE_EVENT(i915_request, i915_request_execute,
905              TP_PROTO(struct i915_request *rq),
906              TP_ARGS(rq)
907 );
908
909 TRACE_EVENT(i915_request_in,
910             TP_PROTO(struct i915_request *rq, unsigned int port),
911             TP_ARGS(rq, port),
912
913             TP_STRUCT__entry(
914                              __field(u32, dev)
915                              __field(u64, ctx)
916                              __field(u16, class)
917                              __field(u16, instance)
918                              __field(u32, seqno)
919                              __field(u32, port)
920                              __field(s32, prio)
921                             ),
922
923             TP_fast_assign(
924                            __entry->dev = rq->engine->i915->drm.primary->index;
925                            __entry->class = rq->engine->uabi_class;
926                            __entry->instance = rq->engine->uabi_instance;
927                            __entry->ctx = rq->fence.context;
928                            __entry->seqno = rq->fence.seqno;
929                            __entry->prio = rq->sched.attr.priority;
930                            __entry->port = port;
931                            ),
932
933             TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, prio=%d, port=%u",
934                       __entry->dev, __entry->class, __entry->instance,
935                       __entry->ctx, __entry->seqno,
936                       __entry->prio, __entry->port)
937 );
938
939 TRACE_EVENT(i915_request_out,
940             TP_PROTO(struct i915_request *rq),
941             TP_ARGS(rq),
942
943             TP_STRUCT__entry(
944                              __field(u32, dev)
945                              __field(u64, ctx)
946                              __field(u16, class)
947                              __field(u16, instance)
948                              __field(u32, seqno)
949                              __field(u32, completed)
950                             ),
951
952             TP_fast_assign(
953                            __entry->dev = rq->engine->i915->drm.primary->index;
954                            __entry->class = rq->engine->uabi_class;
955                            __entry->instance = rq->engine->uabi_instance;
956                            __entry->ctx = rq->fence.context;
957                            __entry->seqno = rq->fence.seqno;
958                            __entry->completed = i915_request_completed(rq);
959                            ),
960
961                     TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, completed?=%u",
962                               __entry->dev, __entry->class, __entry->instance,
963                               __entry->ctx, __entry->seqno, __entry->completed)
964 );
965
966 DECLARE_EVENT_CLASS(intel_context,
967                     TP_PROTO(struct intel_context *ce),
968                     TP_ARGS(ce),
969
970                     TP_STRUCT__entry(
971                              __field(u32, guc_id)
972                              __field(int, pin_count)
973                              __field(u32, sched_state)
974                              __field(u8, guc_prio)
975                              ),
976
977                     TP_fast_assign(
978                            __entry->guc_id = ce->guc_id.id;
979                            __entry->pin_count = atomic_read(&ce->pin_count);
980                            __entry->sched_state = ce->guc_state.sched_state;
981                            __entry->guc_prio = ce->guc_state.prio;
982                            ),
983
984                     TP_printk("guc_id=%d, pin_count=%d sched_state=0x%x, guc_prio=%u",
985                               __entry->guc_id, __entry->pin_count,
986                               __entry->sched_state,
987                               __entry->guc_prio)
988 );
989
990 DEFINE_EVENT(intel_context, intel_context_set_prio,
991              TP_PROTO(struct intel_context *ce),
992              TP_ARGS(ce)
993 );
994
995 DEFINE_EVENT(intel_context, intel_context_reset,
996              TP_PROTO(struct intel_context *ce),
997              TP_ARGS(ce)
998 );
999
1000 DEFINE_EVENT(intel_context, intel_context_ban,
1001              TP_PROTO(struct intel_context *ce),
1002              TP_ARGS(ce)
1003 );
1004
1005 DEFINE_EVENT(intel_context, intel_context_register,
1006              TP_PROTO(struct intel_context *ce),
1007              TP_ARGS(ce)
1008 );
1009
1010 DEFINE_EVENT(intel_context, intel_context_deregister,
1011              TP_PROTO(struct intel_context *ce),
1012              TP_ARGS(ce)
1013 );
1014
1015 DEFINE_EVENT(intel_context, intel_context_deregister_done,
1016              TP_PROTO(struct intel_context *ce),
1017              TP_ARGS(ce)
1018 );
1019
1020 DEFINE_EVENT(intel_context, intel_context_sched_enable,
1021              TP_PROTO(struct intel_context *ce),
1022              TP_ARGS(ce)
1023 );
1024
1025 DEFINE_EVENT(intel_context, intel_context_sched_disable,
1026              TP_PROTO(struct intel_context *ce),
1027              TP_ARGS(ce)
1028 );
1029
1030 DEFINE_EVENT(intel_context, intel_context_sched_done,
1031              TP_PROTO(struct intel_context *ce),
1032              TP_ARGS(ce)
1033 );
1034
1035 DEFINE_EVENT(intel_context, intel_context_create,
1036              TP_PROTO(struct intel_context *ce),
1037              TP_ARGS(ce)
1038 );
1039
1040 DEFINE_EVENT(intel_context, intel_context_fence_release,
1041              TP_PROTO(struct intel_context *ce),
1042              TP_ARGS(ce)
1043 );
1044
1045 DEFINE_EVENT(intel_context, intel_context_free,
1046              TP_PROTO(struct intel_context *ce),
1047              TP_ARGS(ce)
1048 );
1049
1050 DEFINE_EVENT(intel_context, intel_context_steal_guc_id,
1051              TP_PROTO(struct intel_context *ce),
1052              TP_ARGS(ce)
1053 );
1054
1055 DEFINE_EVENT(intel_context, intel_context_do_pin,
1056              TP_PROTO(struct intel_context *ce),
1057              TP_ARGS(ce)
1058 );
1059
1060 DEFINE_EVENT(intel_context, intel_context_do_unpin,
1061              TP_PROTO(struct intel_context *ce),
1062              TP_ARGS(ce)
1063 );
1064
1065 #else
1066 #if !defined(TRACE_HEADER_MULTI_READ)
1067 static inline void
1068 trace_i915_request_guc_submit(struct i915_request *rq)
1069 {
1070 }
1071
1072 static inline void
1073 trace_i915_request_submit(struct i915_request *rq)
1074 {
1075 }
1076
1077 static inline void
1078 trace_i915_request_execute(struct i915_request *rq)
1079 {
1080 }
1081
1082 static inline void
1083 trace_i915_request_in(struct i915_request *rq, unsigned int port)
1084 {
1085 }
1086
1087 static inline void
1088 trace_i915_request_out(struct i915_request *rq)
1089 {
1090 }
1091
1092 static inline void
1093 trace_intel_context_set_prio(struct intel_context *ce)
1094 {
1095 }
1096
1097 static inline void
1098 trace_intel_context_reset(struct intel_context *ce)
1099 {
1100 }
1101
1102 static inline void
1103 trace_intel_context_ban(struct intel_context *ce)
1104 {
1105 }
1106
1107 static inline void
1108 trace_intel_context_register(struct intel_context *ce)
1109 {
1110 }
1111
1112 static inline void
1113 trace_intel_context_deregister(struct intel_context *ce)
1114 {
1115 }
1116
1117 static inline void
1118 trace_intel_context_deregister_done(struct intel_context *ce)
1119 {
1120 }
1121
1122 static inline void
1123 trace_intel_context_sched_enable(struct intel_context *ce)
1124 {
1125 }
1126
1127 static inline void
1128 trace_intel_context_sched_disable(struct intel_context *ce)
1129 {
1130 }
1131
1132 static inline void
1133 trace_intel_context_sched_done(struct intel_context *ce)
1134 {
1135 }
1136
1137 static inline void
1138 trace_intel_context_create(struct intel_context *ce)
1139 {
1140 }
1141
1142 static inline void
1143 trace_intel_context_fence_release(struct intel_context *ce)
1144 {
1145 }
1146
1147 static inline void
1148 trace_intel_context_free(struct intel_context *ce)
1149 {
1150 }
1151
1152 static inline void
1153 trace_intel_context_steal_guc_id(struct intel_context *ce)
1154 {
1155 }
1156
1157 static inline void
1158 trace_intel_context_do_pin(struct intel_context *ce)
1159 {
1160 }
1161
1162 static inline void
1163 trace_intel_context_do_unpin(struct intel_context *ce)
1164 {
1165 }
1166 #endif
1167 #endif
1168
1169 DEFINE_EVENT(i915_request, i915_request_retire,
1170             TP_PROTO(struct i915_request *rq),
1171             TP_ARGS(rq)
1172 );
1173
1174 TRACE_EVENT(i915_request_wait_begin,
1175             TP_PROTO(struct i915_request *rq, unsigned int flags),
1176             TP_ARGS(rq, flags),
1177
1178             TP_STRUCT__entry(
1179                              __field(u32, dev)
1180                              __field(u64, ctx)
1181                              __field(u16, class)
1182                              __field(u16, instance)
1183                              __field(u32, seqno)
1184                              __field(unsigned int, flags)
1185                              ),
1186
1187             /* NB: the blocking information is racy since mutex_is_locked
1188              * doesn't check that the current thread holds the lock. The only
1189              * other option would be to pass the boolean information of whether
1190              * or not the class was blocking down through the stack which is
1191              * less desirable.
1192              */
1193             TP_fast_assign(
1194                            __entry->dev = rq->engine->i915->drm.primary->index;
1195                            __entry->class = rq->engine->uabi_class;
1196                            __entry->instance = rq->engine->uabi_instance;
1197                            __entry->ctx = rq->fence.context;
1198                            __entry->seqno = rq->fence.seqno;
1199                            __entry->flags = flags;
1200                            ),
1201
1202             TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, flags=0x%x",
1203                       __entry->dev, __entry->class, __entry->instance,
1204                       __entry->ctx, __entry->seqno,
1205                       __entry->flags)
1206 );
1207
1208 DEFINE_EVENT(i915_request, i915_request_wait_end,
1209             TP_PROTO(struct i915_request *rq),
1210             TP_ARGS(rq)
1211 );
1212
1213 TRACE_EVENT_CONDITION(i915_reg_rw,
1214         TP_PROTO(bool write, i915_reg_t reg, u64 val, int len, bool trace),
1215
1216         TP_ARGS(write, reg, val, len, trace),
1217
1218         TP_CONDITION(trace),
1219
1220         TP_STRUCT__entry(
1221                 __field(u64, val)
1222                 __field(u32, reg)
1223                 __field(u16, write)
1224                 __field(u16, len)
1225                 ),
1226
1227         TP_fast_assign(
1228                 __entry->val = (u64)val;
1229                 __entry->reg = i915_mmio_reg_offset(reg);
1230                 __entry->write = write;
1231                 __entry->len = len;
1232                 ),
1233
1234         TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)",
1235                 __entry->write ? "write" : "read",
1236                 __entry->reg, __entry->len,
1237                 (u32)(__entry->val & 0xffffffff),
1238                 (u32)(__entry->val >> 32))
1239 );
1240
1241 TRACE_EVENT(intel_gpu_freq_change,
1242             TP_PROTO(u32 freq),
1243             TP_ARGS(freq),
1244
1245             TP_STRUCT__entry(
1246                              __field(u32, freq)
1247                              ),
1248
1249             TP_fast_assign(
1250                            __entry->freq = freq;
1251                            ),
1252
1253             TP_printk("new_freq=%u", __entry->freq)
1254 );
1255
1256 /**
1257  * DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints
1258  *
1259  * With full ppgtt enabled each process using drm will allocate at least one
1260  * translation table. With these traces it is possible to keep track of the
1261  * allocation and of the lifetime of the tables; this can be used during
1262  * testing/debug to verify that we are not leaking ppgtts.
1263  * These traces identify the ppgtt through the vm pointer, which is also printed
1264  * by the i915_vma_bind and i915_vma_unbind tracepoints.
1265  */
1266 DECLARE_EVENT_CLASS(i915_ppgtt,
1267         TP_PROTO(struct i915_address_space *vm),
1268         TP_ARGS(vm),
1269
1270         TP_STRUCT__entry(
1271                         __field(struct i915_address_space *, vm)
1272                         __field(u32, dev)
1273         ),
1274
1275         TP_fast_assign(
1276                         __entry->vm = vm;
1277                         __entry->dev = vm->i915->drm.primary->index;
1278         ),
1279
1280         TP_printk("dev=%u, vm=%p", __entry->dev, __entry->vm)
1281 )
1282
1283 DEFINE_EVENT(i915_ppgtt, i915_ppgtt_create,
1284         TP_PROTO(struct i915_address_space *vm),
1285         TP_ARGS(vm)
1286 );
1287
1288 DEFINE_EVENT(i915_ppgtt, i915_ppgtt_release,
1289         TP_PROTO(struct i915_address_space *vm),
1290         TP_ARGS(vm)
1291 );
1292
1293 /**
1294  * DOC: i915_context_create and i915_context_free tracepoints
1295  *
1296  * These tracepoints are used to track creation and deletion of contexts.
1297  * If full ppgtt is enabled, they also print the address of the vm assigned to
1298  * the context.
1299  */
1300 DECLARE_EVENT_CLASS(i915_context,
1301         TP_PROTO(struct i915_gem_context *ctx),
1302         TP_ARGS(ctx),
1303
1304         TP_STRUCT__entry(
1305                         __field(u32, dev)
1306                         __field(struct i915_gem_context *, ctx)
1307                         __field(struct i915_address_space *, vm)
1308         ),
1309
1310         TP_fast_assign(
1311                         __entry->dev = ctx->i915->drm.primary->index;
1312                         __entry->ctx = ctx;
1313                         __entry->vm = ctx->vm;
1314         ),
1315
1316         TP_printk("dev=%u, ctx=%p, ctx_vm=%p",
1317                   __entry->dev, __entry->ctx, __entry->vm)
1318 )
1319
1320 DEFINE_EVENT(i915_context, i915_context_create,
1321         TP_PROTO(struct i915_gem_context *ctx),
1322         TP_ARGS(ctx)
1323 );
1324
1325 DEFINE_EVENT(i915_context, i915_context_free,
1326         TP_PROTO(struct i915_gem_context *ctx),
1327         TP_ARGS(ctx)
1328 );
1329
1330 #endif /* _I915_TRACE_H_ */
1331
1332 /* This part must be outside protection */
1333 #undef TRACE_INCLUDE_PATH
1334 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
1335 #include <trace/define_trace.h>