Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+81 -1
+1 -1
drivers/gpu/drm/armada/Makefile
··· 1 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 3 armada-y += armada_510.o 4 4 armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o 5 5
+3
drivers/gpu/drm/armada/armada_crtc.c
··· 18 18 #include "armada_fb.h" 19 19 #include "armada_gem.h" 20 20 #include "armada_hw.h" 21 + #include "armada_trace.h" 21 22 22 23 struct armada_frame_work { 23 24 struct armada_plane_work work; ··· 464 463 * have to set the actual status register value. This is racy. 465 464 */ 466 465 writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR); 466 + 467 + trace_armada_drm_irq(&dcrtc->crtc, stat); 467 468 468 469 /* Mask out those interrupts we haven't enabled */ 469 470 v = stat & dcrtc->irq_ena;
+7
drivers/gpu/drm/armada/armada_overlay.c
··· 15 15 #include "armada_hw.h" 16 16 #include <drm/armada_drm.h> 17 17 #include "armada_ioctlP.h" 18 + #include "armada_trace.h" 18 19 19 20 struct armada_ovl_plane_properties { 20 21 uint32_t colorkey_yr; ··· 88 87 { 89 88 struct armada_ovl_plane *dplane = container_of(plane, struct armada_ovl_plane, base); 90 89 90 + trace_armada_ovl_plane_work(&dcrtc->crtc, &plane->base); 91 + 91 92 armada_drm_crtc_update_regs(dcrtc, dplane->vbl.regs); 92 93 armada_ovl_retire_fb(dplane, NULL); 93 94 } ··· 122 119 unsigned idx = 0; 123 120 bool visible; 124 121 int ret; 122 + 123 + trace_armada_ovl_plane_update(plane, crtc, fb, 124 + crtc_x, crtc_y, crtc_w, crtc_h, 125 + src_x, src_y, src_w, src_h); 125 126 126 127 ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip, 127 128 BIT(DRM_ROTATE_0),
+4
drivers/gpu/drm/armada/armada_trace.c
··· 1 + #ifndef __CHECKER__ 2 + #define CREATE_TRACE_POINTS 3 + #include "armada_trace.h" 4 + #endif
+66
drivers/gpu/drm/armada/armada_trace.h
··· 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>