diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-05-17 08:51:08 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2016-11-01 16:06:54 -0400 |
commit | c8a220c686a596a4f669b441b2ea40486dea0513 (patch) | |
tree | 9bb4f34fee2ac07ae74c9ee28bdc4f2738565c23 | |
parent | 90731c24d2db7ec04df43ddbcee9605183d05187 (diff) |
drm/armada: add tracing support
Add tracing support to the Armada video overlay and interrupt code.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/gpu/drm/armada/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_crtc.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_overlay.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_trace.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_trace.h | 66 |
5 files changed, 81 insertions, 1 deletions
diff --git a/drivers/gpu/drm/armada/Makefile b/drivers/gpu/drm/armada/Makefile index ffd673615772..a18f156c8b66 100644 --- a/drivers/gpu/drm/armada/Makefile +++ b/drivers/gpu/drm/armada/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | armada-y := armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \ | 1 | armada-y := armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \ |
2 | armada_gem.o armada_overlay.o | 2 | armada_gem.o armada_overlay.o armada_trace.o |
3 | armada-y += armada_510.o | 3 | armada-y += armada_510.o |
4 | armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o | 4 | armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o |
5 | 5 | ||
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 2f58e9e2a59c..135ad844fbb8 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "armada_fb.h" | 18 | #include "armada_fb.h" |
19 | #include "armada_gem.h" | 19 | #include "armada_gem.h" |
20 | #include "armada_hw.h" | 20 | #include "armada_hw.h" |
21 | #include "armada_trace.h" | ||
21 | 22 | ||
22 | struct armada_frame_work { | 23 | struct armada_frame_work { |
23 | struct armada_plane_work work; | 24 | struct armada_plane_work work; |
@@ -464,6 +465,8 @@ static irqreturn_t armada_drm_irq(int irq, void *arg) | |||
464 | */ | 465 | */ |
465 | writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR); | 466 | writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR); |
466 | 467 | ||
468 | trace_armada_drm_irq(&dcrtc->crtc, stat); | ||
469 | |||
467 | /* Mask out those interrupts we haven't enabled */ | 470 | /* Mask out those interrupts we haven't enabled */ |
468 | v = stat & dcrtc->irq_ena; | 471 | v = stat & dcrtc->irq_ena; |
469 | 472 | ||
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 1ee707ef6b8d..94af7c93276e 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "armada_hw.h" | 15 | #include "armada_hw.h" |
16 | #include <drm/armada_drm.h> | 16 | #include <drm/armada_drm.h> |
17 | #include "armada_ioctlP.h" | 17 | #include "armada_ioctlP.h" |
18 | #include "armada_trace.h" | ||
18 | 19 | ||
19 | struct armada_ovl_plane_properties { | 20 | struct armada_ovl_plane_properties { |
20 | uint32_t colorkey_yr; | 21 | uint32_t colorkey_yr; |
@@ -87,6 +88,8 @@ static void armada_ovl_plane_work(struct armada_crtc *dcrtc, | |||
87 | { | 88 | { |
88 | struct armada_ovl_plane *dplane = container_of(plane, struct armada_ovl_plane, base); | 89 | struct armada_ovl_plane *dplane = container_of(plane, struct armada_ovl_plane, base); |
89 | 90 | ||
91 | trace_armada_ovl_plane_work(&dcrtc->crtc, &plane->base); | ||
92 | |||
90 | armada_drm_crtc_update_regs(dcrtc, dplane->vbl.regs); | 93 | armada_drm_crtc_update_regs(dcrtc, dplane->vbl.regs); |
91 | armada_ovl_retire_fb(dplane, NULL); | 94 | armada_ovl_retire_fb(dplane, NULL); |
92 | } | 95 | } |
@@ -120,6 +123,10 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, | |||
120 | bool visible; | 123 | bool visible; |
121 | int ret; | 124 | int ret; |
122 | 125 | ||
126 | trace_armada_ovl_plane_update(plane, crtc, fb, | ||
127 | crtc_x, crtc_y, crtc_w, crtc_h, | ||
128 | src_x, src_y, src_w, src_h); | ||
129 | |||
123 | ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip, | 130 | ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip, |
124 | BIT(DRM_ROTATE_0), | 131 | BIT(DRM_ROTATE_0), |
125 | 0, INT_MAX, true, false, &visible); | 132 | 0, INT_MAX, true, false, &visible); |
diff --git a/drivers/gpu/drm/armada/armada_trace.c b/drivers/gpu/drm/armada/armada_trace.c new file mode 100644 index 000000000000..068b336ba75f --- /dev/null +++ b/drivers/gpu/drm/armada/armada_trace.c | |||
@@ -0,0 +1,4 @@ | |||
1 | #ifndef __CHECKER__ | ||
2 | #define CREATE_TRACE_POINTS | ||
3 | #include "armada_trace.h" | ||
4 | #endif | ||
diff --git a/drivers/gpu/drm/armada/armada_trace.h b/drivers/gpu/drm/armada/armada_trace.h new file mode 100644 index 000000000000..dc0cba70fd1a --- /dev/null +++ b/drivers/gpu/drm/armada/armada_trace.h | |||
@@ -0,0 +1,66 @@ | |||
1 | #if !defined(ARMADA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define ARMADA_TRACE_H | ||
3 | |||
4 | #include <linux/tracepoint.h> | ||
5 | #include <drm/drmP.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM armada | ||
9 | #define TRACE_INCLUDE_FILE armada_trace | ||
10 | |||
11 | TRACE_EVENT(armada_drm_irq, | ||
12 | TP_PROTO(struct drm_crtc *crtc, u32 stat), | ||
13 | TP_ARGS(crtc, stat), | ||
14 | TP_STRUCT__entry( | ||
15 | __field(struct drm_crtc *, crtc) | ||
16 | __field(u32, stat) | ||
17 | ), | ||
18 | TP_fast_assign( | ||
19 | __entry->crtc = crtc; | ||
20 | __entry->stat = stat; | ||
21 | ), | ||
22 | TP_printk("crtc %p stat 0x%08x", | ||
23 | __entry->crtc, __entry->stat) | ||
24 | ); | ||
25 | |||
26 | TRACE_EVENT(armada_ovl_plane_update, | ||
27 | TP_PROTO(struct drm_plane *plane, struct drm_crtc *crtc, | ||
28 | struct drm_framebuffer *fb, | ||
29 | int crtc_x, int crtc_y, unsigned crtc_w, unsigned crtc_h, | ||
30 | uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h), | ||
31 | TP_ARGS(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h), | ||
32 | TP_STRUCT__entry( | ||
33 | __field(struct drm_plane *, plane) | ||
34 | __field(struct drm_crtc *, crtc) | ||
35 | __field(struct drm_framebuffer *, fb) | ||
36 | ), | ||
37 | TP_fast_assign( | ||
38 | __entry->plane = plane; | ||
39 | __entry->crtc = crtc; | ||
40 | __entry->fb = fb; | ||
41 | ), | ||
42 | TP_printk("plane %p crtc %p fb %p", | ||
43 | __entry->plane, __entry->crtc, __entry->fb) | ||
44 | ); | ||
45 | |||
46 | TRACE_EVENT(armada_ovl_plane_work, | ||
47 | TP_PROTO(struct drm_crtc *crtc, struct drm_plane *plane), | ||
48 | TP_ARGS(crtc, plane), | ||
49 | TP_STRUCT__entry( | ||
50 | __field(struct drm_plane *, plane) | ||
51 | __field(struct drm_crtc *, crtc) | ||
52 | ), | ||
53 | TP_fast_assign( | ||
54 | __entry->plane = plane; | ||
55 | __entry->crtc = crtc; | ||
56 | ), | ||
57 | TP_printk("plane %p crtc %p", | ||
58 | __entry->plane, __entry->crtc) | ||
59 | ); | ||
60 | |||
61 | #endif | ||
62 | |||
63 | /* This part must be outside protection */ | ||
64 | #undef TRACE_INCLUDE_PATH | ||
65 | #define TRACE_INCLUDE_PATH . | ||
66 | #include <trace/define_trace.h> | ||