1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #undef TRACE_SYSTEM
4 #define TRACE_SYSTEM tegra_vde
5 
6 #if !defined(TEGRA_VDE_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define TEGRA_VDE_TRACE_H
8 
9 #include <linux/tracepoint.h>
10 
11 #include "vde.h"
12 
13 DECLARE_EVENT_CLASS(register_access,
14 	TP_PROTO(struct tegra_vde *vde, void __iomem *base,
15 		 u32 offset, u32 value),
16 	TP_ARGS(vde, base, offset, value),
17 	TP_STRUCT__entry(
18 		__string(hw_name, tegra_vde_reg_base_name(vde, base))
19 		__field(u32, offset)
20 		__field(u32, value)
21 	),
22 	TP_fast_assign(
23 		__assign_str(hw_name, tegra_vde_reg_base_name(vde, base));
24 		__entry->offset = offset;
25 		__entry->value = value;
26 	),
27 	TP_printk("%s:0x%03x 0x%08x", __get_str(hw_name), __entry->offset,
28 		  __entry->value)
29 );
30 
31 DEFINE_EVENT(register_access, vde_writel,
32 	TP_PROTO(struct tegra_vde *vde, void __iomem *base,
33 		 u32 offset, u32 value),
34 	TP_ARGS(vde, base, offset, value));
35 DEFINE_EVENT(register_access, vde_readl,
36 	TP_PROTO(struct tegra_vde *vde, void __iomem *base,
37 		 u32 offset, u32 value),
38 	TP_ARGS(vde, base, offset, value));
39 
40 TRACE_EVENT(vde_setup_iram_entry,
41 	TP_PROTO(unsigned int table, unsigned int row, u32 value, u32 aux_addr),
42 	TP_ARGS(table, row, value, aux_addr),
43 	TP_STRUCT__entry(
44 		__field(unsigned int, table)
45 		__field(unsigned int, row)
46 		__field(u32, value)
47 		__field(u32, aux_addr)
48 	),
49 	TP_fast_assign(
50 		__entry->table = table;
51 		__entry->row = row;
52 		__entry->value = value;
53 		__entry->aux_addr = aux_addr;
54 	),
55 	TP_printk("[%u][%u] = { 0x%08x (flags = \"%s\", frame_num = %u); 0x%08x }",
56 		  __entry->table, __entry->row, __entry->value,
57 		  __print_flags(__entry->value, " ", { (1 << 25), "B" }),
58 		  __entry->value & 0x7FFFFF, __entry->aux_addr)
59 );
60 
61 TRACE_EVENT(vde_ref_l0,
62 	TP_PROTO(unsigned int frame_num),
63 	TP_ARGS(frame_num),
64 	TP_STRUCT__entry(
65 		__field(unsigned int, frame_num)
66 	),
67 	TP_fast_assign(
68 		__entry->frame_num = frame_num;
69 	),
70 	TP_printk("REF L0: DPB: Frame 0: frame_num = %u", __entry->frame_num)
71 );
72 
73 TRACE_EVENT(vde_ref_l1,
74 	TP_PROTO(unsigned int with_later_poc_nb,
75 		 unsigned int with_earlier_poc_nb),
76 	TP_ARGS(with_later_poc_nb, with_earlier_poc_nb),
77 	TP_STRUCT__entry(
78 		__field(unsigned int, with_later_poc_nb)
79 		__field(unsigned int, with_earlier_poc_nb)
80 	),
81 	TP_fast_assign(
82 		__entry->with_later_poc_nb = with_later_poc_nb;
83 		__entry->with_earlier_poc_nb = with_earlier_poc_nb;
84 	),
85 	TP_printk("REF L1: with_later_poc_nb %u, with_earlier_poc_nb %u",
86 		  __entry->with_later_poc_nb, __entry->with_earlier_poc_nb)
87 );
88 
89 #endif /* TEGRA_VDE_TRACE_H */
90 
91 /* This part must be outside protection */
92 #undef TRACE_INCLUDE_PATH
93 #define TRACE_INCLUDE_PATH ../../drivers/media/platform/nvidia/tegra-vde
94 #define TRACE_INCLUDE_FILE trace
95 #include <trace/define_trace.h>
96