media: visl: Add AV1 support
[linux-block.git] / drivers / media / test-drivers / visl / visl-trace-av1.h
CommitLineData
98b3cd0b
DC
1/* SPDX-License-Identifier: GPL-2.0 */
2#if !defined(_VISL_TRACE_AV1_H_) || defined(TRACE_HEADER_MULTI_READ)
3#define _VISL_TRACE_AV1_H_
4
5#include <linux/tracepoint.h>
6#include "visl.h"
7
8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM visl_av1_controls
10
11DECLARE_EVENT_CLASS(v4l2_ctrl_av1_seq_tmpl,
12 TP_PROTO(const struct v4l2_ctrl_av1_sequence *s),
13 TP_ARGS(s),
14 TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_sequence, s)),
15 TP_fast_assign(__entry->s = *s;),
16 TP_printk("\nflags %s\nseq_profile: %u\norder_hint_bits: %u\nbit_depth: %u\n"
17 "max_frame_width_minus_1: %u\nmax_frame_height_minus_1: %u\n",
18 __print_flags(__entry->s.flags, "|",
19 {V4L2_AV1_SEQUENCE_FLAG_STILL_PICTURE, "STILL_PICTURE"},
20 {V4L2_AV1_SEQUENCE_FLAG_USE_128X128_SUPERBLOCK, "USE_128X128_SUPERBLOCK"},
21 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_FILTER_INTRA, "ENABLE_FILTER_INTRA"},
22 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTRA_EDGE_FILTER, "ENABLE_INTRA_EDGE_FILTER"},
23 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTERINTRA_COMPOUND, "ENABLE_INTERINTRA_COMPOUND"},
24 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND, "ENABLE_MASKED_COMPOUND"},
25 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_WARPED_MOTION, "ENABLE_WARPED_MOTION"},
26 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_DUAL_FILTER, "ENABLE_DUAL_FILTER"},
27 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_ORDER_HINT, "ENABLE_ORDER_HINT"},
28 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_JNT_COMP, "ENABLE_JNT_COMP"},
29 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_REF_FRAME_MVS, "ENABLE_REF_FRAME_MVS"},
30 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_SUPERRES, "ENABLE_SUPERRES"},
31 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF, "ENABLE_CDEF"},
32 {V4L2_AV1_SEQUENCE_FLAG_ENABLE_RESTORATION, "ENABLE_RESTORATION"},
33 {V4L2_AV1_SEQUENCE_FLAG_MONO_CHROME, "MONO_CHROME"},
34 {V4L2_AV1_SEQUENCE_FLAG_COLOR_RANGE, "COLOR_RANGE"},
35 {V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X, "SUBSAMPLING_X"},
36 {V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_Y, "SUBSAMPLING_Y"},
37 {V4L2_AV1_SEQUENCE_FLAG_FILM_GRAIN_PARAMS_PRESENT, "FILM_GRAIN_PARAMS_PRESENT"},
38 {V4L2_AV1_SEQUENCE_FLAG_SEPARATE_UV_DELTA_Q, "SEPARATE_UV_DELTA_Q"}),
39 __entry->s.seq_profile,
40 __entry->s.order_hint_bits,
41 __entry->s.bit_depth,
42 __entry->s.max_frame_width_minus_1,
43 __entry->s.max_frame_height_minus_1
44 )
45);
46
47DECLARE_EVENT_CLASS(v4l2_ctrl_av1_tge_tmpl,
48 TP_PROTO(const struct v4l2_ctrl_av1_tile_group_entry *t),
49 TP_ARGS(t),
50 TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_tile_group_entry, t)),
51 TP_fast_assign(__entry->t = *t;),
52 TP_printk("\ntile_offset: %u\n tile_size: %u\n tile_row: %u\ntile_col: %u\n",
53 __entry->t.tile_offset,
54 __entry->t.tile_size,
55 __entry->t.tile_row,
56 __entry->t.tile_col
57 )
58);
59
60DECLARE_EVENT_CLASS(v4l2_ctrl_av1_frame_tmpl,
61 TP_PROTO(const struct v4l2_ctrl_av1_frame *f),
62 TP_ARGS(f),
63 TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_frame, f)),
64 TP_fast_assign(__entry->f = *f;),
65 TP_printk("\ntile_info.flags: %s\ntile_info.context_update_tile_id: %u\n"
66 "tile_info.tile_cols: %u\ntile_info.tile_rows: %u\n"
67 "tile_info.mi_col_starts: %s\ntile_info.mi_row_starts: %s\n"
68 "tile_info.width_in_sbs_minus_1: %s\ntile_info.height_in_sbs_minus_1: %s\n"
69 "tile_info.tile_size_bytes: %u\nquantization.flags: %s\n"
70 "quantization.base_q_idx: %u\nquantization.delta_q_y_dc: %d\n"
71 "quantization.delta_q_u_dc: %d\nquantization.delta_q_u_ac: %d\n"
72 "quantization.delta_q_v_dc: %d\nquantization.delta_q_v_ac: %d\n"
73 "quantization.qm_y: %u\nquantization.qm_u: %u\nquantization.qm_v: %u\n"
74 "quantization.delta_q_res: %u\nsuperres_denom: %u\nsegmentation.flags: %s\n"
75 "segmentation.last_active_seg_id: %u\nsegmentation.feature_enabled:%s\n"
76 "loop_filter.flags: %s\nloop_filter.level: %s\nloop_filter.sharpness: %u\n"
77 "loop_filter.ref_deltas: %s\nloop_filter.mode_deltas: %s\n"
78 "loop_filter.delta_lf_res: %u\ncdef.damping_minus_3: %u\ncdef.bits: %u\n"
79 "cdef.y_pri_strength: %s\ncdef.y_sec_strength: %s\n"
80 "cdef.uv_pri_strength: %s\ncdef.uv_sec_strength:%s\nskip_mode_frame: %s\n"
81 "primary_ref_frame: %u\nloop_restoration.flags: %s\n"
82 "loop_restoration.lr_unit_shift: %u\nloop_restoration.lr_uv_shift: %u\n"
83 "loop_restoration.frame_restoration_type: %s\n"
84 "loop_restoration.loop_restoration_size: %s\nflags: %s\norder_hint: %u\n"
85 "upscaled_width: %u\nframe_width_minus_1: %u\nframe_height_minus_1: %u\n"
86 "render_width_minus_1: %u\nrender_height_minus_1: %u\ncurrent_frame_id: %u\n"
87 "buffer_removal_time: %s\norder_hints: %s\nreference_frame_ts: %s\n"
88 "ref_frame_idx: %s\nrefresh_frame_flags: %u\n",
89 __print_flags(__entry->f.tile_info.flags, "|",
90 {V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING, "UNIFORM_TILE_SPACING"}),
91 __entry->f.tile_info.context_update_tile_id,
92 __entry->f.tile_info.tile_cols,
93 __entry->f.tile_info.tile_rows,
94 __print_array(__entry->f.tile_info.mi_col_starts,
95 ARRAY_SIZE(__entry->f.tile_info.mi_col_starts),
96 sizeof(__entry->f.tile_info.mi_col_starts[0])),
97 __print_array(__entry->f.tile_info.mi_row_starts,
98 ARRAY_SIZE(__entry->f.tile_info.mi_row_starts),
99 sizeof(__entry->f.tile_info.mi_row_starts[0])),
100 __print_array(__entry->f.tile_info.width_in_sbs_minus_1,
101 ARRAY_SIZE(__entry->f.tile_info.width_in_sbs_minus_1),
102 sizeof(__entry->f.tile_info.width_in_sbs_minus_1[0])),
103 __print_array(__entry->f.tile_info.height_in_sbs_minus_1,
104 ARRAY_SIZE(__entry->f.tile_info.height_in_sbs_minus_1),
105 sizeof(__entry->f.tile_info.height_in_sbs_minus_1[0])),
106 __entry->f.tile_info.tile_size_bytes,
107 __print_flags(__entry->f.quantization.flags, "|",
108 {V4L2_AV1_QUANTIZATION_FLAG_DIFF_UV_DELTA, "DIFF_UV_DELTA"},
109 {V4L2_AV1_QUANTIZATION_FLAG_USING_QMATRIX, "USING_QMATRIX"},
110 {V4L2_AV1_QUANTIZATION_FLAG_DELTA_Q_PRESENT, "DELTA_Q_PRESENT"}),
111 __entry->f.quantization.base_q_idx,
112 __entry->f.quantization.delta_q_y_dc,
113 __entry->f.quantization.delta_q_u_dc,
114 __entry->f.quantization.delta_q_u_ac,
115 __entry->f.quantization.delta_q_v_dc,
116 __entry->f.quantization.delta_q_v_ac,
117 __entry->f.quantization.qm_y,
118 __entry->f.quantization.qm_u,
119 __entry->f.quantization.qm_v,
120 __entry->f.quantization.delta_q_res,
121 __entry->f.superres_denom,
122 __print_flags(__entry->f.segmentation.flags, "|",
123 {V4L2_AV1_SEGMENTATION_FLAG_ENABLED, "ENABLED"},
124 {V4L2_AV1_SEGMENTATION_FLAG_UPDATE_MAP, "UPDATE_MAP"},
125 {V4L2_AV1_SEGMENTATION_FLAG_TEMPORAL_UPDATE, "TEMPORAL_UPDATE"},
126 {V4L2_AV1_SEGMENTATION_FLAG_UPDATE_DATA, "UPDATE_DATA"},
127 {V4L2_AV1_SEGMENTATION_FLAG_SEG_ID_PRE_SKIP, "SEG_ID_PRE_SKIP"}),
128 __entry->f.segmentation.last_active_seg_id,
129 __print_array(__entry->f.segmentation.feature_enabled,
130 ARRAY_SIZE(__entry->f.segmentation.feature_enabled),
131 sizeof(__entry->f.segmentation.feature_enabled[0])),
132 __print_flags(__entry->f.loop_filter.flags, "|",
133 {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_ENABLED, "DELTA_ENABLED"},
134 {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_UPDATE, "DELTA_UPDATE"},
135 {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_PRESENT, "DELTA_LF_PRESENT"},
136 {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_MULTI, "DELTA_LF_MULTI"}),
137 __print_array(__entry->f.loop_filter.level,
138 ARRAY_SIZE(__entry->f.loop_filter.level),
139 sizeof(__entry->f.loop_filter.level[0])),
140 __entry->f.loop_filter.sharpness,
141 __print_array(__entry->f.loop_filter.ref_deltas,
142 ARRAY_SIZE(__entry->f.loop_filter.ref_deltas),
143 sizeof(__entry->f.loop_filter.ref_deltas[0])),
144 __print_array(__entry->f.loop_filter.mode_deltas,
145 ARRAY_SIZE(__entry->f.loop_filter.mode_deltas),
146 sizeof(__entry->f.loop_filter.mode_deltas[0])),
147 __entry->f.loop_filter.delta_lf_res,
148 __entry->f.cdef.damping_minus_3,
149 __entry->f.cdef.bits,
150 __print_array(__entry->f.cdef.y_pri_strength,
151 ARRAY_SIZE(__entry->f.cdef.y_pri_strength),
152 sizeof(__entry->f.cdef.y_pri_strength[0])),
153 __print_array(__entry->f.cdef.y_sec_strength,
154 ARRAY_SIZE(__entry->f.cdef.y_sec_strength),
155 sizeof(__entry->f.cdef.y_sec_strength[0])),
156 __print_array(__entry->f.cdef.uv_pri_strength,
157 ARRAY_SIZE(__entry->f.cdef.uv_pri_strength),
158 sizeof(__entry->f.cdef.uv_pri_strength[0])),
159 __print_array(__entry->f.cdef.uv_sec_strength,
160 ARRAY_SIZE(__entry->f.cdef.uv_sec_strength),
161 sizeof(__entry->f.cdef.uv_sec_strength[0])),
162 __print_array(__entry->f.skip_mode_frame,
163 ARRAY_SIZE(__entry->f.skip_mode_frame),
164 sizeof(__entry->f.skip_mode_frame[0])),
165 __entry->f.primary_ref_frame,
166 __print_flags(__entry->f.loop_restoration.flags, "|",
167 {V4L2_AV1_LOOP_RESTORATION_FLAG_USES_LR, "USES_LR"},
168 {V4L2_AV1_LOOP_RESTORATION_FLAG_USES_CHROMA_LR, "USES_CHROMA_LR"}),
169 __entry->f.loop_restoration.lr_unit_shift,
170 __entry->f.loop_restoration.lr_uv_shift,
171 __print_array(__entry->f.loop_restoration.frame_restoration_type,
172 ARRAY_SIZE(__entry->f.loop_restoration.frame_restoration_type),
173 sizeof(__entry->f.loop_restoration.frame_restoration_type[0])),
174 __print_array(__entry->f.loop_restoration.loop_restoration_size,
175 ARRAY_SIZE(__entry->f.loop_restoration.loop_restoration_size),
176 sizeof(__entry->f.loop_restoration.loop_restoration_size[0])),
177 __print_flags(__entry->f.flags, "|",
178 {V4L2_AV1_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
179 {V4L2_AV1_FRAME_FLAG_SHOWABLE_FRAME, "SHOWABLE_FRAME"},
180 {V4L2_AV1_FRAME_FLAG_ERROR_RESILIENT_MODE, "ERROR_RESILIENT_MODE"},
181 {V4L2_AV1_FRAME_FLAG_DISABLE_CDF_UPDATE, "DISABLE_CDF_UPDATE"},
182 {V4L2_AV1_FRAME_FLAG_ALLOW_SCREEN_CONTENT_TOOLS, "ALLOW_SCREEN_CONTENT_TOOLS"},
183 {V4L2_AV1_FRAME_FLAG_FORCE_INTEGER_MV, "FORCE_INTEGER_MV"},
184 {V4L2_AV1_FRAME_FLAG_ALLOW_INTRABC, "ALLOW_INTRABC"},
185 {V4L2_AV1_FRAME_FLAG_USE_SUPERRES, "USE_SUPERRES"},
186 {V4L2_AV1_FRAME_FLAG_ALLOW_HIGH_PRECISION_MV, "ALLOW_HIGH_PRECISION_MV"},
187 {V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE, "IS_MOTION_MODE_SWITCHABLE"},
188 {V4L2_AV1_FRAME_FLAG_USE_REF_FRAME_MVS, "USE_REF_FRAME_MVS"},
189 {V4L2_AV1_FRAME_FLAG_DISABLE_FRAME_END_UPDATE_CDF,
190 "DISABLE_FRAME_END_UPDATE_CDF"},
191 {V4L2_AV1_FRAME_FLAG_ALLOW_WARPED_MOTION, "ALLOW_WARPED_MOTION"},
192 {V4L2_AV1_FRAME_FLAG_REFERENCE_SELECT, "REFERENCE_SELECT"},
193 {V4L2_AV1_FRAME_FLAG_REDUCED_TX_SET, "REDUCED_TX_SET"},
194 {V4L2_AV1_FRAME_FLAG_SKIP_MODE_ALLOWED, "SKIP_MODE_ALLOWED"},
195 {V4L2_AV1_FRAME_FLAG_SKIP_MODE_PRESENT, "SKIP_MODE_PRESENT"},
196 {V4L2_AV1_FRAME_FLAG_FRAME_SIZE_OVERRIDE, "FRAME_SIZE_OVERRIDE"},
197 {V4L2_AV1_FRAME_FLAG_BUFFER_REMOVAL_TIME_PRESENT, "BUFFER_REMOVAL_TIME_PRESENT"},
198 {V4L2_AV1_FRAME_FLAG_FRAME_REFS_SHORT_SIGNALING, "FRAME_REFS_SHORT_SIGNALING"}),
199 __entry->f.order_hint,
200 __entry->f.upscaled_width,
201 __entry->f.frame_width_minus_1,
202 __entry->f.frame_height_minus_1,
203 __entry->f.render_width_minus_1,
204 __entry->f.render_height_minus_1,
205 __entry->f.current_frame_id,
206 __print_array(__entry->f.buffer_removal_time,
207 ARRAY_SIZE(__entry->f.buffer_removal_time),
208 sizeof(__entry->f.buffer_removal_time[0])),
209 __print_array(__entry->f.order_hints,
210 ARRAY_SIZE(__entry->f.order_hints),
211 sizeof(__entry->f.order_hints[0])),
212 __print_array(__entry->f.reference_frame_ts,
213 ARRAY_SIZE(__entry->f.reference_frame_ts),
214 sizeof(__entry->f.reference_frame_ts[0])),
215 __print_array(__entry->f.ref_frame_idx,
216 ARRAY_SIZE(__entry->f.ref_frame_idx),
217 sizeof(__entry->f.ref_frame_idx[0])),
218 __entry->f.refresh_frame_flags
219 )
220);
221
222
223DECLARE_EVENT_CLASS(v4l2_ctrl_av1_film_grain_tmpl,
224 TP_PROTO(const struct v4l2_ctrl_av1_film_grain *f),
225 TP_ARGS(f),
226 TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_film_grain, f)),
227 TP_fast_assign(__entry->f = *f;),
228 TP_printk("\nflags %s\ncr_mult: %u\ngrain_seed: %u\n"
229 "film_grain_params_ref_idx: %u\nnum_y_points: %u\npoint_y_value: %s\n"
230 "point_y_scaling: %s\nnum_cb_points: %u\npoint_cb_value: %s\n"
231 "point_cb_scaling: %s\nnum_cr_points: %u\npoint_cr_value: %s\n"
232 "point_cr_scaling: %s\ngrain_scaling_minus_8: %u\nar_coeff_lag: %u\n"
233 "ar_coeffs_y_plus_128: %s\nar_coeffs_cb_plus_128: %s\n"
234 "ar_coeffs_cr_plus_128: %s\nar_coeff_shift_minus_6: %u\n"
235 "grain_scale_shift: %u\ncb_mult: %u\ncb_luma_mult: %u\ncr_luma_mult: %u\n"
236 "cb_offset: %u\ncr_offset: %u\n",
237 __print_flags(__entry->f.flags, "|",
238 {V4L2_AV1_FILM_GRAIN_FLAG_APPLY_GRAIN, "APPLY_GRAIN"},
239 {V4L2_AV1_FILM_GRAIN_FLAG_UPDATE_GRAIN, "UPDATE_GRAIN"},
240 {V4L2_AV1_FILM_GRAIN_FLAG_CHROMA_SCALING_FROM_LUMA, "CHROMA_SCALING_FROM_LUMA"},
241 {V4L2_AV1_FILM_GRAIN_FLAG_OVERLAP, "OVERLAP"},
242 {V4L2_AV1_FILM_GRAIN_FLAG_CLIP_TO_RESTRICTED_RANGE, "CLIP_TO_RESTRICTED_RANGE"}),
243 __entry->f.cr_mult,
244 __entry->f.grain_seed,
245 __entry->f.film_grain_params_ref_idx,
246 __entry->f.num_y_points,
247 __print_array(__entry->f.point_y_value,
248 ARRAY_SIZE(__entry->f.point_y_value),
249 sizeof(__entry->f.point_y_value[0])),
250 __print_array(__entry->f.point_y_scaling,
251 ARRAY_SIZE(__entry->f.point_y_scaling),
252 sizeof(__entry->f.point_y_scaling[0])),
253 __entry->f.num_cb_points,
254 __print_array(__entry->f.point_cb_value,
255 ARRAY_SIZE(__entry->f.point_cb_value),
256 sizeof(__entry->f.point_cb_value[0])),
257 __print_array(__entry->f.point_cb_scaling,
258 ARRAY_SIZE(__entry->f.point_cb_scaling),
259 sizeof(__entry->f.point_cb_scaling[0])),
260 __entry->f.num_cr_points,
261 __print_array(__entry->f.point_cr_value,
262 ARRAY_SIZE(__entry->f.point_cr_value),
263 sizeof(__entry->f.point_cr_value[0])),
264 __print_array(__entry->f.point_cr_scaling,
265 ARRAY_SIZE(__entry->f.point_cr_scaling),
266 sizeof(__entry->f.point_cr_scaling[0])),
267 __entry->f.grain_scaling_minus_8,
268 __entry->f.ar_coeff_lag,
269 __print_array(__entry->f.ar_coeffs_y_plus_128,
270 ARRAY_SIZE(__entry->f.ar_coeffs_y_plus_128),
271 sizeof(__entry->f.ar_coeffs_y_plus_128[0])),
272 __print_array(__entry->f.ar_coeffs_cb_plus_128,
273 ARRAY_SIZE(__entry->f.ar_coeffs_cb_plus_128),
274 sizeof(__entry->f.ar_coeffs_cb_plus_128[0])),
275 __print_array(__entry->f.ar_coeffs_cr_plus_128,
276 ARRAY_SIZE(__entry->f.ar_coeffs_cr_plus_128),
277 sizeof(__entry->f.ar_coeffs_cr_plus_128[0])),
278 __entry->f.ar_coeff_shift_minus_6,
279 __entry->f.grain_scale_shift,
280 __entry->f.cb_mult,
281 __entry->f.cb_luma_mult,
282 __entry->f.cr_luma_mult,
283 __entry->f.cb_offset,
284 __entry->f.cr_offset
285 )
286)
287
288DEFINE_EVENT(v4l2_ctrl_av1_seq_tmpl, v4l2_ctrl_av1_sequence,
289 TP_PROTO(const struct v4l2_ctrl_av1_sequence *s),
290 TP_ARGS(s)
291);
292
293DEFINE_EVENT(v4l2_ctrl_av1_frame_tmpl, v4l2_ctrl_av1_frame,
294 TP_PROTO(const struct v4l2_ctrl_av1_frame *f),
295 TP_ARGS(f)
296);
297
298DEFINE_EVENT(v4l2_ctrl_av1_tge_tmpl, v4l2_ctrl_av1_tile_group_entry,
299 TP_PROTO(const struct v4l2_ctrl_av1_tile_group_entry *t),
300 TP_ARGS(t)
301);
302
303DEFINE_EVENT(v4l2_ctrl_av1_film_grain_tmpl, v4l2_ctrl_av1_film_grain,
304 TP_PROTO(const struct v4l2_ctrl_av1_film_grain *f),
305 TP_ARGS(f)
306);
307
308#endif
309
310#undef TRACE_INCLUDE_PATH
311#undef TRACE_INCLUDE_FILE
312#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
313#define TRACE_INCLUDE_FILE visl-trace-av1
314#include <trace/define_trace.h>