diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-04-29 06:35:48 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-05-06 04:18:03 -0400 |
commit | 25ef284a2a7de5393b2ef608046e0d48db0e6e2a (patch) | |
tree | bb1fa71a272defb212caf8b1622c67de53c44f1f /drivers/gpu/drm | |
parent | 5b633d6b8e3aa1f3ba3daa568416e36e054a3bb1 (diff) |
drm/i915: Add pipe update trace points
Add trace points for observing the atomic pipe update mechanism.
v2: Rebased due to earlier changes
v3: Pass intel_crtc instead of drm_crtc (Daniel)
v4: Pass frame counter from the caller to evaded/end since
the caller now always has that ready
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Sourab Gupta <sourabgupta@gmail.com>
Reviewed-by: Akash Goel <akash.goels@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_trace.h | 75 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sprite.c | 6 |
2 files changed, 81 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index 23c26f1f8b37..b29d7b1828f1 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | #include <drm/drmP.h> | 8 | #include <drm/drmP.h> |
9 | #include "i915_drv.h" | 9 | #include "i915_drv.h" |
10 | #include "intel_drv.h" | ||
10 | #include "intel_ringbuffer.h" | 11 | #include "intel_ringbuffer.h" |
11 | 12 | ||
12 | #undef TRACE_SYSTEM | 13 | #undef TRACE_SYSTEM |
@@ -14,6 +15,80 @@ | |||
14 | #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM) | 15 | #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM) |
15 | #define TRACE_INCLUDE_FILE i915_trace | 16 | #define TRACE_INCLUDE_FILE i915_trace |
16 | 17 | ||
18 | /* pipe updates */ | ||
19 | |||
20 | TRACE_EVENT(i915_pipe_update_start, | ||
21 | TP_PROTO(struct intel_crtc *crtc, u32 min, u32 max), | ||
22 | TP_ARGS(crtc, min, max), | ||
23 | |||
24 | TP_STRUCT__entry( | ||
25 | __field(enum pipe, pipe) | ||
26 | __field(u32, frame) | ||
27 | __field(u32, scanline) | ||
28 | __field(u32, min) | ||
29 | __field(u32, max) | ||
30 | ), | ||
31 | |||
32 | TP_fast_assign( | ||
33 | __entry->pipe = crtc->pipe; | ||
34 | __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, | ||
35 | crtc->pipe); | ||
36 | __entry->scanline = intel_get_crtc_scanline(crtc); | ||
37 | __entry->min = min; | ||
38 | __entry->max = max; | ||
39 | ), | ||
40 | |||
41 | TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u", | ||
42 | pipe_name(__entry->pipe), __entry->frame, | ||
43 | __entry->scanline, __entry->min, __entry->max) | ||
44 | ); | ||
45 | |||
46 | TRACE_EVENT(i915_pipe_update_vblank_evaded, | ||
47 | TP_PROTO(struct intel_crtc *crtc, u32 min, u32 max, u32 frame), | ||
48 | TP_ARGS(crtc, min, max, frame), | ||
49 | |||
50 | TP_STRUCT__entry( | ||
51 | __field(enum pipe, pipe) | ||
52 | __field(u32, frame) | ||
53 | __field(u32, scanline) | ||
54 | __field(u32, min) | ||
55 | __field(u32, max) | ||
56 | ), | ||
57 | |||
58 | TP_fast_assign( | ||
59 | __entry->pipe = crtc->pipe; | ||
60 | __entry->frame = frame; | ||
61 | __entry->scanline = intel_get_crtc_scanline(crtc); | ||
62 | __entry->min = min; | ||
63 | __entry->max = max; | ||
64 | ), | ||
65 | |||
66 | TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u", | ||
67 | pipe_name(__entry->pipe), __entry->frame, | ||
68 | __entry->scanline, __entry->min, __entry->max) | ||
69 | ); | ||
70 | |||
71 | TRACE_EVENT(i915_pipe_update_end, | ||
72 | TP_PROTO(struct intel_crtc *crtc, u32 frame), | ||
73 | TP_ARGS(crtc, frame), | ||
74 | |||
75 | TP_STRUCT__entry( | ||
76 | __field(enum pipe, pipe) | ||
77 | __field(u32, frame) | ||
78 | __field(u32, scanline) | ||
79 | ), | ||
80 | |||
81 | TP_fast_assign( | ||
82 | __entry->pipe = crtc->pipe; | ||
83 | __entry->frame = frame; | ||
84 | __entry->scanline = intel_get_crtc_scanline(crtc); | ||
85 | ), | ||
86 | |||
87 | TP_printk("pipe %c, frame=%u, scanline=%u", | ||
88 | pipe_name(__entry->pipe), __entry->frame, | ||
89 | __entry->scanline) | ||
90 | ); | ||
91 | |||
17 | /* object tracking */ | 92 | /* object tracking */ |
18 | 93 | ||
19 | TRACE_EVENT(i915_gem_object_create, | 94 | TRACE_EVENT(i915_gem_object_create, |
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 6192e586de5d..213cd58f0412 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c | |||
@@ -73,6 +73,8 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl | |||
73 | 73 | ||
74 | local_irq_disable(); | 74 | local_irq_disable(); |
75 | 75 | ||
76 | trace_i915_pipe_update_start(crtc, min, max); | ||
77 | |||
76 | for (;;) { | 78 | for (;;) { |
77 | /* | 79 | /* |
78 | * prepare_to_wait() has a memory barrier, which guarantees | 80 | * prepare_to_wait() has a memory barrier, which guarantees |
@@ -104,6 +106,8 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl | |||
104 | 106 | ||
105 | *start_vbl_count = dev->driver->get_vblank_counter(dev, pipe); | 107 | *start_vbl_count = dev->driver->get_vblank_counter(dev, pipe); |
106 | 108 | ||
109 | trace_i915_pipe_update_vblank_evaded(crtc, min, max, *start_vbl_count); | ||
110 | |||
107 | return true; | 111 | return true; |
108 | } | 112 | } |
109 | 113 | ||
@@ -113,6 +117,8 @@ static void intel_pipe_update_end(struct intel_crtc *crtc, u32 start_vbl_count) | |||
113 | enum pipe pipe = crtc->pipe; | 117 | enum pipe pipe = crtc->pipe; |
114 | u32 end_vbl_count = dev->driver->get_vblank_counter(dev, pipe); | 118 | u32 end_vbl_count = dev->driver->get_vblank_counter(dev, pipe); |
115 | 119 | ||
120 | trace_i915_pipe_update_end(crtc, end_vbl_count); | ||
121 | |||
116 | local_irq_enable(); | 122 | local_irq_enable(); |
117 | 123 | ||
118 | if (start_vbl_count != end_vbl_count) | 124 | if (start_vbl_count != end_vbl_count) |