| .. | .. |
|---|
| 2 | 2 | #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) |
|---|
| 3 | 3 | #define _I915_TRACE_H_ |
|---|
| 4 | 4 | |
|---|
| 5 | +#ifdef CONFIG_PREEMPT_RT |
|---|
| 6 | +#define NOTRACE |
|---|
| 7 | +#endif |
|---|
| 8 | + |
|---|
| 5 | 9 | #include <linux/stringify.h> |
|---|
| 6 | 10 | #include <linux/types.h> |
|---|
| 7 | 11 | #include <linux/tracepoint.h> |
|---|
| 8 | 12 | |
|---|
| 9 | | -#include <drm/drmP.h> |
|---|
| 13 | +#include <drm/drm_drv.h> |
|---|
| 14 | + |
|---|
| 15 | +#include "display/intel_display_types.h" |
|---|
| 16 | +#include "gt/intel_engine.h" |
|---|
| 17 | + |
|---|
| 10 | 18 | #include "i915_drv.h" |
|---|
| 11 | | -#include "intel_drv.h" |
|---|
| 12 | | -#include "intel_ringbuffer.h" |
|---|
| 19 | +#include "i915_irq.h" |
|---|
| 13 | 20 | |
|---|
| 14 | 21 | #undef TRACE_SYSTEM |
|---|
| 15 | 22 | #define TRACE_SYSTEM i915 |
|---|
| 16 | 23 | #define TRACE_INCLUDE_FILE i915_trace |
|---|
| 17 | 24 | |
|---|
| 18 | 25 | /* watermark/fifo updates */ |
|---|
| 26 | + |
|---|
| 27 | +TRACE_EVENT(intel_pipe_enable, |
|---|
| 28 | + TP_PROTO(struct intel_crtc *crtc), |
|---|
| 29 | + TP_ARGS(crtc), |
|---|
| 30 | + |
|---|
| 31 | + TP_STRUCT__entry( |
|---|
| 32 | + __array(u32, frame, 3) |
|---|
| 33 | + __array(u32, scanline, 3) |
|---|
| 34 | + __field(enum pipe, pipe) |
|---|
| 35 | + ), |
|---|
| 36 | + TP_fast_assign( |
|---|
| 37 | + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); |
|---|
| 38 | + struct intel_crtc *it__; |
|---|
| 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("pipe %c enable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u", |
|---|
| 47 | + 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 | + __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 | + for_each_intel_crtc(&dev_priv->drm, it__) { |
|---|
| 67 | + __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__); |
|---|
| 68 | + __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__); |
|---|
| 69 | + } |
|---|
| 70 | + __entry->pipe = crtc->pipe; |
|---|
| 71 | + ), |
|---|
| 72 | + |
|---|
| 73 | + TP_printk("pipe %c disable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u", |
|---|
| 74 | + pipe_name(__entry->pipe), |
|---|
| 75 | + __entry->frame[PIPE_A], __entry->scanline[PIPE_A], |
|---|
| 76 | + __entry->frame[PIPE_B], __entry->scanline[PIPE_B], |
|---|
| 77 | + __entry->frame[PIPE_C], __entry->scanline[PIPE_C]) |
|---|
| 78 | +); |
|---|
| 79 | + |
|---|
| 80 | +TRACE_EVENT(intel_pipe_crc, |
|---|
| 81 | + TP_PROTO(struct intel_crtc *crtc, const u32 *crcs), |
|---|
| 82 | + TP_ARGS(crtc, crcs), |
|---|
| 83 | + |
|---|
| 84 | + TP_STRUCT__entry( |
|---|
| 85 | + __field(enum pipe, pipe) |
|---|
| 86 | + __field(u32, frame) |
|---|
| 87 | + __field(u32, scanline) |
|---|
| 88 | + __array(u32, crcs, 5) |
|---|
| 89 | + ), |
|---|
| 90 | + |
|---|
| 91 | + TP_fast_assign( |
|---|
| 92 | + __entry->pipe = crtc->pipe; |
|---|
| 93 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 94 | + __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 95 | + memcpy(__entry->crcs, crcs, sizeof(__entry->crcs)); |
|---|
| 96 | + ), |
|---|
| 97 | + |
|---|
| 98 | + TP_printk("pipe %c, frame=%u, scanline=%u crc=%08x %08x %08x %08x %08x", |
|---|
| 99 | + pipe_name(__entry->pipe), __entry->frame, __entry->scanline, |
|---|
| 100 | + __entry->crcs[0], __entry->crcs[1], __entry->crcs[2], |
|---|
| 101 | + __entry->crcs[3], __entry->crcs[4]) |
|---|
| 102 | +); |
|---|
| 19 | 103 | |
|---|
| 20 | 104 | TRACE_EVENT(intel_cpu_fifo_underrun, |
|---|
| 21 | 105 | TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe), |
|---|
| .. | .. |
|---|
| 28 | 112 | ), |
|---|
| 29 | 113 | |
|---|
| 30 | 114 | TP_fast_assign( |
|---|
| 115 | + struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe); |
|---|
| 31 | 116 | __entry->pipe = pipe; |
|---|
| 32 | | - __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe); |
|---|
| 33 | | - __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe)); |
|---|
| 117 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 118 | + __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 34 | 119 | ), |
|---|
| 35 | 120 | |
|---|
| 36 | 121 | TP_printk("pipe %c, frame=%u, scanline=%u", |
|---|
| .. | .. |
|---|
| 50 | 135 | |
|---|
| 51 | 136 | TP_fast_assign( |
|---|
| 52 | 137 | enum pipe pipe = pch_transcoder; |
|---|
| 138 | + struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe); |
|---|
| 53 | 139 | __entry->pipe = pipe; |
|---|
| 54 | | - __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe); |
|---|
| 55 | | - __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe)); |
|---|
| 140 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 141 | + __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 56 | 142 | ), |
|---|
| 57 | 143 | |
|---|
| 58 | 144 | TP_printk("pch transcoder %c, frame=%u, scanline=%u", |
|---|
| .. | .. |
|---|
| 72 | 158 | ), |
|---|
| 73 | 159 | |
|---|
| 74 | 160 | TP_fast_assign( |
|---|
| 75 | | - enum pipe pipe; |
|---|
| 76 | | - for_each_pipe(dev_priv, pipe) { |
|---|
| 77 | | - __entry->frame[pipe] = |
|---|
| 78 | | - dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe); |
|---|
| 79 | | - __entry->scanline[pipe] = |
|---|
| 80 | | - intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe)); |
|---|
| 161 | + struct intel_crtc *crtc; |
|---|
| 162 | + for_each_intel_crtc(&dev_priv->drm, crtc) { |
|---|
| 163 | + __entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc); |
|---|
| 164 | + __entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc); |
|---|
| 81 | 165 | } |
|---|
| 82 | 166 | __entry->old = old; |
|---|
| 83 | 167 | __entry->new = new; |
|---|
| .. | .. |
|---|
| 114 | 198 | |
|---|
| 115 | 199 | TP_fast_assign( |
|---|
| 116 | 200 | __entry->pipe = crtc->pipe; |
|---|
| 117 | | - __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, |
|---|
| 118 | | - crtc->pipe); |
|---|
| 201 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 119 | 202 | __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 120 | 203 | __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY]; |
|---|
| 121 | 204 | __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0]; |
|---|
| .. | .. |
|---|
| 159 | 242 | |
|---|
| 160 | 243 | TP_fast_assign( |
|---|
| 161 | 244 | __entry->pipe = crtc->pipe; |
|---|
| 162 | | - __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, |
|---|
| 163 | | - crtc->pipe); |
|---|
| 245 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 164 | 246 | __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 165 | 247 | __entry->level = wm->level; |
|---|
| 166 | 248 | __entry->cxsr = wm->cxsr; |
|---|
| .. | .. |
|---|
| 194 | 276 | |
|---|
| 195 | 277 | TP_fast_assign( |
|---|
| 196 | 278 | __entry->pipe = crtc->pipe; |
|---|
| 197 | | - __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, |
|---|
| 198 | | - crtc->pipe); |
|---|
| 279 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 199 | 280 | __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 200 | 281 | __entry->sprite0_start = sprite0_start; |
|---|
| 201 | 282 | __entry->sprite1_start = sprite1_start; |
|---|
| .. | .. |
|---|
| 216 | 297 | |
|---|
| 217 | 298 | TP_STRUCT__entry( |
|---|
| 218 | 299 | __field(enum pipe, pipe) |
|---|
| 219 | | - __field(const char *, name) |
|---|
| 220 | 300 | __field(u32, frame) |
|---|
| 221 | 301 | __field(u32, scanline) |
|---|
| 222 | 302 | __array(int, src, 4) |
|---|
| 223 | 303 | __array(int, dst, 4) |
|---|
| 304 | + __string(name, plane->name) |
|---|
| 224 | 305 | ), |
|---|
| 225 | 306 | |
|---|
| 226 | 307 | TP_fast_assign( |
|---|
| 308 | + __assign_str(name, plane->name); |
|---|
| 227 | 309 | __entry->pipe = crtc->pipe; |
|---|
| 228 | | - __entry->name = plane->name; |
|---|
| 229 | | - __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, |
|---|
| 230 | | - crtc->pipe); |
|---|
| 310 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 231 | 311 | __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 232 | 312 | memcpy(__entry->src, &plane->state->src, sizeof(__entry->src)); |
|---|
| 233 | 313 | memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst)); |
|---|
| 234 | 314 | ), |
|---|
| 235 | 315 | |
|---|
| 236 | 316 | TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT, |
|---|
| 237 | | - pipe_name(__entry->pipe), __entry->name, |
|---|
| 317 | + pipe_name(__entry->pipe), __get_str(name), |
|---|
| 238 | 318 | __entry->frame, __entry->scanline, |
|---|
| 239 | 319 | DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src), |
|---|
| 240 | 320 | DRM_RECT_ARG((const struct drm_rect *)__entry->dst)) |
|---|
| .. | .. |
|---|
| 246 | 326 | |
|---|
| 247 | 327 | TP_STRUCT__entry( |
|---|
| 248 | 328 | __field(enum pipe, pipe) |
|---|
| 249 | | - __field(const char *, name) |
|---|
| 329 | + __field(u32, frame) |
|---|
| 330 | + __field(u32, scanline) |
|---|
| 331 | + __string(name, plane->name) |
|---|
| 332 | + ), |
|---|
| 333 | + |
|---|
| 334 | + TP_fast_assign( |
|---|
| 335 | + __assign_str(name, plane->name); |
|---|
| 336 | + __entry->pipe = crtc->pipe; |
|---|
| 337 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 338 | + __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 339 | + ), |
|---|
| 340 | + |
|---|
| 341 | + TP_printk("pipe %c, plane %s, frame=%u, scanline=%u", |
|---|
| 342 | + pipe_name(__entry->pipe), __get_str(name), |
|---|
| 343 | + __entry->frame, __entry->scanline) |
|---|
| 344 | +); |
|---|
| 345 | + |
|---|
| 346 | +/* fbc */ |
|---|
| 347 | + |
|---|
| 348 | +TRACE_EVENT(intel_fbc_activate, |
|---|
| 349 | + TP_PROTO(struct intel_crtc *crtc), |
|---|
| 350 | + TP_ARGS(crtc), |
|---|
| 351 | + |
|---|
| 352 | + TP_STRUCT__entry( |
|---|
| 353 | + __field(enum pipe, pipe) |
|---|
| 250 | 354 | __field(u32, frame) |
|---|
| 251 | 355 | __field(u32, scanline) |
|---|
| 252 | 356 | ), |
|---|
| 253 | 357 | |
|---|
| 254 | 358 | TP_fast_assign( |
|---|
| 255 | 359 | __entry->pipe = crtc->pipe; |
|---|
| 256 | | - __entry->name = plane->name; |
|---|
| 257 | | - __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, |
|---|
| 258 | | - crtc->pipe); |
|---|
| 360 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 259 | 361 | __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 260 | 362 | ), |
|---|
| 261 | 363 | |
|---|
| 262 | | - TP_printk("pipe %c, plane %s, frame=%u, scanline=%u", |
|---|
| 263 | | - pipe_name(__entry->pipe), __entry->name, |
|---|
| 264 | | - __entry->frame, __entry->scanline) |
|---|
| 364 | + TP_printk("pipe %c, frame=%u, scanline=%u", |
|---|
| 365 | + pipe_name(__entry->pipe), __entry->frame, __entry->scanline) |
|---|
| 366 | +); |
|---|
| 367 | + |
|---|
| 368 | +TRACE_EVENT(intel_fbc_deactivate, |
|---|
| 369 | + TP_PROTO(struct intel_crtc *crtc), |
|---|
| 370 | + TP_ARGS(crtc), |
|---|
| 371 | + |
|---|
| 372 | + TP_STRUCT__entry( |
|---|
| 373 | + __field(enum pipe, pipe) |
|---|
| 374 | + __field(u32, frame) |
|---|
| 375 | + __field(u32, scanline) |
|---|
| 376 | + ), |
|---|
| 377 | + |
|---|
| 378 | + TP_fast_assign( |
|---|
| 379 | + __entry->pipe = crtc->pipe; |
|---|
| 380 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 381 | + __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 382 | + ), |
|---|
| 383 | + |
|---|
| 384 | + TP_printk("pipe %c, frame=%u, scanline=%u", |
|---|
| 385 | + pipe_name(__entry->pipe), __entry->frame, __entry->scanline) |
|---|
| 386 | +); |
|---|
| 387 | + |
|---|
| 388 | +TRACE_EVENT(intel_fbc_nuke, |
|---|
| 389 | + TP_PROTO(struct intel_crtc *crtc), |
|---|
| 390 | + TP_ARGS(crtc), |
|---|
| 391 | + |
|---|
| 392 | + TP_STRUCT__entry( |
|---|
| 393 | + __field(enum pipe, pipe) |
|---|
| 394 | + __field(u32, frame) |
|---|
| 395 | + __field(u32, scanline) |
|---|
| 396 | + ), |
|---|
| 397 | + |
|---|
| 398 | + TP_fast_assign( |
|---|
| 399 | + __entry->pipe = crtc->pipe; |
|---|
| 400 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 401 | + __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 402 | + ), |
|---|
| 403 | + |
|---|
| 404 | + TP_printk("pipe %c, frame=%u, scanline=%u", |
|---|
| 405 | + pipe_name(__entry->pipe), __entry->frame, __entry->scanline) |
|---|
| 265 | 406 | ); |
|---|
| 266 | 407 | |
|---|
| 267 | 408 | /* pipe updates */ |
|---|
| 268 | 409 | |
|---|
| 269 | | -TRACE_EVENT(i915_pipe_update_start, |
|---|
| 410 | +TRACE_EVENT(intel_pipe_update_start, |
|---|
| 270 | 411 | TP_PROTO(struct intel_crtc *crtc), |
|---|
| 271 | 412 | TP_ARGS(crtc), |
|---|
| 272 | 413 | |
|---|
| .. | .. |
|---|
| 280 | 421 | |
|---|
| 281 | 422 | TP_fast_assign( |
|---|
| 282 | 423 | __entry->pipe = crtc->pipe; |
|---|
| 283 | | - __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, |
|---|
| 284 | | - crtc->pipe); |
|---|
| 424 | + __entry->frame = intel_crtc_get_vblank_counter(crtc); |
|---|
| 285 | 425 | __entry->scanline = intel_get_crtc_scanline(crtc); |
|---|
| 286 | 426 | __entry->min = crtc->debug.min_vbl; |
|---|
| 287 | 427 | __entry->max = crtc->debug.max_vbl; |
|---|
| .. | .. |
|---|
| 292 | 432 | __entry->scanline, __entry->min, __entry->max) |
|---|
| 293 | 433 | ); |
|---|
| 294 | 434 | |
|---|
| 295 | | -TRACE_EVENT(i915_pipe_update_vblank_evaded, |
|---|
| 435 | +TRACE_EVENT(intel_pipe_update_vblank_evaded, |
|---|
| 296 | 436 | TP_PROTO(struct intel_crtc *crtc), |
|---|
| 297 | 437 | TP_ARGS(crtc), |
|---|
| 298 | 438 | |
|---|
| .. | .. |
|---|
| 317 | 457 | __entry->scanline, __entry->min, __entry->max) |
|---|
| 318 | 458 | ); |
|---|
| 319 | 459 | |
|---|
| 320 | | -TRACE_EVENT(i915_pipe_update_end, |
|---|
| 460 | +TRACE_EVENT(intel_pipe_update_end, |
|---|
| 321 | 461 | TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end), |
|---|
| 322 | 462 | TP_ARGS(crtc, frame, scanline_end), |
|---|
| 323 | 463 | |
|---|
| .. | .. |
|---|
| 585 | 725 | TP_printk("dev=%d, vm=%p", __entry->dev, __entry->vm) |
|---|
| 586 | 726 | ); |
|---|
| 587 | 727 | |
|---|
| 588 | | -TRACE_EVENT(i915_gem_ring_sync_to, |
|---|
| 589 | | - TP_PROTO(struct i915_request *to, struct i915_request *from), |
|---|
| 590 | | - TP_ARGS(to, from), |
|---|
| 591 | | - |
|---|
| 592 | | - TP_STRUCT__entry( |
|---|
| 593 | | - __field(u32, dev) |
|---|
| 594 | | - __field(u32, from_class) |
|---|
| 595 | | - __field(u32, from_instance) |
|---|
| 596 | | - __field(u32, to_class) |
|---|
| 597 | | - __field(u32, to_instance) |
|---|
| 598 | | - __field(u32, seqno) |
|---|
| 599 | | - ), |
|---|
| 600 | | - |
|---|
| 601 | | - TP_fast_assign( |
|---|
| 602 | | - __entry->dev = from->i915->drm.primary->index; |
|---|
| 603 | | - __entry->from_class = from->engine->uabi_class; |
|---|
| 604 | | - __entry->from_instance = from->engine->instance; |
|---|
| 605 | | - __entry->to_class = to->engine->uabi_class; |
|---|
| 606 | | - __entry->to_instance = to->engine->instance; |
|---|
| 607 | | - __entry->seqno = from->global_seqno; |
|---|
| 608 | | - ), |
|---|
| 609 | | - |
|---|
| 610 | | - TP_printk("dev=%u, sync-from=%u:%u, sync-to=%u:%u, seqno=%u", |
|---|
| 611 | | - __entry->dev, |
|---|
| 612 | | - __entry->from_class, __entry->from_instance, |
|---|
| 613 | | - __entry->to_class, __entry->to_instance, |
|---|
| 614 | | - __entry->seqno) |
|---|
| 615 | | -); |
|---|
| 616 | | - |
|---|
| 617 | 728 | TRACE_EVENT(i915_request_queue, |
|---|
| 618 | 729 | TP_PROTO(struct i915_request *rq, u32 flags), |
|---|
| 619 | 730 | TP_ARGS(rq, flags), |
|---|
| 620 | 731 | |
|---|
| 621 | 732 | TP_STRUCT__entry( |
|---|
| 622 | 733 | __field(u32, dev) |
|---|
| 623 | | - __field(u32, hw_id) |
|---|
| 624 | 734 | __field(u64, ctx) |
|---|
| 625 | 735 | __field(u16, class) |
|---|
| 626 | 736 | __field(u16, instance) |
|---|
| .. | .. |
|---|
| 629 | 739 | ), |
|---|
| 630 | 740 | |
|---|
| 631 | 741 | TP_fast_assign( |
|---|
| 632 | | - __entry->dev = rq->i915->drm.primary->index; |
|---|
| 633 | | - __entry->hw_id = rq->gem_context->hw_id; |
|---|
| 742 | + __entry->dev = rq->engine->i915->drm.primary->index; |
|---|
| 634 | 743 | __entry->class = rq->engine->uabi_class; |
|---|
| 635 | | - __entry->instance = rq->engine->instance; |
|---|
| 744 | + __entry->instance = rq->engine->uabi_instance; |
|---|
| 636 | 745 | __entry->ctx = rq->fence.context; |
|---|
| 637 | 746 | __entry->seqno = rq->fence.seqno; |
|---|
| 638 | 747 | __entry->flags = flags; |
|---|
| 639 | 748 | ), |
|---|
| 640 | 749 | |
|---|
| 641 | | - TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, flags=0x%x", |
|---|
| 750 | + TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, flags=0x%x", |
|---|
| 642 | 751 | __entry->dev, __entry->class, __entry->instance, |
|---|
| 643 | | - __entry->hw_id, __entry->ctx, __entry->seqno, |
|---|
| 644 | | - __entry->flags) |
|---|
| 752 | + __entry->ctx, __entry->seqno, __entry->flags) |
|---|
| 645 | 753 | ); |
|---|
| 646 | 754 | |
|---|
| 647 | 755 | DECLARE_EVENT_CLASS(i915_request, |
|---|
| .. | .. |
|---|
| 650 | 758 | |
|---|
| 651 | 759 | TP_STRUCT__entry( |
|---|
| 652 | 760 | __field(u32, dev) |
|---|
| 653 | | - __field(u32, hw_id) |
|---|
| 654 | 761 | __field(u64, ctx) |
|---|
| 655 | 762 | __field(u16, class) |
|---|
| 656 | 763 | __field(u16, instance) |
|---|
| 657 | 764 | __field(u32, seqno) |
|---|
| 658 | | - __field(u32, global) |
|---|
| 659 | 765 | ), |
|---|
| 660 | 766 | |
|---|
| 661 | 767 | TP_fast_assign( |
|---|
| 662 | | - __entry->dev = rq->i915->drm.primary->index; |
|---|
| 663 | | - __entry->hw_id = rq->gem_context->hw_id; |
|---|
| 768 | + __entry->dev = rq->engine->i915->drm.primary->index; |
|---|
| 664 | 769 | __entry->class = rq->engine->uabi_class; |
|---|
| 665 | | - __entry->instance = rq->engine->instance; |
|---|
| 770 | + __entry->instance = rq->engine->uabi_instance; |
|---|
| 666 | 771 | __entry->ctx = rq->fence.context; |
|---|
| 667 | 772 | __entry->seqno = rq->fence.seqno; |
|---|
| 668 | | - __entry->global = rq->global_seqno; |
|---|
| 669 | 773 | ), |
|---|
| 670 | 774 | |
|---|
| 671 | | - TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, global=%u", |
|---|
| 775 | + TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u", |
|---|
| 672 | 776 | __entry->dev, __entry->class, __entry->instance, |
|---|
| 673 | | - __entry->hw_id, __entry->ctx, __entry->seqno, |
|---|
| 674 | | - __entry->global) |
|---|
| 777 | + __entry->ctx, __entry->seqno) |
|---|
| 675 | 778 | ); |
|---|
| 676 | 779 | |
|---|
| 677 | 780 | DEFINE_EVENT(i915_request, i915_request_add, |
|---|
| .. | .. |
|---|
| 679 | 782 | TP_ARGS(rq) |
|---|
| 680 | 783 | ); |
|---|
| 681 | 784 | |
|---|
| 682 | | -#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) |
|---|
| 785 | +#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) && !defined(NOTRACE) |
|---|
| 683 | 786 | DEFINE_EVENT(i915_request, i915_request_submit, |
|---|
| 684 | 787 | TP_PROTO(struct i915_request *rq), |
|---|
| 685 | 788 | TP_ARGS(rq) |
|---|
| .. | .. |
|---|
| 696 | 799 | |
|---|
| 697 | 800 | TP_STRUCT__entry( |
|---|
| 698 | 801 | __field(u32, dev) |
|---|
| 699 | | - __field(u32, hw_id) |
|---|
| 700 | 802 | __field(u64, ctx) |
|---|
| 701 | 803 | __field(u16, class) |
|---|
| 702 | 804 | __field(u16, instance) |
|---|
| 703 | 805 | __field(u32, seqno) |
|---|
| 704 | | - __field(u32, global_seqno) |
|---|
| 705 | 806 | __field(u32, port) |
|---|
| 706 | | - __field(u32, prio) |
|---|
| 807 | + __field(s32, prio) |
|---|
| 707 | 808 | ), |
|---|
| 708 | 809 | |
|---|
| 709 | 810 | TP_fast_assign( |
|---|
| 710 | | - __entry->dev = rq->i915->drm.primary->index; |
|---|
| 711 | | - __entry->hw_id = rq->gem_context->hw_id; |
|---|
| 811 | + __entry->dev = rq->engine->i915->drm.primary->index; |
|---|
| 712 | 812 | __entry->class = rq->engine->uabi_class; |
|---|
| 713 | | - __entry->instance = rq->engine->instance; |
|---|
| 813 | + __entry->instance = rq->engine->uabi_instance; |
|---|
| 714 | 814 | __entry->ctx = rq->fence.context; |
|---|
| 715 | 815 | __entry->seqno = rq->fence.seqno; |
|---|
| 716 | | - __entry->global_seqno = rq->global_seqno; |
|---|
| 717 | 816 | __entry->prio = rq->sched.attr.priority; |
|---|
| 718 | 817 | __entry->port = port; |
|---|
| 719 | 818 | ), |
|---|
| 720 | 819 | |
|---|
| 721 | | - TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, prio=%u, global=%u, port=%u", |
|---|
| 820 | + TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, prio=%d, port=%u", |
|---|
| 722 | 821 | __entry->dev, __entry->class, __entry->instance, |
|---|
| 723 | | - __entry->hw_id, __entry->ctx, __entry->seqno, |
|---|
| 724 | | - __entry->prio, __entry->global_seqno, __entry->port) |
|---|
| 822 | + __entry->ctx, __entry->seqno, |
|---|
| 823 | + __entry->prio, __entry->port) |
|---|
| 725 | 824 | ); |
|---|
| 726 | 825 | |
|---|
| 727 | 826 | TRACE_EVENT(i915_request_out, |
|---|
| .. | .. |
|---|
| 730 | 829 | |
|---|
| 731 | 830 | TP_STRUCT__entry( |
|---|
| 732 | 831 | __field(u32, dev) |
|---|
| 733 | | - __field(u32, hw_id) |
|---|
| 734 | 832 | __field(u64, ctx) |
|---|
| 735 | 833 | __field(u16, class) |
|---|
| 736 | 834 | __field(u16, instance) |
|---|
| 737 | 835 | __field(u32, seqno) |
|---|
| 738 | | - __field(u32, global_seqno) |
|---|
| 739 | 836 | __field(u32, completed) |
|---|
| 740 | 837 | ), |
|---|
| 741 | 838 | |
|---|
| 742 | 839 | TP_fast_assign( |
|---|
| 743 | | - __entry->dev = rq->i915->drm.primary->index; |
|---|
| 744 | | - __entry->hw_id = rq->gem_context->hw_id; |
|---|
| 840 | + __entry->dev = rq->engine->i915->drm.primary->index; |
|---|
| 745 | 841 | __entry->class = rq->engine->uabi_class; |
|---|
| 746 | | - __entry->instance = rq->engine->instance; |
|---|
| 842 | + __entry->instance = rq->engine->uabi_instance; |
|---|
| 747 | 843 | __entry->ctx = rq->fence.context; |
|---|
| 748 | 844 | __entry->seqno = rq->fence.seqno; |
|---|
| 749 | | - __entry->global_seqno = rq->global_seqno; |
|---|
| 750 | 845 | __entry->completed = i915_request_completed(rq); |
|---|
| 751 | 846 | ), |
|---|
| 752 | 847 | |
|---|
| 753 | | - TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, global=%u, completed?=%u", |
|---|
| 848 | + TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, completed?=%u", |
|---|
| 754 | 849 | __entry->dev, __entry->class, __entry->instance, |
|---|
| 755 | | - __entry->hw_id, __entry->ctx, __entry->seqno, |
|---|
| 756 | | - __entry->global_seqno, __entry->completed) |
|---|
| 850 | + __entry->ctx, __entry->seqno, __entry->completed) |
|---|
| 757 | 851 | ); |
|---|
| 758 | 852 | |
|---|
| 759 | 853 | #else |
|---|
| .. | .. |
|---|
| 780 | 874 | #endif |
|---|
| 781 | 875 | #endif |
|---|
| 782 | 876 | |
|---|
| 783 | | -TRACE_EVENT(intel_engine_notify, |
|---|
| 784 | | - TP_PROTO(struct intel_engine_cs *engine, bool waiters), |
|---|
| 785 | | - TP_ARGS(engine, waiters), |
|---|
| 786 | | - |
|---|
| 787 | | - TP_STRUCT__entry( |
|---|
| 788 | | - __field(u32, dev) |
|---|
| 789 | | - __field(u16, class) |
|---|
| 790 | | - __field(u16, instance) |
|---|
| 791 | | - __field(u32, seqno) |
|---|
| 792 | | - __field(bool, waiters) |
|---|
| 793 | | - ), |
|---|
| 794 | | - |
|---|
| 795 | | - TP_fast_assign( |
|---|
| 796 | | - __entry->dev = engine->i915->drm.primary->index; |
|---|
| 797 | | - __entry->class = engine->uabi_class; |
|---|
| 798 | | - __entry->instance = engine->instance; |
|---|
| 799 | | - __entry->seqno = intel_engine_get_seqno(engine); |
|---|
| 800 | | - __entry->waiters = waiters; |
|---|
| 801 | | - ), |
|---|
| 802 | | - |
|---|
| 803 | | - TP_printk("dev=%u, engine=%u:%u, seqno=%u, waiters=%u", |
|---|
| 804 | | - __entry->dev, __entry->class, __entry->instance, |
|---|
| 805 | | - __entry->seqno, __entry->waiters) |
|---|
| 806 | | -); |
|---|
| 807 | | - |
|---|
| 808 | 877 | DEFINE_EVENT(i915_request, i915_request_retire, |
|---|
| 809 | 878 | TP_PROTO(struct i915_request *rq), |
|---|
| 810 | 879 | TP_ARGS(rq) |
|---|
| .. | .. |
|---|
| 816 | 885 | |
|---|
| 817 | 886 | TP_STRUCT__entry( |
|---|
| 818 | 887 | __field(u32, dev) |
|---|
| 819 | | - __field(u32, hw_id) |
|---|
| 820 | 888 | __field(u64, ctx) |
|---|
| 821 | 889 | __field(u16, class) |
|---|
| 822 | 890 | __field(u16, instance) |
|---|
| 823 | 891 | __field(u32, seqno) |
|---|
| 824 | | - __field(u32, global) |
|---|
| 825 | 892 | __field(unsigned int, flags) |
|---|
| 826 | 893 | ), |
|---|
| 827 | 894 | |
|---|
| .. | .. |
|---|
| 832 | 899 | * less desirable. |
|---|
| 833 | 900 | */ |
|---|
| 834 | 901 | TP_fast_assign( |
|---|
| 835 | | - __entry->dev = rq->i915->drm.primary->index; |
|---|
| 836 | | - __entry->hw_id = rq->gem_context->hw_id; |
|---|
| 902 | + __entry->dev = rq->engine->i915->drm.primary->index; |
|---|
| 837 | 903 | __entry->class = rq->engine->uabi_class; |
|---|
| 838 | | - __entry->instance = rq->engine->instance; |
|---|
| 904 | + __entry->instance = rq->engine->uabi_instance; |
|---|
| 839 | 905 | __entry->ctx = rq->fence.context; |
|---|
| 840 | 906 | __entry->seqno = rq->fence.seqno; |
|---|
| 841 | | - __entry->global = rq->global_seqno; |
|---|
| 842 | 907 | __entry->flags = flags; |
|---|
| 843 | 908 | ), |
|---|
| 844 | 909 | |
|---|
| 845 | | - TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, global=%u, blocking=%u, flags=0x%x", |
|---|
| 910 | + TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, flags=0x%x", |
|---|
| 846 | 911 | __entry->dev, __entry->class, __entry->instance, |
|---|
| 847 | | - __entry->hw_id, __entry->ctx, __entry->seqno, |
|---|
| 848 | | - __entry->global, !!(__entry->flags & I915_WAIT_LOCKED), |
|---|
| 912 | + __entry->ctx, __entry->seqno, |
|---|
| 849 | 913 | __entry->flags) |
|---|
| 850 | 914 | ); |
|---|
| 851 | 915 | |
|---|
| .. | .. |
|---|
| 948 | 1012 | TP_STRUCT__entry( |
|---|
| 949 | 1013 | __field(u32, dev) |
|---|
| 950 | 1014 | __field(struct i915_gem_context *, ctx) |
|---|
| 951 | | - __field(u32, hw_id) |
|---|
| 952 | 1015 | __field(struct i915_address_space *, vm) |
|---|
| 953 | 1016 | ), |
|---|
| 954 | 1017 | |
|---|
| 955 | 1018 | TP_fast_assign( |
|---|
| 956 | 1019 | __entry->dev = ctx->i915->drm.primary->index; |
|---|
| 957 | 1020 | __entry->ctx = ctx; |
|---|
| 958 | | - __entry->hw_id = ctx->hw_id; |
|---|
| 959 | | - __entry->vm = ctx->ppgtt ? &ctx->ppgtt->vm : NULL; |
|---|
| 1021 | + __entry->vm = rcu_access_pointer(ctx->vm); |
|---|
| 960 | 1022 | ), |
|---|
| 961 | 1023 | |
|---|
| 962 | | - TP_printk("dev=%u, ctx=%p, ctx_vm=%p, hw_id=%u", |
|---|
| 963 | | - __entry->dev, __entry->ctx, __entry->vm, __entry->hw_id) |
|---|
| 1024 | + TP_printk("dev=%u, ctx=%p, ctx_vm=%p", |
|---|
| 1025 | + __entry->dev, __entry->ctx, __entry->vm) |
|---|
| 964 | 1026 | ) |
|---|
| 965 | 1027 | |
|---|
| 966 | 1028 | DEFINE_EVENT(i915_context, i915_context_create, |
|---|