drm/armada: add tracing support
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 17 May 2016 12:51:08 +0000 (13:51 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 1 Nov 2016 20:06:54 +0000 (20:06 +0000)
Add tracing support to the Armada video overlay and interrupt code.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/gpu/drm/armada/Makefile
drivers/gpu/drm/armada/armada_crtc.c
drivers/gpu/drm/armada/armada_overlay.c
drivers/gpu/drm/armada/armada_trace.c [new file with mode: 0644]
drivers/gpu/drm/armada/armada_trace.h [new file with mode: 0644]

index ffd67361577280117dfffedc7b94bda7470b5ee2..a18f156c8b663627ee250a2f9e2867688bafb163 100644 (file)
@@ -1,5 +1,5 @@
 armada-y       := armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \
-                  armada_gem.o armada_overlay.o
+                  armada_gem.o armada_overlay.o armada_trace.o
 armada-y       += armada_510.o
 armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o
 
index 2f58e9e2a59cb4346e339a43953e3ade8941889a..135ad844fbb871060ee8a1c7ca8b2fd3dcdc7d6c 100644 (file)
@@ -18,6 +18,7 @@
 #include "armada_fb.h"
 #include "armada_gem.h"
 #include "armada_hw.h"
+#include "armada_trace.h"
 
 struct armada_frame_work {
        struct armada_plane_work work;
@@ -464,6 +465,8 @@ static irqreturn_t armada_drm_irq(int irq, void *arg)
         */
        writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR);
 
+       trace_armada_drm_irq(&dcrtc->crtc, stat);
+
        /* Mask out those interrupts we haven't enabled */
        v = stat & dcrtc->irq_ena;
 
index 1ee707ef6b8d0d0b51033903dbe3a189de700f80..94af7c93276eae705c7080c9e17d4af8d67d3383 100644 (file)
@@ -15,6 +15,7 @@
 #include "armada_hw.h"
 #include <drm/armada_drm.h>
 #include "armada_ioctlP.h"
+#include "armada_trace.h"
 
 struct armada_ovl_plane_properties {
        uint32_t colorkey_yr;
@@ -87,6 +88,8 @@ static void armada_ovl_plane_work(struct armada_crtc *dcrtc,
 {
        struct armada_ovl_plane *dplane = container_of(plane, struct armada_ovl_plane, base);
 
+       trace_armada_ovl_plane_work(&dcrtc->crtc, &plane->base);
+
        armada_drm_crtc_update_regs(dcrtc, dplane->vbl.regs);
        armada_ovl_retire_fb(dplane, NULL);
 }
@@ -120,6 +123,10 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
        bool visible;
        int ret;
 
+       trace_armada_ovl_plane_update(plane, crtc, fb,
+                                crtc_x, crtc_y, crtc_w, crtc_h,
+                                src_x, src_y, src_w, src_h);
+
        ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip,
                                            BIT(DRM_ROTATE_0),
                                            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 (file)
index 0000000..068b336
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef __CHECKER__
+#define CREATE_TRACE_POINTS
+#include "armada_trace.h"
+#endif
diff --git a/drivers/gpu/drm/armada/armada_trace.h b/drivers/gpu/drm/armada/armada_trace.h
new file mode 100644 (file)
index 0000000..dc0cba7
--- /dev/null
@@ -0,0 +1,66 @@
+#if !defined(ARMADA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define ARMADA_TRACE_H
+
+#include <linux/tracepoint.h>
+#include <drm/drmP.h>
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM armada
+#define TRACE_INCLUDE_FILE armada_trace
+
+TRACE_EVENT(armada_drm_irq,
+       TP_PROTO(struct drm_crtc *crtc, u32 stat),
+       TP_ARGS(crtc, stat),
+       TP_STRUCT__entry(
+               __field(struct drm_crtc *, crtc)
+               __field(u32, stat)
+       ),
+       TP_fast_assign(
+               __entry->crtc = crtc;
+               __entry->stat = stat;
+       ),
+       TP_printk("crtc %p stat 0x%08x",
+               __entry->crtc, __entry->stat)
+);
+
+TRACE_EVENT(armada_ovl_plane_update,
+       TP_PROTO(struct drm_plane *plane, struct drm_crtc *crtc,
+                    struct drm_framebuffer *fb,
+                    int crtc_x, int crtc_y, unsigned crtc_w, unsigned crtc_h,
+                    uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h),
+       TP_ARGS(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h),
+       TP_STRUCT__entry(
+               __field(struct drm_plane *, plane)
+               __field(struct drm_crtc *, crtc)
+               __field(struct drm_framebuffer *, fb)
+       ),
+       TP_fast_assign(
+               __entry->plane = plane;
+               __entry->crtc = crtc;
+               __entry->fb = fb;
+       ),
+       TP_printk("plane %p crtc %p fb %p",
+               __entry->plane, __entry->crtc, __entry->fb)
+);
+
+TRACE_EVENT(armada_ovl_plane_work,
+       TP_PROTO(struct drm_crtc *crtc, struct drm_plane *plane),
+       TP_ARGS(crtc, plane),
+       TP_STRUCT__entry(
+               __field(struct drm_plane *, plane)
+               __field(struct drm_crtc *, crtc)
+       ),
+       TP_fast_assign(
+               __entry->plane = plane;
+               __entry->crtc = crtc;
+       ),
+       TP_printk("plane %p crtc %p",
+               __entry->plane, __entry->crtc)
+);
+
+#endif
+
+/* This part must be outside protection */
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#include <trace/define_trace.h>