| 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright © 2021 Intel Corporation |
| 4 | */ |
| 5 | |
| 6 | #undef TRACE_SYSTEM |
| 7 | #ifdef I915 |
| 8 | #define TRACE_SYSTEM i915 |
| 9 | #else |
| 10 | #define TRACE_SYSTEM xe |
| 11 | #endif |
| 12 | |
| 13 | #if !defined(__INTEL_DISPLAY_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ) |
| 14 | #define __INTEL_DISPLAY_TRACE_H__ |
| 15 | |
| 16 | #include <linux/string.h> |
| 17 | #include <linux/string_helpers.h> |
| 18 | #include <linux/types.h> |
| 19 | #include <linux/tracepoint.h> |
| 20 | |
| 21 | #include "intel_crtc.h" |
| 22 | #include "intel_display_core.h" |
| 23 | #include "intel_display_limits.h" |
| 24 | #include "intel_display_types.h" |
| 25 | #include "intel_vblank.h" |
| 26 | |
| 27 | #define __dev_name_display(display) dev_name((display)->drm->dev) |
| 28 | #define __dev_name_drm(obj) dev_name((obj)->dev->dev) |
| 29 | #define __dev_name_kms(obj) dev_name((obj)->base.dev->dev) |
| 30 | |
| 31 | /* |
| 32 | * Using identifiers from enum pipe in TP_printk() will confuse tools that |
| 33 | * parse /sys/kernel/debug/tracing/{xe,i915}/<event>/format. So we use CPP |
| 34 | * macros instead. |
| 35 | */ |
| 36 | #define _TRACE_PIPE_A 0 |
| 37 | #define _TRACE_PIPE_B 1 |
| 38 | #define _TRACE_PIPE_C 2 |
| 39 | #define _TRACE_PIPE_D 3 |
| 40 | |
| 41 | /* |
| 42 | * FIXME: Several TP_printk() calls below display frame and scanline numbers for |
| 43 | * all possible pipes (regardless of whether they are available) and that is |
| 44 | * done with a constant format string. A better approach would be to generate |
| 45 | * that info dynamically based on available pipes, but, while we do not have |
| 46 | * that implemented yet, let's assert that the constant format string indeed |
| 47 | * covers all possible pipes. |
| 48 | */ |
| 49 | static_assert(I915_MAX_PIPES - 1 == _TRACE_PIPE_D); |
| 50 | |
| 51 | #define _PIPES_FRAME_AND_SCANLINE_FMT \ |
| 52 | "pipe A: frame=%u, scanline=%u" \ |
| 53 | ", pipe B: frame=%u, scanline=%u" \ |
| 54 | ", pipe C: frame=%u, scanline=%u" \ |
| 55 | ", pipe D: frame=%u, scanline=%u" |
| 56 | |
| 57 | #define _PIPES_FRAME_AND_SCANLINE_VALUES \ |
| 58 | __entry->frame[_TRACE_PIPE_A], __entry->scanline[_TRACE_PIPE_A] \ |
| 59 | , __entry->frame[_TRACE_PIPE_B], __entry->scanline[_TRACE_PIPE_B] \ |
| 60 | , __entry->frame[_TRACE_PIPE_C], __entry->scanline[_TRACE_PIPE_C] \ |
| 61 | , __entry->frame[_TRACE_PIPE_D], __entry->scanline[_TRACE_PIPE_D] |
| 62 | |
| 63 | /* |
| 64 | * Paranoid sanity check that at least the enumeration starts at the |
| 65 | * same value as _TRACE_PIPE_A. |
| 66 | */ |
| 67 | static_assert(PIPE_A == _TRACE_PIPE_A); |
| 68 | |
| 69 | TRACE_EVENT(intel_pipe_enable, |
| 70 | TP_PROTO(struct intel_crtc *crtc), |
| 71 | TP_ARGS(crtc), |
| 72 | |
| 73 | TP_STRUCT__entry( |
| 74 | __string(dev, __dev_name_kms(crtc)) |
| 75 | __array(u32, frame, I915_MAX_PIPES) |
| 76 | __array(u32, scanline, I915_MAX_PIPES) |
| 77 | __field(char, pipe_name) |
| 78 | ), |
| 79 | TP_fast_assign( |
| 80 | struct intel_display *display = to_intel_display(crtc); |
| 81 | struct intel_crtc *it__; |
| 82 | __assign_str(dev); |
| 83 | memset(__entry->frame, 0, |
| 84 | sizeof(__entry->frame[0]) * I915_MAX_PIPES); |
| 85 | memset(__entry->scanline, 0, |
| 86 | sizeof(__entry->scanline[0]) * I915_MAX_PIPES); |
| 87 | for_each_intel_crtc(display->drm, it__) { |
| 88 | __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__); |
| 89 | __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__); |
| 90 | } |
| 91 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 92 | ), |
| 93 | |
| 94 | TP_printk("dev %s, pipe %c enable, " _PIPES_FRAME_AND_SCANLINE_FMT, |
| 95 | __get_str(dev), __entry->pipe_name, _PIPES_FRAME_AND_SCANLINE_VALUES) |
| 96 | ); |
| 97 | |
| 98 | TRACE_EVENT(intel_pipe_disable, |
| 99 | TP_PROTO(struct intel_crtc *crtc), |
| 100 | TP_ARGS(crtc), |
| 101 | |
| 102 | TP_STRUCT__entry( |
| 103 | __string(dev, __dev_name_kms(crtc)) |
| 104 | __array(u32, frame, I915_MAX_PIPES) |
| 105 | __array(u32, scanline, I915_MAX_PIPES) |
| 106 | __field(char, pipe_name) |
| 107 | ), |
| 108 | |
| 109 | TP_fast_assign( |
| 110 | struct intel_display *display = to_intel_display(crtc); |
| 111 | struct intel_crtc *it__; |
| 112 | __assign_str(dev); |
| 113 | memset(__entry->frame, 0, |
| 114 | sizeof(__entry->frame[0]) * I915_MAX_PIPES); |
| 115 | memset(__entry->scanline, 0, |
| 116 | sizeof(__entry->scanline[0]) * I915_MAX_PIPES); |
| 117 | for_each_intel_crtc(display->drm, it__) { |
| 118 | __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__); |
| 119 | __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__); |
| 120 | } |
| 121 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 122 | ), |
| 123 | |
| 124 | TP_printk("dev %s, pipe %c disable, " _PIPES_FRAME_AND_SCANLINE_FMT, |
| 125 | __get_str(dev), __entry->pipe_name, _PIPES_FRAME_AND_SCANLINE_VALUES) |
| 126 | ); |
| 127 | |
| 128 | TRACE_EVENT(intel_crtc_flip_done, |
| 129 | TP_PROTO(struct intel_crtc *crtc), |
| 130 | TP_ARGS(crtc), |
| 131 | |
| 132 | TP_STRUCT__entry( |
| 133 | __string(dev, __dev_name_kms(crtc)) |
| 134 | __field(char, pipe_name) |
| 135 | __field(u32, frame) |
| 136 | __field(u32, scanline) |
| 137 | ), |
| 138 | |
| 139 | TP_fast_assign( |
| 140 | __assign_str(dev); |
| 141 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 142 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 143 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 144 | ), |
| 145 | |
| 146 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u" , |
| 147 | __get_str(dev), __entry->pipe_name, |
| 148 | __entry->frame, __entry->scanline) |
| 149 | ); |
| 150 | |
| 151 | TRACE_EVENT(intel_pipe_crc, |
| 152 | TP_PROTO(struct intel_crtc *crtc, const u32 *crcs), |
| 153 | TP_ARGS(crtc, crcs), |
| 154 | |
| 155 | TP_STRUCT__entry( |
| 156 | __string(dev, __dev_name_kms(crtc)) |
| 157 | __field(char, pipe_name) |
| 158 | __field(u32, frame) |
| 159 | __field(u32, scanline) |
| 160 | __array(u32, crcs, 5) |
| 161 | ), |
| 162 | |
| 163 | TP_fast_assign( |
| 164 | __assign_str(dev); |
| 165 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 166 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 167 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 168 | memcpy(__entry->crcs, crcs, sizeof(__entry->crcs)); |
| 169 | ), |
| 170 | |
| 171 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u crc=%08x %08x %08x %08x %08x" , |
| 172 | __get_str(dev), __entry->pipe_name, |
| 173 | __entry->frame, __entry->scanline, |
| 174 | __entry->crcs[0], __entry->crcs[1], |
| 175 | __entry->crcs[2], __entry->crcs[3], |
| 176 | __entry->crcs[4]) |
| 177 | ); |
| 178 | |
| 179 | TRACE_EVENT(intel_cpu_fifo_underrun, |
| 180 | TP_PROTO(struct intel_display *display, enum pipe pipe), |
| 181 | TP_ARGS(display, pipe), |
| 182 | |
| 183 | TP_STRUCT__entry( |
| 184 | __string(dev, __dev_name_display(display)) |
| 185 | __field(char, pipe_name) |
| 186 | __field(u32, frame) |
| 187 | __field(u32, scanline) |
| 188 | ), |
| 189 | |
| 190 | TP_fast_assign( |
| 191 | struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe); |
| 192 | __assign_str(dev); |
| 193 | __entry->pipe_name = pipe_name(pipe); |
| 194 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 195 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 196 | ), |
| 197 | |
| 198 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u" , |
| 199 | __get_str(dev), __entry->pipe_name, |
| 200 | __entry->frame, __entry->scanline) |
| 201 | ); |
| 202 | |
| 203 | TRACE_EVENT(intel_pch_fifo_underrun, |
| 204 | TP_PROTO(struct intel_display *display, enum pipe pch_transcoder), |
| 205 | TP_ARGS(display, pch_transcoder), |
| 206 | |
| 207 | TP_STRUCT__entry( |
| 208 | __string(dev, __dev_name_display(display)) |
| 209 | __field(char, pipe_name) |
| 210 | __field(u32, frame) |
| 211 | __field(u32, scanline) |
| 212 | ), |
| 213 | |
| 214 | TP_fast_assign( |
| 215 | enum pipe pipe = pch_transcoder; |
| 216 | struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe); |
| 217 | __assign_str(dev); |
| 218 | __entry->pipe_name = pipe_name(pipe); |
| 219 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 220 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 221 | ), |
| 222 | |
| 223 | TP_printk("dev %s, pch transcoder %c, frame=%u, scanline=%u" , |
| 224 | __get_str(dev), __entry->pipe_name, |
| 225 | __entry->frame, __entry->scanline) |
| 226 | ); |
| 227 | |
| 228 | TRACE_EVENT(intel_memory_cxsr, |
| 229 | TP_PROTO(struct intel_display *display, bool old, bool new), |
| 230 | TP_ARGS(display, old, new), |
| 231 | |
| 232 | TP_STRUCT__entry( |
| 233 | __string(dev, __dev_name_display(display)) |
| 234 | __array(u32, frame, I915_MAX_PIPES) |
| 235 | __array(u32, scanline, I915_MAX_PIPES) |
| 236 | __field(bool, old) |
| 237 | __field(bool, new) |
| 238 | ), |
| 239 | |
| 240 | TP_fast_assign( |
| 241 | struct intel_crtc *crtc; |
| 242 | __assign_str(dev); |
| 243 | memset(__entry->frame, 0, |
| 244 | sizeof(__entry->frame[0]) * I915_MAX_PIPES); |
| 245 | memset(__entry->scanline, 0, |
| 246 | sizeof(__entry->scanline[0]) * I915_MAX_PIPES); |
| 247 | for_each_intel_crtc(display->drm, crtc) { |
| 248 | __entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc); |
| 249 | __entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc); |
| 250 | } |
| 251 | __entry->old = old; |
| 252 | __entry->new = new; |
| 253 | ), |
| 254 | |
| 255 | TP_printk("dev %s, cxsr %s->%s, " _PIPES_FRAME_AND_SCANLINE_FMT, |
| 256 | __get_str(dev), str_on_off(__entry->old), str_on_off(__entry->new), |
| 257 | _PIPES_FRAME_AND_SCANLINE_VALUES) |
| 258 | ); |
| 259 | |
| 260 | TRACE_EVENT(g4x_wm, |
| 261 | TP_PROTO(struct intel_crtc *crtc, const struct g4x_wm_values *wm), |
| 262 | TP_ARGS(crtc, wm), |
| 263 | |
| 264 | TP_STRUCT__entry( |
| 265 | __string(dev, __dev_name_kms(crtc)) |
| 266 | __field(char, pipe_name) |
| 267 | __field(u32, frame) |
| 268 | __field(u32, scanline) |
| 269 | __field(u16, primary) |
| 270 | __field(u16, sprite) |
| 271 | __field(u16, cursor) |
| 272 | __field(u16, sr_plane) |
| 273 | __field(u16, sr_cursor) |
| 274 | __field(u16, sr_fbc) |
| 275 | __field(u16, hpll_plane) |
| 276 | __field(u16, hpll_cursor) |
| 277 | __field(u16, hpll_fbc) |
| 278 | __field(bool, cxsr) |
| 279 | __field(bool, hpll) |
| 280 | __field(bool, fbc) |
| 281 | ), |
| 282 | |
| 283 | TP_fast_assign( |
| 284 | __assign_str(dev); |
| 285 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 286 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 287 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 288 | __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY]; |
| 289 | __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0]; |
| 290 | __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR]; |
| 291 | __entry->sr_plane = wm->sr.plane; |
| 292 | __entry->sr_cursor = wm->sr.cursor; |
| 293 | __entry->sr_fbc = wm->sr.fbc; |
| 294 | __entry->hpll_plane = wm->hpll.plane; |
| 295 | __entry->hpll_cursor = wm->hpll.cursor; |
| 296 | __entry->hpll_fbc = wm->hpll.fbc; |
| 297 | __entry->cxsr = wm->cxsr; |
| 298 | __entry->hpll = wm->hpll_en; |
| 299 | __entry->fbc = wm->fbc_en; |
| 300 | ), |
| 301 | |
| 302 | 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" , |
| 303 | __get_str(dev), __entry->pipe_name, |
| 304 | __entry->frame, __entry->scanline, |
| 305 | __entry->primary, __entry->sprite, __entry->cursor, |
| 306 | str_yes_no(__entry->cxsr), __entry->sr_plane, __entry->sr_cursor, __entry->sr_fbc, |
| 307 | str_yes_no(__entry->hpll), __entry->hpll_plane, __entry->hpll_cursor, __entry->hpll_fbc, |
| 308 | str_yes_no(__entry->fbc)) |
| 309 | ); |
| 310 | |
| 311 | TRACE_EVENT(vlv_wm, |
| 312 | TP_PROTO(struct intel_crtc *crtc, const struct vlv_wm_values *wm), |
| 313 | TP_ARGS(crtc, wm), |
| 314 | |
| 315 | TP_STRUCT__entry( |
| 316 | __string(dev, __dev_name_kms(crtc)) |
| 317 | __field(char, pipe_name) |
| 318 | __field(u32, frame) |
| 319 | __field(u32, scanline) |
| 320 | __field(u32, level) |
| 321 | __field(u32, cxsr) |
| 322 | __field(u32, primary) |
| 323 | __field(u32, sprite0) |
| 324 | __field(u32, sprite1) |
| 325 | __field(u32, cursor) |
| 326 | __field(u32, sr_plane) |
| 327 | __field(u32, sr_cursor) |
| 328 | ), |
| 329 | |
| 330 | TP_fast_assign( |
| 331 | __assign_str(dev); |
| 332 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 333 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 334 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 335 | __entry->level = wm->level; |
| 336 | __entry->cxsr = wm->cxsr; |
| 337 | __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY]; |
| 338 | __entry->sprite0 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0]; |
| 339 | __entry->sprite1 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE1]; |
| 340 | __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR]; |
| 341 | __entry->sr_plane = wm->sr.plane; |
| 342 | __entry->sr_cursor = wm->sr.cursor; |
| 343 | ), |
| 344 | |
| 345 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d" , |
| 346 | __get_str(dev), __entry->pipe_name, |
| 347 | __entry->frame, __entry->scanline, |
| 348 | __entry->level, __entry->cxsr, |
| 349 | __entry->primary, __entry->sprite0, __entry->sprite1, __entry->cursor, |
| 350 | __entry->sr_plane, __entry->sr_cursor) |
| 351 | ); |
| 352 | |
| 353 | TRACE_EVENT(vlv_fifo_size, |
| 354 | TP_PROTO(struct intel_crtc *crtc, u32 sprite0_start, u32 sprite1_start, u32 fifo_size), |
| 355 | TP_ARGS(crtc, sprite0_start, sprite1_start, fifo_size), |
| 356 | |
| 357 | TP_STRUCT__entry( |
| 358 | __string(dev, __dev_name_kms(crtc)) |
| 359 | __field(char, pipe_name) |
| 360 | __field(u32, frame) |
| 361 | __field(u32, scanline) |
| 362 | __field(u32, sprite0_start) |
| 363 | __field(u32, sprite1_start) |
| 364 | __field(u32, fifo_size) |
| 365 | ), |
| 366 | |
| 367 | TP_fast_assign( |
| 368 | __assign_str(dev); |
| 369 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 370 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 371 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 372 | __entry->sprite0_start = sprite0_start; |
| 373 | __entry->sprite1_start = sprite1_start; |
| 374 | __entry->fifo_size = fifo_size; |
| 375 | ), |
| 376 | |
| 377 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, %d/%d/%d" , |
| 378 | __get_str(dev), __entry->pipe_name, |
| 379 | __entry->frame, __entry->scanline, |
| 380 | __entry->sprite0_start, __entry->sprite1_start, __entry->fifo_size) |
| 381 | ); |
| 382 | |
| 383 | TRACE_EVENT(intel_plane_async_flip, |
| 384 | TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc, bool async_flip), |
| 385 | TP_ARGS(plane, crtc, async_flip), |
| 386 | |
| 387 | TP_STRUCT__entry( |
| 388 | __string(dev, __dev_name_kms(plane)) |
| 389 | __field(char, pipe_name) |
| 390 | __field(u32, frame) |
| 391 | __field(u32, scanline) |
| 392 | __field(bool, async_flip) |
| 393 | __string(name, plane->base.name) |
| 394 | ), |
| 395 | |
| 396 | TP_fast_assign( |
| 397 | __assign_str(dev); |
| 398 | __assign_str(name); |
| 399 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 400 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 401 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 402 | __entry->async_flip = async_flip; |
| 403 | ), |
| 404 | |
| 405 | TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u, async_flip=%s" , |
| 406 | __get_str(dev), __entry->pipe_name, __get_str(name), |
| 407 | __entry->frame, __entry->scanline, str_yes_no(__entry->async_flip)) |
| 408 | ); |
| 409 | |
| 410 | TRACE_EVENT(intel_plane_update_noarm, |
| 411 | TP_PROTO(const struct intel_plane_state *plane_state, struct intel_crtc *crtc), |
| 412 | TP_ARGS(plane_state, crtc), |
| 413 | |
| 414 | TP_STRUCT__entry( |
| 415 | __string(dev, __dev_name_drm(plane_state->uapi.plane)) |
| 416 | __field(char, pipe_name) |
| 417 | __field(u32, frame) |
| 418 | __field(u32, scanline) |
| 419 | __field(u32, format) |
| 420 | __array(int, src, 4) |
| 421 | __array(int, dst, 4) |
| 422 | __string(name, plane_state->uapi.plane->name) |
| 423 | ), |
| 424 | |
| 425 | TP_fast_assign( |
| 426 | __assign_str(dev); |
| 427 | __assign_str(name); |
| 428 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 429 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 430 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 431 | __entry->format = plane_state->hw.fb->format->format; |
| 432 | memcpy(__entry->src, &plane_state->uapi.src, sizeof(__entry->src)); |
| 433 | memcpy(__entry->dst, &plane_state->uapi.dst, sizeof(__entry->dst)); |
| 434 | ), |
| 435 | |
| 436 | TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u, format=%p4cc, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT, |
| 437 | __get_str(dev), __entry->pipe_name, __get_str(name), |
| 438 | __entry->frame, __entry->scanline, &__entry->format, |
| 439 | DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src), |
| 440 | DRM_RECT_ARG((const struct drm_rect *)__entry->dst)) |
| 441 | ); |
| 442 | |
| 443 | TRACE_EVENT(intel_plane_update_arm, |
| 444 | TP_PROTO(const struct intel_plane_state *plane_state, struct intel_crtc *crtc), |
| 445 | TP_ARGS(plane_state, crtc), |
| 446 | |
| 447 | TP_STRUCT__entry( |
| 448 | __string(dev, __dev_name_drm(plane_state->uapi.plane)) |
| 449 | __field(char, pipe_name) |
| 450 | __field(u32, frame) |
| 451 | __field(u32, scanline) |
| 452 | __field(u32, format) |
| 453 | __array(int, src, 4) |
| 454 | __array(int, dst, 4) |
| 455 | __string(name, plane_state->uapi.plane->name) |
| 456 | ), |
| 457 | |
| 458 | TP_fast_assign( |
| 459 | __assign_str(dev); |
| 460 | __assign_str(name); |
| 461 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 462 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 463 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 464 | __entry->format = plane_state->hw.fb->format->format; |
| 465 | memcpy(__entry->src, &plane_state->uapi.src, sizeof(__entry->src)); |
| 466 | memcpy(__entry->dst, &plane_state->uapi.dst, sizeof(__entry->dst)); |
| 467 | ), |
| 468 | |
| 469 | TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u, format=%p4cc, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT, |
| 470 | __get_str(dev), __entry->pipe_name, __get_str(name), |
| 471 | __entry->frame, __entry->scanline, &__entry->format, |
| 472 | DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src), |
| 473 | DRM_RECT_ARG((const struct drm_rect *)__entry->dst)) |
| 474 | ); |
| 475 | |
| 476 | TRACE_EVENT(intel_plane_disable_arm, |
| 477 | TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc), |
| 478 | TP_ARGS(plane, crtc), |
| 479 | |
| 480 | TP_STRUCT__entry( |
| 481 | __string(dev, __dev_name_kms(plane)) |
| 482 | __field(char, pipe_name) |
| 483 | __field(u32, frame) |
| 484 | __field(u32, scanline) |
| 485 | __string(name, plane->base.name) |
| 486 | ), |
| 487 | |
| 488 | TP_fast_assign( |
| 489 | __assign_str(dev); |
| 490 | __assign_str(name); |
| 491 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 492 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 493 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 494 | ), |
| 495 | |
| 496 | TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u" , |
| 497 | __get_str(dev), __entry->pipe_name, __get_str(name), |
| 498 | __entry->frame, __entry->scanline) |
| 499 | ); |
| 500 | |
| 501 | TRACE_EVENT(intel_plane_scaler_update_arm, |
| 502 | TP_PROTO(struct intel_plane *plane, |
| 503 | int scaler_id, int x, int y, int w, int h), |
| 504 | TP_ARGS(plane, scaler_id, x, y, w, h), |
| 505 | |
| 506 | TP_STRUCT__entry( |
| 507 | __string(dev, __dev_name_kms(plane)) |
| 508 | __field(char, pipe_name) |
| 509 | __field(int, scaler_id) |
| 510 | __field(u32, frame) |
| 511 | __field(u32, scanline) |
| 512 | __field(int, x) |
| 513 | __field(int, y) |
| 514 | __field(int, w) |
| 515 | __field(int, h) |
| 516 | __string(name, plane->base.name) |
| 517 | ), |
| 518 | |
| 519 | TP_fast_assign( |
| 520 | struct intel_display *display = to_intel_display(plane); |
| 521 | struct intel_crtc *crtc = intel_crtc_for_pipe(display, plane->pipe); |
| 522 | __assign_str(dev); |
| 523 | __assign_str(name); |
| 524 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 525 | __entry->scaler_id = scaler_id; |
| 526 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 527 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 528 | __entry->x = x; |
| 529 | __entry->y = y; |
| 530 | __entry->w = w; |
| 531 | __entry->h = h; |
| 532 | ), |
| 533 | |
| 534 | TP_printk("dev %s, pipe %c, scaler %d, plane %s, frame=%u, scanline=%u, " DRM_RECT_FMT, |
| 535 | __get_str(dev), __entry->pipe_name, __entry->scaler_id, |
| 536 | __get_str(name), __entry->frame, __entry->scanline, |
| 537 | __entry->w, __entry->h, __entry->x, __entry->y) |
| 538 | ); |
| 539 | |
| 540 | TRACE_EVENT(intel_pipe_scaler_update_arm, |
| 541 | TP_PROTO(struct intel_crtc *crtc, int scaler_id, |
| 542 | int x, int y, int w, int h), |
| 543 | TP_ARGS(crtc, scaler_id, x, y, w, h), |
| 544 | |
| 545 | TP_STRUCT__entry( |
| 546 | __string(dev, __dev_name_kms(crtc)) |
| 547 | __field(char, pipe_name) |
| 548 | __field(int, scaler_id) |
| 549 | __field(u32, frame) |
| 550 | __field(u32, scanline) |
| 551 | __field(int, x) |
| 552 | __field(int, y) |
| 553 | __field(int, w) |
| 554 | __field(int, h) |
| 555 | ), |
| 556 | |
| 557 | TP_fast_assign( |
| 558 | __assign_str(dev); |
| 559 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 560 | __entry->scaler_id = scaler_id; |
| 561 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 562 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 563 | __entry->x = x; |
| 564 | __entry->y = y; |
| 565 | __entry->w = w; |
| 566 | __entry->h = h; |
| 567 | ), |
| 568 | |
| 569 | TP_printk("dev %s, pipe %c, scaler %d frame=%u, scanline=%u, " DRM_RECT_FMT, |
| 570 | __get_str(dev), __entry->pipe_name, __entry->scaler_id, |
| 571 | __entry->frame, __entry->scanline, |
| 572 | __entry->w, __entry->h, __entry->x, __entry->y) |
| 573 | ); |
| 574 | |
| 575 | TRACE_EVENT(intel_scaler_disable_arm, |
| 576 | TP_PROTO(struct intel_crtc *crtc, int scaler_id), |
| 577 | TP_ARGS(crtc, scaler_id), |
| 578 | |
| 579 | TP_STRUCT__entry( |
| 580 | __string(dev, __dev_name_kms(crtc)) |
| 581 | __field(char, pipe_name) |
| 582 | __field(int, scaler_id) |
| 583 | __field(u32, frame) |
| 584 | __field(u32, scanline) |
| 585 | ), |
| 586 | |
| 587 | TP_fast_assign( |
| 588 | __assign_str(dev); |
| 589 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 590 | __entry->scaler_id = scaler_id; |
| 591 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 592 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 593 | ), |
| 594 | |
| 595 | TP_printk("dev %s, pipe %c, scaler %d, frame=%u, scanline=%u" , |
| 596 | __get_str(dev), __entry->pipe_name, __entry->scaler_id, |
| 597 | __entry->frame, __entry->scanline) |
| 598 | ); |
| 599 | |
| 600 | TRACE_EVENT(intel_fbc_activate, |
| 601 | TP_PROTO(struct intel_plane *plane), |
| 602 | TP_ARGS(plane), |
| 603 | |
| 604 | TP_STRUCT__entry( |
| 605 | __string(dev, __dev_name_kms(plane)) |
| 606 | __string(name, plane->base.name) |
| 607 | __field(char, pipe_name) |
| 608 | __field(u32, frame) |
| 609 | __field(u32, scanline) |
| 610 | ), |
| 611 | |
| 612 | TP_fast_assign( |
| 613 | struct intel_display *display = to_intel_display(plane->base.dev); |
| 614 | struct intel_crtc *crtc = intel_crtc_for_pipe(display, |
| 615 | plane->pipe); |
| 616 | __assign_str(dev); |
| 617 | __assign_str(name); |
| 618 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 619 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 620 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 621 | ), |
| 622 | |
| 623 | TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u" , |
| 624 | __get_str(dev), __entry->pipe_name, __get_str(name), |
| 625 | __entry->frame, __entry->scanline) |
| 626 | ); |
| 627 | |
| 628 | TRACE_EVENT(intel_fbc_deactivate, |
| 629 | TP_PROTO(struct intel_plane *plane), |
| 630 | TP_ARGS(plane), |
| 631 | |
| 632 | TP_STRUCT__entry( |
| 633 | __string(dev, __dev_name_kms(plane)) |
| 634 | __string(name, plane->base.name) |
| 635 | __field(char, pipe_name) |
| 636 | __field(u32, frame) |
| 637 | __field(u32, scanline) |
| 638 | ), |
| 639 | |
| 640 | TP_fast_assign( |
| 641 | struct intel_display *display = to_intel_display(plane->base.dev); |
| 642 | struct intel_crtc *crtc = intel_crtc_for_pipe(display, |
| 643 | plane->pipe); |
| 644 | __assign_str(dev); |
| 645 | __assign_str(name); |
| 646 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 647 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 648 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 649 | ), |
| 650 | |
| 651 | TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u" , |
| 652 | __get_str(dev), __entry->pipe_name, __get_str(name), |
| 653 | __entry->frame, __entry->scanline) |
| 654 | ); |
| 655 | |
| 656 | TRACE_EVENT(intel_fbc_nuke, |
| 657 | TP_PROTO(struct intel_plane *plane), |
| 658 | TP_ARGS(plane), |
| 659 | |
| 660 | TP_STRUCT__entry( |
| 661 | __string(dev, __dev_name_kms(plane)) |
| 662 | __string(name, plane->base.name) |
| 663 | __field(char, pipe_name) |
| 664 | __field(u32, frame) |
| 665 | __field(u32, scanline) |
| 666 | ), |
| 667 | |
| 668 | TP_fast_assign( |
| 669 | struct intel_display *display = to_intel_display(plane->base.dev); |
| 670 | struct intel_crtc *crtc = intel_crtc_for_pipe(display, |
| 671 | plane->pipe); |
| 672 | __assign_str(dev); |
| 673 | __assign_str(name); |
| 674 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 675 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 676 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 677 | ), |
| 678 | |
| 679 | TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u" , |
| 680 | __get_str(dev), __entry->pipe_name, __get_str(name), |
| 681 | __entry->frame, __entry->scanline) |
| 682 | ); |
| 683 | |
| 684 | TRACE_EVENT(intel_crtc_vblank_work_start, |
| 685 | TP_PROTO(struct intel_crtc *crtc), |
| 686 | TP_ARGS(crtc), |
| 687 | |
| 688 | TP_STRUCT__entry( |
| 689 | __string(dev, __dev_name_kms(crtc)) |
| 690 | __field(char, pipe_name) |
| 691 | __field(u32, frame) |
| 692 | __field(u32, scanline) |
| 693 | ), |
| 694 | |
| 695 | TP_fast_assign( |
| 696 | __assign_str(dev); |
| 697 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 698 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 699 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 700 | ), |
| 701 | |
| 702 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u" , |
| 703 | __get_str(dev), __entry->pipe_name, |
| 704 | __entry->frame, __entry->scanline) |
| 705 | ); |
| 706 | |
| 707 | TRACE_EVENT(intel_crtc_vblank_work_end, |
| 708 | TP_PROTO(struct intel_crtc *crtc), |
| 709 | TP_ARGS(crtc), |
| 710 | |
| 711 | TP_STRUCT__entry( |
| 712 | __string(dev, __dev_name_kms(crtc)) |
| 713 | __field(char, pipe_name) |
| 714 | __field(u32, frame) |
| 715 | __field(u32, scanline) |
| 716 | ), |
| 717 | |
| 718 | TP_fast_assign( |
| 719 | __assign_str(dev); |
| 720 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 721 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 722 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 723 | ), |
| 724 | |
| 725 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u" , |
| 726 | __get_str(dev), __entry->pipe_name, |
| 727 | __entry->frame, __entry->scanline) |
| 728 | ); |
| 729 | |
| 730 | TRACE_EVENT(intel_pipe_update_start, |
| 731 | TP_PROTO(struct intel_crtc *crtc), |
| 732 | TP_ARGS(crtc), |
| 733 | |
| 734 | TP_STRUCT__entry( |
| 735 | __string(dev, __dev_name_kms(crtc)) |
| 736 | __field(char, pipe_name) |
| 737 | __field(u32, frame) |
| 738 | __field(u32, scanline) |
| 739 | __field(u32, min) |
| 740 | __field(u32, max) |
| 741 | ), |
| 742 | |
| 743 | TP_fast_assign( |
| 744 | __assign_str(dev); |
| 745 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 746 | __entry->frame = intel_crtc_get_vblank_counter(crtc); |
| 747 | __entry->scanline = intel_get_crtc_scanline(crtc); |
| 748 | __entry->min = crtc->debug.min_vbl; |
| 749 | __entry->max = crtc->debug.max_vbl; |
| 750 | ), |
| 751 | |
| 752 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, min=%u, max=%u" , |
| 753 | __get_str(dev), __entry->pipe_name, |
| 754 | __entry->frame, __entry->scanline, |
| 755 | __entry->min, __entry->max) |
| 756 | ); |
| 757 | |
| 758 | TRACE_EVENT(intel_pipe_update_vblank_evaded, |
| 759 | TP_PROTO(struct intel_crtc *crtc), |
| 760 | TP_ARGS(crtc), |
| 761 | |
| 762 | TP_STRUCT__entry( |
| 763 | __string(dev, __dev_name_kms(crtc)) |
| 764 | __field(char, pipe_name) |
| 765 | __field(u32, frame) |
| 766 | __field(u32, scanline) |
| 767 | __field(u32, min) |
| 768 | __field(u32, max) |
| 769 | ), |
| 770 | |
| 771 | TP_fast_assign( |
| 772 | __assign_str(dev); |
| 773 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 774 | __entry->frame = crtc->debug.start_vbl_count; |
| 775 | __entry->scanline = crtc->debug.scanline_start; |
| 776 | __entry->min = crtc->debug.min_vbl; |
| 777 | __entry->max = crtc->debug.max_vbl; |
| 778 | ), |
| 779 | |
| 780 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u, min=%u, max=%u" , |
| 781 | __get_str(dev), __entry->pipe_name, |
| 782 | __entry->frame, __entry->scanline, |
| 783 | __entry->min, __entry->max) |
| 784 | ); |
| 785 | |
| 786 | TRACE_EVENT(intel_pipe_update_end, |
| 787 | TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end), |
| 788 | TP_ARGS(crtc, frame, scanline_end), |
| 789 | |
| 790 | TP_STRUCT__entry( |
| 791 | __string(dev, __dev_name_kms(crtc)) |
| 792 | __field(char, pipe_name) |
| 793 | __field(u32, frame) |
| 794 | __field(u32, scanline) |
| 795 | ), |
| 796 | |
| 797 | TP_fast_assign( |
| 798 | __assign_str(dev); |
| 799 | __entry->pipe_name = pipe_name(crtc->pipe); |
| 800 | __entry->frame = frame; |
| 801 | __entry->scanline = scanline_end; |
| 802 | ), |
| 803 | |
| 804 | TP_printk("dev %s, pipe %c, frame=%u, scanline=%u" , |
| 805 | __get_str(dev), __entry->pipe_name, |
| 806 | __entry->frame, __entry->scanline) |
| 807 | ); |
| 808 | |
| 809 | TRACE_EVENT(intel_frontbuffer_invalidate, |
| 810 | TP_PROTO(struct intel_display *display, |
| 811 | unsigned int frontbuffer_bits, unsigned int origin), |
| 812 | TP_ARGS(display, frontbuffer_bits, origin), |
| 813 | |
| 814 | TP_STRUCT__entry( |
| 815 | __string(dev, __dev_name_display(display)) |
| 816 | __field(unsigned int, frontbuffer_bits) |
| 817 | __field(unsigned int, origin) |
| 818 | ), |
| 819 | |
| 820 | TP_fast_assign( |
| 821 | __assign_str(dev); |
| 822 | __entry->frontbuffer_bits = frontbuffer_bits; |
| 823 | __entry->origin = origin; |
| 824 | ), |
| 825 | |
| 826 | TP_printk("dev %s, frontbuffer_bits=0x%08x, origin=%u" , |
| 827 | __get_str(dev), __entry->frontbuffer_bits, __entry->origin) |
| 828 | ); |
| 829 | |
| 830 | TRACE_EVENT(intel_frontbuffer_flush, |
| 831 | TP_PROTO(struct intel_display *display, |
| 832 | unsigned int frontbuffer_bits, unsigned int origin), |
| 833 | TP_ARGS(display, frontbuffer_bits, origin), |
| 834 | |
| 835 | TP_STRUCT__entry( |
| 836 | __string(dev, __dev_name_display(display)) |
| 837 | __field(unsigned int, frontbuffer_bits) |
| 838 | __field(unsigned int, origin) |
| 839 | ), |
| 840 | |
| 841 | TP_fast_assign( |
| 842 | __assign_str(dev); |
| 843 | __entry->frontbuffer_bits = frontbuffer_bits; |
| 844 | __entry->origin = origin; |
| 845 | ), |
| 846 | |
| 847 | TP_printk("dev %s, frontbuffer_bits=0x%08x, origin=%u" , |
| 848 | __get_str(dev), __entry->frontbuffer_bits, __entry->origin) |
| 849 | ); |
| 850 | |
| 851 | #endif /* __INTEL_DISPLAY_TRACE_H__ */ |
| 852 | |
| 853 | /* This part must be outside protection */ |
| 854 | #undef TRACE_INCLUDE_PATH |
| 855 | #undef TRACE_INCLUDE_FILE |
| 856 | #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display |
| 857 | #define TRACE_INCLUDE_FILE intel_display_trace |
| 858 | #include <trace/define_trace.h> |
| 859 | |