1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(ARMADA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define ARMADA_TRACE_H
4 
5 #include <linux/tracepoint.h>
6 #include <drm/drmP.h>
7 
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM armada
10 #define TRACE_INCLUDE_FILE armada_trace
11 
12 TRACE_EVENT(armada_drm_irq,
13 	TP_PROTO(struct drm_crtc *crtc, u32 stat),
14 	TP_ARGS(crtc, stat),
15 	TP_STRUCT__entry(
16 		__field(struct drm_crtc *, crtc)
17 		__field(u32, stat)
18 	),
19 	TP_fast_assign(
20 		__entry->crtc = crtc;
21 		__entry->stat = stat;
22 	),
23 	TP_printk("crtc %p stat 0x%08x",
24 		__entry->crtc, __entry->stat)
25 );
26 
27 TRACE_EVENT(armada_ovl_plane_update,
28 	TP_PROTO(struct drm_plane *plane, struct drm_crtc *crtc,
29 		     struct drm_framebuffer *fb,
30 		     int crtc_x, int crtc_y, unsigned crtc_w, unsigned crtc_h,
31 		     uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h),
32 	TP_ARGS(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h),
33 	TP_STRUCT__entry(
34 		__field(struct drm_plane *, plane)
35 		__field(struct drm_crtc *, crtc)
36 		__field(struct drm_framebuffer *, fb)
37 		__field(int, crtc_x)
38 		__field(int, crtc_y)
39 		__field(unsigned int, crtc_w)
40 		__field(unsigned int, crtc_h)
41 		__field(u32, src_x)
42 		__field(u32, src_y)
43 		__field(u32, src_w)
44 		__field(u32, src_h)
45 	),
46 	TP_fast_assign(
47 		__entry->plane = plane;
48 		__entry->crtc = crtc;
49 		__entry->fb = fb;
50 		__entry->crtc_x = crtc_x;
51 		__entry->crtc_y = crtc_y;
52 		__entry->crtc_w = crtc_w;
53 		__entry->crtc_h = crtc_h;
54 		__entry->src_x = src_x;
55 		__entry->src_y = src_y;
56 		__entry->src_w = src_w;
57 		__entry->src_h = src_h;
58 	),
59 	TP_printk("plane %p crtc %p fb %p crtc @ (%d,%d, %ux%u) src @ (%u,%u, %ux%u)",
60 		__entry->plane, __entry->crtc, __entry->fb,
61 		__entry->crtc_x, __entry->crtc_y,
62 		__entry->crtc_w, __entry->crtc_h,
63 		__entry->src_x >> 16, __entry->src_y >> 16,
64 		__entry->src_w >> 16, __entry->src_h >> 16)
65 );
66 
67 TRACE_EVENT(armada_ovl_plane_work,
68 	TP_PROTO(struct drm_crtc *crtc, struct drm_plane *plane),
69 	TP_ARGS(crtc, plane),
70 	TP_STRUCT__entry(
71 		__field(struct drm_plane *, plane)
72 		__field(struct drm_crtc *, crtc)
73 	),
74 	TP_fast_assign(
75 		__entry->plane = plane;
76 		__entry->crtc = crtc;
77 	),
78 	TP_printk("plane %p crtc %p",
79 		__entry->plane, __entry->crtc)
80 );
81 
82 #endif
83 
84 /* This part must be outside protection */
85 #undef TRACE_INCLUDE_PATH
86 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/armada
87 #include <trace/define_trace.h>
88