Linux Media Controller development
 help / color / mirror / Atom feed
* Re: [PATCH 01/11] media: Move visl traces to v4l2-core
From: Nicolas Dufresne @ 2026-04-28 19:27 UTC (permalink / raw)
  To: Detlev Casanova, linux-kernel
  Cc: Benjamin Gaignard, Philipp Zabel, Mauro Carvalho Chehab,
	Heiko Stuebner, Daniel Almeida, Steven Rostedt, Masami Hiramatsu,
	Mathieu Desnoyers, Hans Verkuil, Laurent Pinchart,
	Ricardo Ribalda, Yunke Cao, Sakari Ailus, Pavan Bobba,
	James Cowgill, Ma Ke, Jacopo Mondi, Daniel Scally, linux-media,
	linux-rockchip, linux-arm-kernel, linux-trace-kernel, kernel
In-Reply-To: <20260212162328.192217-2-detlev.casanova@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 157842 bytes --]

Le jeudi 12 février 2026 à 11:23 -0500, Detlev Casanova a écrit :
> The visl driver defines traces for all stateless controls.
> Move those definition to a new v4l2_requests.h file and expose them for
> all drivers to use.
> 
> As each event can be enabled individually in userspace, group them all in
> the same v4l2_requests event folder.
> 
> Later, it can also be used by v4l2-core to trace controls as they are
> being set.
> 
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> ---
>  drivers/media/test-drivers/visl/Makefile      |    2 +-
>  drivers/media/test-drivers/visl/visl-dec.c    |    8 +-
>  .../media/test-drivers/visl/visl-trace-av1.h  |  314 ----
>  .../media/test-drivers/visl/visl-trace-fwht.h |   66 -
>  .../media/test-drivers/visl/visl-trace-h264.h |  349 ----
>  .../media/test-drivers/visl/visl-trace-hevc.h |  464 -----
>  .../test-drivers/visl/visl-trace-mpeg2.h      |   99 -
>  .../test-drivers/visl/visl-trace-points.c     |   11 -
>  .../media/test-drivers/visl/visl-trace-vp8.h  |  156 --
>  .../media/test-drivers/visl/visl-trace-vp9.h  |  292 ---
>  drivers/media/v4l2-core/v4l2-trace.c          |   45 +
>  include/trace/events/v4l2_requests.h          | 1645 +++++++++++++++++
>  12 files changed, 1692 insertions(+), 1759 deletions(-)
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-av1.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-fwht.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-h264.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-hevc.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-mpeg2.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-points.c
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-vp8.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-vp9.h
>  create mode 100644 include/trace/events/v4l2_requests.h

Might want to check if the name of that header make sense. This is tracing
compound control structures, which can't be traced generically otherwise, I
could imagine this to be extended to any compound controls ?

Nicolas

> 
> diff --git a/drivers/media/test-drivers/visl/Makefile b/drivers/media/test-drivers/visl/Makefile
> index fb4d5ae1b17f..a5049e2af844 100644
> --- a/drivers/media/test-drivers/visl/Makefile
> +++ b/drivers/media/test-drivers/visl/Makefile
> @@ -1,5 +1,5 @@
>  # SPDX-License-Identifier: GPL-2.0+
> -visl-y := visl-core.o visl-video.o visl-dec.o visl-trace-points.o
> +visl-y := visl-core.o visl-video.o visl-dec.o
>  
>  ifeq ($(CONFIG_VISL_DEBUGFS),y)
>    visl-y += visl-debugfs.o
> diff --git a/drivers/media/test-drivers/visl/visl-dec.c b/drivers/media/test-drivers/visl/visl-dec.c
> index 6bbf93757047..d49208e83726 100644
> --- a/drivers/media/test-drivers/visl/visl-dec.c
> +++ b/drivers/media/test-drivers/visl/visl-dec.c
> @@ -7,18 +7,12 @@
>  #include "visl.h"
>  #include "visl-debugfs.h"
>  #include "visl-dec.h"
> -#include "visl-trace-fwht.h"
> -#include "visl-trace-mpeg2.h"
> -#include "visl-trace-vp8.h"
> -#include "visl-trace-vp9.h"
> -#include "visl-trace-h264.h"
> -#include "visl-trace-hevc.h"
> -#include "visl-trace-av1.h"
>  
>  #include <linux/delay.h>
>  #include <linux/workqueue.h>
>  #include <media/v4l2-mem2mem.h>
>  #include <media/tpg/v4l2-tpg.h>
> +#include <trace/events/v4l2_requests.h>
>  
>  #define LAST_BUF_IDX (V4L2_AV1_REF_LAST_FRAME - V4L2_AV1_REF_LAST_FRAME)
>  #define LAST2_BUF_IDX (V4L2_AV1_REF_LAST2_FRAME - V4L2_AV1_REF_LAST_FRAME)
> diff --git a/drivers/media/test-drivers/visl/visl-trace-av1.h b/drivers/media/test-drivers/visl/visl-trace-av1.h
> deleted file mode 100644
> index 09f205de53df..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-av1.h
> +++ /dev/null
> @@ -1,314 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#if !defined(_VISL_TRACE_AV1_H_) || defined(TRACE_HEADER_MULTI_READ)
> -#define _VISL_TRACE_AV1_H_
> -
> -#include <linux/tracepoint.h>
> -#include "visl.h"
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM visl_av1_controls
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_av1_seq_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_av1_sequence *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_sequence, s)),
> -	TP_fast_assign(__entry->s = *s;),
> -	TP_printk("\nflags %s\nseq_profile: %u\norder_hint_bits: %u\nbit_depth: %u\n"
> -		  "max_frame_width_minus_1: %u\nmax_frame_height_minus_1: %u\n",
> -		  __print_flags(__entry->s.flags, "|",
> -		  {V4L2_AV1_SEQUENCE_FLAG_STILL_PICTURE, "STILL_PICTURE"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_USE_128X128_SUPERBLOCK, "USE_128X128_SUPERBLOCK"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_FILTER_INTRA, "ENABLE_FILTER_INTRA"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTRA_EDGE_FILTER, "ENABLE_INTRA_EDGE_FILTER"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTERINTRA_COMPOUND, "ENABLE_INTERINTRA_COMPOUND"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND, "ENABLE_MASKED_COMPOUND"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_WARPED_MOTION, "ENABLE_WARPED_MOTION"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_DUAL_FILTER, "ENABLE_DUAL_FILTER"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_ORDER_HINT, "ENABLE_ORDER_HINT"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_JNT_COMP, "ENABLE_JNT_COMP"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_REF_FRAME_MVS, "ENABLE_REF_FRAME_MVS"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_SUPERRES, "ENABLE_SUPERRES"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF, "ENABLE_CDEF"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_RESTORATION, "ENABLE_RESTORATION"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_MONO_CHROME, "MONO_CHROME"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_COLOR_RANGE, "COLOR_RANGE"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X, "SUBSAMPLING_X"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_Y, "SUBSAMPLING_Y"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_FILM_GRAIN_PARAMS_PRESENT, "FILM_GRAIN_PARAMS_PRESENT"},
> -		  {V4L2_AV1_SEQUENCE_FLAG_SEPARATE_UV_DELTA_Q, "SEPARATE_UV_DELTA_Q"}),
> -		  __entry->s.seq_profile,
> -		  __entry->s.order_hint_bits,
> -		  __entry->s.bit_depth,
> -		  __entry->s.max_frame_width_minus_1,
> -		  __entry->s.max_frame_height_minus_1
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_av1_tge_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_av1_tile_group_entry *t),
> -	TP_ARGS(t),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_tile_group_entry, t)),
> -	TP_fast_assign(__entry->t = *t;),
> -	TP_printk("\ntile_offset: %u\n tile_size: %u\n tile_row: %u\ntile_col: %u\n",
> -		  __entry->t.tile_offset,
> -		  __entry->t.tile_size,
> -		  __entry->t.tile_row,
> -		  __entry->t.tile_col
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_av1_frame_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_av1_frame *f),
> -	TP_ARGS(f),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_frame, f)),
> -	TP_fast_assign(__entry->f = *f;),
> -	TP_printk("\ntile_info.flags: %s\ntile_info.context_update_tile_id: %u\n"
> -		  "tile_info.tile_cols: %u\ntile_info.tile_rows: %u\n"
> -		  "tile_info.mi_col_starts: %s\ntile_info.mi_row_starts: %s\n"
> -		  "tile_info.width_in_sbs_minus_1: %s\ntile_info.height_in_sbs_minus_1: %s\n"
> -		  "tile_info.tile_size_bytes: %u\nquantization.flags: %s\n"
> -		  "quantization.base_q_idx: %u\nquantization.delta_q_y_dc: %d\n"
> -		  "quantization.delta_q_u_dc: %d\nquantization.delta_q_u_ac: %d\n"
> -		  "quantization.delta_q_v_dc: %d\nquantization.delta_q_v_ac: %d\n"
> -		  "quantization.qm_y: %u\nquantization.qm_u: %u\nquantization.qm_v: %u\n"
> -		  "quantization.delta_q_res: %u\nsuperres_denom: %u\nsegmentation.flags: %s\n"
> -		  "segmentation.last_active_seg_id: %u\nsegmentation.feature_enabled:%s\n"
> -		  "loop_filter.flags: %s\nloop_filter.level: %s\nloop_filter.sharpness: %u\n"
> -		  "loop_filter.ref_deltas: %s\nloop_filter.mode_deltas: %s\n"
> -		  "loop_filter.delta_lf_res: %u\ncdef.damping_minus_3: %u\ncdef.bits: %u\n"
> -		  "cdef.y_pri_strength: %s\ncdef.y_sec_strength: %s\n"
> -		  "cdef.uv_pri_strength: %s\ncdef.uv_sec_strength:%s\nskip_mode_frame: %s\n"
> -		  "primary_ref_frame: %u\nloop_restoration.flags: %s\n"
> -		  "loop_restoration.lr_unit_shift: %u\nloop_restoration.lr_uv_shift: %u\n"
> -		  "loop_restoration.frame_restoration_type: %s\n"
> -		  "loop_restoration.loop_restoration_size: %s\nflags: %s\norder_hint: %u\n"
> -		  "upscaled_width: %u\nframe_width_minus_1: %u\nframe_height_minus_1: %u\n"
> -		  "render_width_minus_1: %u\nrender_height_minus_1: %u\ncurrent_frame_id: %u\n"
> -		  "buffer_removal_time: %s\norder_hints: %s\nreference_frame_ts: %s\n"
> -		  "ref_frame_idx: %s\nrefresh_frame_flags: %u\n",
> -		  __print_flags(__entry->f.tile_info.flags, "|",
> -		  {V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING, "UNIFORM_TILE_SPACING"}),
> -		  __entry->f.tile_info.context_update_tile_id,
> -		  __entry->f.tile_info.tile_cols,
> -		  __entry->f.tile_info.tile_rows,
> -		  __print_array(__entry->f.tile_info.mi_col_starts,
> -				ARRAY_SIZE(__entry->f.tile_info.mi_col_starts),
> -				sizeof(__entry->f.tile_info.mi_col_starts[0])),
> -		  __print_array(__entry->f.tile_info.mi_row_starts,
> -				ARRAY_SIZE(__entry->f.tile_info.mi_row_starts),
> -				sizeof(__entry->f.tile_info.mi_row_starts[0])),
> -		  __print_array(__entry->f.tile_info.width_in_sbs_minus_1,
> -				ARRAY_SIZE(__entry->f.tile_info.width_in_sbs_minus_1),
> -				sizeof(__entry->f.tile_info.width_in_sbs_minus_1[0])),
> -		  __print_array(__entry->f.tile_info.height_in_sbs_minus_1,
> -				ARRAY_SIZE(__entry->f.tile_info.height_in_sbs_minus_1),
> -				sizeof(__entry->f.tile_info.height_in_sbs_minus_1[0])),
> -		  __entry->f.tile_info.tile_size_bytes,
> -		  __print_flags(__entry->f.quantization.flags, "|",
> -		  {V4L2_AV1_QUANTIZATION_FLAG_DIFF_UV_DELTA, "DIFF_UV_DELTA"},
> -		  {V4L2_AV1_QUANTIZATION_FLAG_USING_QMATRIX, "USING_QMATRIX"},
> -		  {V4L2_AV1_QUANTIZATION_FLAG_DELTA_Q_PRESENT, "DELTA_Q_PRESENT"}),
> -		  __entry->f.quantization.base_q_idx,
> -		  __entry->f.quantization.delta_q_y_dc,
> -		  __entry->f.quantization.delta_q_u_dc,
> -		  __entry->f.quantization.delta_q_u_ac,
> -		  __entry->f.quantization.delta_q_v_dc,
> -		  __entry->f.quantization.delta_q_v_ac,
> -		  __entry->f.quantization.qm_y,
> -		  __entry->f.quantization.qm_u,
> -		  __entry->f.quantization.qm_v,
> -		  __entry->f.quantization.delta_q_res,
> -		  __entry->f.superres_denom,
> -		  __print_flags(__entry->f.segmentation.flags, "|",
> -		  {V4L2_AV1_SEGMENTATION_FLAG_ENABLED, "ENABLED"},
> -		  {V4L2_AV1_SEGMENTATION_FLAG_UPDATE_MAP, "UPDATE_MAP"},
> -		  {V4L2_AV1_SEGMENTATION_FLAG_TEMPORAL_UPDATE, "TEMPORAL_UPDATE"},
> -		  {V4L2_AV1_SEGMENTATION_FLAG_UPDATE_DATA, "UPDATE_DATA"},
> -		  {V4L2_AV1_SEGMENTATION_FLAG_SEG_ID_PRE_SKIP, "SEG_ID_PRE_SKIP"}),
> -		  __entry->f.segmentation.last_active_seg_id,
> -		  __print_array(__entry->f.segmentation.feature_enabled,
> -				ARRAY_SIZE(__entry->f.segmentation.feature_enabled),
> -				sizeof(__entry->f.segmentation.feature_enabled[0])),
> -		  __print_flags(__entry->f.loop_filter.flags, "|",
> -		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_ENABLED, "DELTA_ENABLED"},
> -		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_UPDATE, "DELTA_UPDATE"},
> -		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_PRESENT, "DELTA_LF_PRESENT"},
> -		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_MULTI, "DELTA_LF_MULTI"}),
> -		  __print_array(__entry->f.loop_filter.level,
> -				ARRAY_SIZE(__entry->f.loop_filter.level),
> -				sizeof(__entry->f.loop_filter.level[0])),
> -		  __entry->f.loop_filter.sharpness,
> -		  __print_array(__entry->f.loop_filter.ref_deltas,
> -				ARRAY_SIZE(__entry->f.loop_filter.ref_deltas),
> -				sizeof(__entry->f.loop_filter.ref_deltas[0])),
> -		  __print_array(__entry->f.loop_filter.mode_deltas,
> -				ARRAY_SIZE(__entry->f.loop_filter.mode_deltas),
> -				sizeof(__entry->f.loop_filter.mode_deltas[0])),
> -		  __entry->f.loop_filter.delta_lf_res,
> -		  __entry->f.cdef.damping_minus_3,
> -		  __entry->f.cdef.bits,
> -		  __print_array(__entry->f.cdef.y_pri_strength,
> -				ARRAY_SIZE(__entry->f.cdef.y_pri_strength),
> -				sizeof(__entry->f.cdef.y_pri_strength[0])),
> -		  __print_array(__entry->f.cdef.y_sec_strength,
> -				ARRAY_SIZE(__entry->f.cdef.y_sec_strength),
> -				sizeof(__entry->f.cdef.y_sec_strength[0])),
> -		  __print_array(__entry->f.cdef.uv_pri_strength,
> -				ARRAY_SIZE(__entry->f.cdef.uv_pri_strength),
> -				sizeof(__entry->f.cdef.uv_pri_strength[0])),
> -		  __print_array(__entry->f.cdef.uv_sec_strength,
> -				ARRAY_SIZE(__entry->f.cdef.uv_sec_strength),
> -				sizeof(__entry->f.cdef.uv_sec_strength[0])),
> -		  __print_array(__entry->f.skip_mode_frame,
> -				ARRAY_SIZE(__entry->f.skip_mode_frame),
> -				sizeof(__entry->f.skip_mode_frame[0])),
> -		  __entry->f.primary_ref_frame,
> -		  __print_flags(__entry->f.loop_restoration.flags, "|",
> -		  {V4L2_AV1_LOOP_RESTORATION_FLAG_USES_LR, "USES_LR"},
> -		  {V4L2_AV1_LOOP_RESTORATION_FLAG_USES_CHROMA_LR, "USES_CHROMA_LR"}),
> -		  __entry->f.loop_restoration.lr_unit_shift,
> -		  __entry->f.loop_restoration.lr_uv_shift,
> -		  __print_array(__entry->f.loop_restoration.frame_restoration_type,
> -				ARRAY_SIZE(__entry->f.loop_restoration.frame_restoration_type),
> -				sizeof(__entry->f.loop_restoration.frame_restoration_type[0])),
> -		  __print_array(__entry->f.loop_restoration.loop_restoration_size,
> -				ARRAY_SIZE(__entry->f.loop_restoration.loop_restoration_size),
> -				sizeof(__entry->f.loop_restoration.loop_restoration_size[0])),
> -		  __print_flags(__entry->f.flags, "|",
> -		  {V4L2_AV1_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
> -		  {V4L2_AV1_FRAME_FLAG_SHOWABLE_FRAME, "SHOWABLE_FRAME"},
> -		  {V4L2_AV1_FRAME_FLAG_ERROR_RESILIENT_MODE, "ERROR_RESILIENT_MODE"},
> -		  {V4L2_AV1_FRAME_FLAG_DISABLE_CDF_UPDATE, "DISABLE_CDF_UPDATE"},
> -		  {V4L2_AV1_FRAME_FLAG_ALLOW_SCREEN_CONTENT_TOOLS, "ALLOW_SCREEN_CONTENT_TOOLS"},
> -		  {V4L2_AV1_FRAME_FLAG_FORCE_INTEGER_MV, "FORCE_INTEGER_MV"},
> -		  {V4L2_AV1_FRAME_FLAG_ALLOW_INTRABC, "ALLOW_INTRABC"},
> -		  {V4L2_AV1_FRAME_FLAG_USE_SUPERRES, "USE_SUPERRES"},
> -		  {V4L2_AV1_FRAME_FLAG_ALLOW_HIGH_PRECISION_MV, "ALLOW_HIGH_PRECISION_MV"},
> -		  {V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE, "IS_MOTION_MODE_SWITCHABLE"},
> -		  {V4L2_AV1_FRAME_FLAG_USE_REF_FRAME_MVS, "USE_REF_FRAME_MVS"},
> -		  {V4L2_AV1_FRAME_FLAG_DISABLE_FRAME_END_UPDATE_CDF,
> -		   "DISABLE_FRAME_END_UPDATE_CDF"},
> -		  {V4L2_AV1_FRAME_FLAG_ALLOW_WARPED_MOTION, "ALLOW_WARPED_MOTION"},
> -		  {V4L2_AV1_FRAME_FLAG_REFERENCE_SELECT, "REFERENCE_SELECT"},
> -		  {V4L2_AV1_FRAME_FLAG_REDUCED_TX_SET, "REDUCED_TX_SET"},
> -		  {V4L2_AV1_FRAME_FLAG_SKIP_MODE_ALLOWED, "SKIP_MODE_ALLOWED"},
> -		  {V4L2_AV1_FRAME_FLAG_SKIP_MODE_PRESENT, "SKIP_MODE_PRESENT"},
> -		  {V4L2_AV1_FRAME_FLAG_FRAME_SIZE_OVERRIDE, "FRAME_SIZE_OVERRIDE"},
> -		  {V4L2_AV1_FRAME_FLAG_BUFFER_REMOVAL_TIME_PRESENT, "BUFFER_REMOVAL_TIME_PRESENT"},
> -		  {V4L2_AV1_FRAME_FLAG_FRAME_REFS_SHORT_SIGNALING, "FRAME_REFS_SHORT_SIGNALING"}),
> -		  __entry->f.order_hint,
> -		  __entry->f.upscaled_width,
> -		  __entry->f.frame_width_minus_1,
> -		  __entry->f.frame_height_minus_1,
> -		  __entry->f.render_width_minus_1,
> -		  __entry->f.render_height_minus_1,
> -		  __entry->f.current_frame_id,
> -		  __print_array(__entry->f.buffer_removal_time,
> -				ARRAY_SIZE(__entry->f.buffer_removal_time),
> -				sizeof(__entry->f.buffer_removal_time[0])),
> -		  __print_array(__entry->f.order_hints,
> -				ARRAY_SIZE(__entry->f.order_hints),
> -				sizeof(__entry->f.order_hints[0])),
> -		  __print_array(__entry->f.reference_frame_ts,
> -				ARRAY_SIZE(__entry->f.reference_frame_ts),
> -				sizeof(__entry->f.reference_frame_ts[0])),
> -		  __print_array(__entry->f.ref_frame_idx,
> -				ARRAY_SIZE(__entry->f.ref_frame_idx),
> -				sizeof(__entry->f.ref_frame_idx[0])),
> -		  __entry->f.refresh_frame_flags
> -	)
> -);
> -
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_av1_film_grain_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_av1_film_grain *f),
> -	TP_ARGS(f),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_film_grain, f)),
> -	TP_fast_assign(__entry->f = *f;),
> -	TP_printk("\nflags %s\ncr_mult: %u\ngrain_seed: %u\n"
> -		  "film_grain_params_ref_idx: %u\nnum_y_points: %u\npoint_y_value: %s\n"
> -		  "point_y_scaling: %s\nnum_cb_points: %u\npoint_cb_value: %s\n"
> -		  "point_cb_scaling: %s\nnum_cr_points: %u\npoint_cr_value: %s\n"
> -		  "point_cr_scaling: %s\ngrain_scaling_minus_8: %u\nar_coeff_lag: %u\n"
> -		  "ar_coeffs_y_plus_128: %s\nar_coeffs_cb_plus_128: %s\n"
> -		  "ar_coeffs_cr_plus_128: %s\nar_coeff_shift_minus_6: %u\n"
> -		  "grain_scale_shift: %u\ncb_mult: %u\ncb_luma_mult: %u\ncr_luma_mult: %u\n"
> -		  "cb_offset: %u\ncr_offset: %u\n",
> -		  __print_flags(__entry->f.flags, "|",
> -		  {V4L2_AV1_FILM_GRAIN_FLAG_APPLY_GRAIN, "APPLY_GRAIN"},
> -		  {V4L2_AV1_FILM_GRAIN_FLAG_UPDATE_GRAIN, "UPDATE_GRAIN"},
> -		  {V4L2_AV1_FILM_GRAIN_FLAG_CHROMA_SCALING_FROM_LUMA, "CHROMA_SCALING_FROM_LUMA"},
> -		  {V4L2_AV1_FILM_GRAIN_FLAG_OVERLAP, "OVERLAP"},
> -		  {V4L2_AV1_FILM_GRAIN_FLAG_CLIP_TO_RESTRICTED_RANGE, "CLIP_TO_RESTRICTED_RANGE"}),
> -		  __entry->f.cr_mult,
> -		  __entry->f.grain_seed,
> -		  __entry->f.film_grain_params_ref_idx,
> -		  __entry->f.num_y_points,
> -		  __print_array(__entry->f.point_y_value,
> -				ARRAY_SIZE(__entry->f.point_y_value),
> -				sizeof(__entry->f.point_y_value[0])),
> -		  __print_array(__entry->f.point_y_scaling,
> -				ARRAY_SIZE(__entry->f.point_y_scaling),
> -				sizeof(__entry->f.point_y_scaling[0])),
> -		  __entry->f.num_cb_points,
> -		  __print_array(__entry->f.point_cb_value,
> -				ARRAY_SIZE(__entry->f.point_cb_value),
> -				sizeof(__entry->f.point_cb_value[0])),
> -		  __print_array(__entry->f.point_cb_scaling,
> -				ARRAY_SIZE(__entry->f.point_cb_scaling),
> -				sizeof(__entry->f.point_cb_scaling[0])),
> -		  __entry->f.num_cr_points,
> -		  __print_array(__entry->f.point_cr_value,
> -				ARRAY_SIZE(__entry->f.point_cr_value),
> -				sizeof(__entry->f.point_cr_value[0])),
> -		  __print_array(__entry->f.point_cr_scaling,
> -				ARRAY_SIZE(__entry->f.point_cr_scaling),
> -				sizeof(__entry->f.point_cr_scaling[0])),
> -		  __entry->f.grain_scaling_minus_8,
> -		  __entry->f.ar_coeff_lag,
> -		  __print_array(__entry->f.ar_coeffs_y_plus_128,
> -				ARRAY_SIZE(__entry->f.ar_coeffs_y_plus_128),
> -				sizeof(__entry->f.ar_coeffs_y_plus_128[0])),
> -		  __print_array(__entry->f.ar_coeffs_cb_plus_128,
> -				ARRAY_SIZE(__entry->f.ar_coeffs_cb_plus_128),
> -				sizeof(__entry->f.ar_coeffs_cb_plus_128[0])),
> -		  __print_array(__entry->f.ar_coeffs_cr_plus_128,
> -				ARRAY_SIZE(__entry->f.ar_coeffs_cr_plus_128),
> -				sizeof(__entry->f.ar_coeffs_cr_plus_128[0])),
> -		  __entry->f.ar_coeff_shift_minus_6,
> -		  __entry->f.grain_scale_shift,
> -		  __entry->f.cb_mult,
> -		  __entry->f.cb_luma_mult,
> -		  __entry->f.cr_luma_mult,
> -		  __entry->f.cb_offset,
> -		  __entry->f.cr_offset
> -	)
> -)
> -
> -DEFINE_EVENT(v4l2_ctrl_av1_seq_tmpl, v4l2_ctrl_av1_sequence,
> -	TP_PROTO(const struct v4l2_ctrl_av1_sequence *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_av1_frame_tmpl, v4l2_ctrl_av1_frame,
> -	TP_PROTO(const struct v4l2_ctrl_av1_frame *f),
> -	TP_ARGS(f)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_av1_tge_tmpl, v4l2_ctrl_av1_tile_group_entry,
> -	TP_PROTO(const struct v4l2_ctrl_av1_tile_group_entry *t),
> -	TP_ARGS(t)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_av1_film_grain_tmpl, v4l2_ctrl_av1_film_grain,
> -	TP_PROTO(const struct v4l2_ctrl_av1_film_grain *f),
> -	TP_ARGS(f)
> -);
> -
> -#endif
> -
> -#undef TRACE_INCLUDE_PATH
> -#undef TRACE_INCLUDE_FILE
> -#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
> -#define TRACE_INCLUDE_FILE visl-trace-av1
> -#include <trace/define_trace.h>
> diff --git a/drivers/media/test-drivers/visl/visl-trace-fwht.h b/drivers/media/test-drivers/visl/visl-trace-fwht.h
> deleted file mode 100644
> index 54b119359ff5..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-fwht.h
> +++ /dev/null
> @@ -1,66 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#if !defined(_VISL_TRACE_FWHT_H_) || defined(TRACE_HEADER_MULTI_READ)
> -#define _VISL_TRACE_FWHT_H_
> -
> -#include <linux/tracepoint.h>
> -#include "visl.h"
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM visl_fwht_controls
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_fwht_params_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_fwht_params *p),
> -	TP_ARGS(p),
> -	TP_STRUCT__entry(
> -			 __field(u64, backward_ref_ts)
> -			 __field(u32, version)
> -			 __field(u32, width)
> -			 __field(u32, height)
> -			 __field(u32, flags)
> -			 __field(u32, colorspace)
> -			 __field(u32, xfer_func)
> -			 __field(u32, ycbcr_enc)
> -			 __field(u32, quantization)
> -			 ),
> -	TP_fast_assign(
> -		       __entry->backward_ref_ts = p->backward_ref_ts;
> -		       __entry->version = p->version;
> -		       __entry->width = p->width;
> -		       __entry->height = p->height;
> -		       __entry->flags = p->flags;
> -		       __entry->colorspace = p->colorspace;
> -		       __entry->xfer_func = p->xfer_func;
> -		       __entry->ycbcr_enc = p->ycbcr_enc;
> -		       __entry->quantization = p->quantization;
> -		       ),
> -	TP_printk("backward_ref_ts %llu version %u width %u height %u flags %s colorspace %u xfer_func %u ycbcr_enc %u quantization %u",
> -		  __entry->backward_ref_ts, __entry->version, __entry->width, __entry->height,
> -		  __print_flags(__entry->flags, "|",
> -		  {V4L2_FWHT_FL_IS_INTERLACED, "IS_INTERLACED"},
> -		  {V4L2_FWHT_FL_IS_BOTTOM_FIRST, "IS_BOTTOM_FIRST"},
> -		  {V4L2_FWHT_FL_IS_ALTERNATE, "IS_ALTERNATE"},
> -		  {V4L2_FWHT_FL_IS_BOTTOM_FIELD, "IS_BOTTOM_FIELD"},
> -		  {V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED, "LUMA_IS_UNCOMPRESSED"},
> -		  {V4L2_FWHT_FL_CB_IS_UNCOMPRESSED, "CB_IS_UNCOMPRESSED"},
> -		  {V4L2_FWHT_FL_CR_IS_UNCOMPRESSED, "CR_IS_UNCOMPRESSED"},
> -		  {V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED, "ALPHA_IS_UNCOMPRESSED"},
> -		  {V4L2_FWHT_FL_I_FRAME, "I_FRAME"},
> -		  {V4L2_FWHT_FL_PIXENC_HSV, "PIXENC_HSV"},
> -		  {V4L2_FWHT_FL_PIXENC_RGB, "PIXENC_RGB"},
> -		  {V4L2_FWHT_FL_PIXENC_YUV, "PIXENC_YUV"}),
> -		  __entry->colorspace, __entry->xfer_func, __entry->ycbcr_enc,
> -		  __entry->quantization)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_fwht_params_tmpl, v4l2_ctrl_fwht_params,
> -	TP_PROTO(const struct v4l2_ctrl_fwht_params *p),
> -	TP_ARGS(p)
> -);
> -
> -#endif
> -
> -#undef TRACE_INCLUDE_PATH
> -#undef TRACE_INCLUDE_FILE
> -#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
> -#define TRACE_INCLUDE_FILE visl-trace-fwht
> -#include <trace/define_trace.h>
> diff --git a/drivers/media/test-drivers/visl/visl-trace-h264.h b/drivers/media/test-drivers/visl/visl-trace-h264.h
> deleted file mode 100644
> index d84296a01deb..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-h264.h
> +++ /dev/null
> @@ -1,349 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#if !defined(_VISL_TRACE_H264_H_) || defined(TRACE_HEADER_MULTI_READ)
> -#define _VISL_TRACE_H264_H_
> -
> -#include <linux/tracepoint.h>
> -#include "visl.h"
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM visl_h264_controls
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_h264_sps_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_h264_sps *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_sps, s)),
> -	TP_fast_assign(__entry->s = *s),
> -	TP_printk("\nprofile_idc %u\n"
> -		  "constraint_set_flags %s\n"
> -		  "level_idc %u\n"
> -		  "seq_parameter_set_id %u\n"
> -		  "chroma_format_idc %u\n"
> -		  "bit_depth_luma_minus8 %u\n"
> -		  "bit_depth_chroma_minus8 %u\n"
> -		  "log2_max_frame_num_minus4 %u\n"
> -		  "pic_order_cnt_type %u\n"
> -		  "log2_max_pic_order_cnt_lsb_minus4 %u\n"
> -		  "max_num_ref_frames %u\n"
> -		  "num_ref_frames_in_pic_order_cnt_cycle %u\n"
> -		  "offset_for_ref_frame %s\n"
> -		  "offset_for_non_ref_pic %d\n"
> -		  "offset_for_top_to_bottom_field %d\n"
> -		  "pic_width_in_mbs_minus1 %u\n"
> -		  "pic_height_in_map_units_minus1 %u\n"
> -		  "flags %s",
> -		  __entry->s.profile_idc,
> -		  __print_flags(__entry->s.constraint_set_flags, "|",
> -		  {V4L2_H264_SPS_CONSTRAINT_SET0_FLAG, "CONSTRAINT_SET0_FLAG"},
> -		  {V4L2_H264_SPS_CONSTRAINT_SET1_FLAG, "CONSTRAINT_SET1_FLAG"},
> -		  {V4L2_H264_SPS_CONSTRAINT_SET2_FLAG, "CONSTRAINT_SET2_FLAG"},
> -		  {V4L2_H264_SPS_CONSTRAINT_SET3_FLAG, "CONSTRAINT_SET3_FLAG"},
> -		  {V4L2_H264_SPS_CONSTRAINT_SET4_FLAG, "CONSTRAINT_SET4_FLAG"},
> -		  {V4L2_H264_SPS_CONSTRAINT_SET5_FLAG, "CONSTRAINT_SET5_FLAG"}),
> -		  __entry->s.level_idc,
> -		  __entry->s.seq_parameter_set_id,
> -		  __entry->s.chroma_format_idc,
> -		  __entry->s.bit_depth_luma_minus8,
> -		  __entry->s.bit_depth_chroma_minus8,
> -		  __entry->s.log2_max_frame_num_minus4,
> -		  __entry->s.pic_order_cnt_type,
> -		  __entry->s.log2_max_pic_order_cnt_lsb_minus4,
> -		  __entry->s.max_num_ref_frames,
> -		  __entry->s.num_ref_frames_in_pic_order_cnt_cycle,
> -		  __print_array(__entry->s.offset_for_ref_frame,
> -				ARRAY_SIZE(__entry->s.offset_for_ref_frame),
> -				sizeof(__entry->s.offset_for_ref_frame[0])),
> -		  __entry->s.offset_for_non_ref_pic,
> -		  __entry->s.offset_for_top_to_bottom_field,
> -		  __entry->s.pic_width_in_mbs_minus1,
> -		  __entry->s.pic_height_in_map_units_minus1,
> -		  __print_flags(__entry->s.flags, "|",
> -		  {V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE, "SEPARATE_COLOUR_PLANE"},
> -		  {V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS, "QPPRIME_Y_ZERO_TRANSFORM_BYPASS"},
> -		  {V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO, "DELTA_PIC_ORDER_ALWAYS_ZERO"},
> -		  {V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED, "GAPS_IN_FRAME_NUM_VALUE_ALLOWED"},
> -		  {V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY, "FRAME_MBS_ONLY"},
> -		  {V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD, "MB_ADAPTIVE_FRAME_FIELD"},
> -		  {V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE, "DIRECT_8X8_INFERENCE"}
> -		  ))
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_h264_pps_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_h264_pps *p),
> -	TP_ARGS(p),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_pps, p)),
> -	TP_fast_assign(__entry->p = *p),
> -	TP_printk("\npic_parameter_set_id %u\n"
> -		  "seq_parameter_set_id %u\n"
> -		  "num_slice_groups_minus1 %u\n"
> -		  "num_ref_idx_l0_default_active_minus1 %u\n"
> -		  "num_ref_idx_l1_default_active_minus1 %u\n"
> -		  "weighted_bipred_idc %u\n"
> -		  "pic_init_qp_minus26 %d\n"
> -		  "pic_init_qs_minus26 %d\n"
> -		  "chroma_qp_index_offset %d\n"
> -		  "second_chroma_qp_index_offset %d\n"
> -		  "flags %s",
> -		  __entry->p.pic_parameter_set_id,
> -		  __entry->p.seq_parameter_set_id,
> -		  __entry->p.num_slice_groups_minus1,
> -		  __entry->p.num_ref_idx_l0_default_active_minus1,
> -		  __entry->p.num_ref_idx_l1_default_active_minus1,
> -		  __entry->p.weighted_bipred_idc,
> -		  __entry->p.pic_init_qp_minus26,
> -		  __entry->p.pic_init_qs_minus26,
> -		  __entry->p.chroma_qp_index_offset,
> -		  __entry->p.second_chroma_qp_index_offset,
> -		  __print_flags(__entry->p.flags, "|",
> -		  {V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE, "ENTROPY_CODING_MODE"},
> -		  {V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT, "BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT"},
> -		  {V4L2_H264_PPS_FLAG_WEIGHTED_PRED, "WEIGHTED_PRED"},
> -		  {V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT, "DEBLOCKING_FILTER_CONTROL_PRESENT"},
> -		  {V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED, "CONSTRAINED_INTRA_PRED"},
> -		  {V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT, "REDUNDANT_PIC_CNT_PRESENT"},
> -		  {V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE, "TRANSFORM_8X8_MODE"},
> -		  {V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT, "SCALING_MATRIX_PRESENT"}
> -		  ))
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_h264_scaling_matrix_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_h264_scaling_matrix *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_scaling_matrix, s)),
> -	TP_fast_assign(__entry->s = *s),
> -	TP_printk("\nscaling_list_4x4 {%s}\nscaling_list_8x8 {%s}",
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->s.scaling_list_4x4,
> -				   sizeof(__entry->s.scaling_list_4x4),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->s.scaling_list_8x8,
> -				   sizeof(__entry->s.scaling_list_8x8),
> -				   false)
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_h264_pred_weights_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_h264_pred_weights *p),
> -	TP_ARGS(p),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_pred_weights, p)),
> -	TP_fast_assign(__entry->p = *p),
> -	TP_printk("\nluma_log2_weight_denom %u\n"
> -		  "chroma_log2_weight_denom %u\n"
> -		  "weight_factor[0].luma_weight %s\n"
> -		  "weight_factor[0].luma_offset %s\n"
> -		  "weight_factor[0].chroma_weight {%s}\n"
> -		  "weight_factor[0].chroma_offset {%s}\n"
> -		  "weight_factor[1].luma_weight %s\n"
> -		  "weight_factor[1].luma_offset %s\n"
> -		  "weight_factor[1].chroma_weight {%s}\n"
> -		  "weight_factor[1].chroma_offset {%s}\n",
> -		  __entry->p.luma_log2_weight_denom,
> -		  __entry->p.chroma_log2_weight_denom,
> -		  __print_array(__entry->p.weight_factors[0].luma_weight,
> -				ARRAY_SIZE(__entry->p.weight_factors[0].luma_weight),
> -				sizeof(__entry->p.weight_factors[0].luma_weight[0])),
> -		  __print_array(__entry->p.weight_factors[0].luma_offset,
> -				ARRAY_SIZE(__entry->p.weight_factors[0].luma_offset),
> -				sizeof(__entry->p.weight_factors[0].luma_offset[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.weight_factors[0].chroma_weight,
> -				   sizeof(__entry->p.weight_factors[0].chroma_weight),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.weight_factors[0].chroma_offset,
> -				   sizeof(__entry->p.weight_factors[0].chroma_offset),
> -				   false),
> -		  __print_array(__entry->p.weight_factors[1].luma_weight,
> -				ARRAY_SIZE(__entry->p.weight_factors[1].luma_weight),
> -				sizeof(__entry->p.weight_factors[1].luma_weight[0])),
> -		  __print_array(__entry->p.weight_factors[1].luma_offset,
> -				ARRAY_SIZE(__entry->p.weight_factors[1].luma_offset),
> -				sizeof(__entry->p.weight_factors[1].luma_offset[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.weight_factors[1].chroma_weight,
> -				   sizeof(__entry->p.weight_factors[1].chroma_weight),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.weight_factors[1].chroma_offset,
> -				   sizeof(__entry->p.weight_factors[1].chroma_offset),
> -				   false)
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_h264_slice_params_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_h264_slice_params *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_slice_params, s)),
> -	TP_fast_assign(__entry->s = *s),
> -	TP_printk("\nheader_bit_size %u\n"
> -		  "first_mb_in_slice %u\n"
> -		  "slice_type %s\n"
> -		  "colour_plane_id %u\n"
> -		  "redundant_pic_cnt %u\n"
> -		  "cabac_init_idc %u\n"
> -		  "slice_qp_delta %d\n"
> -		  "slice_qs_delta %d\n"
> -		  "disable_deblocking_filter_idc %u\n"
> -		  "slice_alpha_c0_offset_div2 %u\n"
> -		  "slice_beta_offset_div2 %u\n"
> -		  "num_ref_idx_l0_active_minus1 %u\n"
> -		  "num_ref_idx_l1_active_minus1 %u\n"
> -		  "flags %s",
> -		  __entry->s.header_bit_size,
> -		  __entry->s.first_mb_in_slice,
> -		  __print_symbolic(__entry->s.slice_type,
> -		  {V4L2_H264_SLICE_TYPE_P, "P"},
> -		  {V4L2_H264_SLICE_TYPE_B, "B"},
> -		  {V4L2_H264_SLICE_TYPE_I, "I"},
> -		  {V4L2_H264_SLICE_TYPE_SP, "SP"},
> -		  {V4L2_H264_SLICE_TYPE_SI, "SI"}),
> -		  __entry->s.colour_plane_id,
> -		  __entry->s.redundant_pic_cnt,
> -		  __entry->s.cabac_init_idc,
> -		  __entry->s.slice_qp_delta,
> -		  __entry->s.slice_qs_delta,
> -		  __entry->s.disable_deblocking_filter_idc,
> -		  __entry->s.slice_alpha_c0_offset_div2,
> -		  __entry->s.slice_beta_offset_div2,
> -		  __entry->s.num_ref_idx_l0_active_minus1,
> -		  __entry->s.num_ref_idx_l1_active_minus1,
> -		  __print_flags(__entry->s.flags, "|",
> -		  {V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED, "DIRECT_SPATIAL_MV_PRED"},
> -		  {V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH, "SP_FOR_SWITCH"})
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_h264_reference_tmpl,
> -	TP_PROTO(const struct v4l2_h264_reference *r, int i),
> -	TP_ARGS(r, i),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_h264_reference, r)
> -			 __field(int, i)),
> -	TP_fast_assign(__entry->r = *r; __entry->i = i;),
> -	TP_printk("[%d]: fields %s index %u",
> -		  __entry->i,
> -		  __print_flags(__entry->r.fields, "|",
> -		  {V4L2_H264_TOP_FIELD_REF, "TOP_FIELD_REF"},
> -		  {V4L2_H264_BOTTOM_FIELD_REF, "BOTTOM_FIELD_REF"},
> -		  {V4L2_H264_FRAME_REF, "FRAME_REF"}),
> -		  __entry->r.index
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_h264_decode_params_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_h264_decode_params *d),
> -	TP_ARGS(d),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_decode_params, d)),
> -	TP_fast_assign(__entry->d = *d),
> -	TP_printk("\nnal_ref_idc %u\n"
> -		  "frame_num %u\n"
> -		  "top_field_order_cnt %d\n"
> -		  "bottom_field_order_cnt %d\n"
> -		  "idr_pic_id %u\n"
> -		  "pic_order_cnt_lsb %u\n"
> -		  "delta_pic_order_cnt_bottom %d\n"
> -		  "delta_pic_order_cnt0 %d\n"
> -		  "delta_pic_order_cnt1 %d\n"
> -		  "dec_ref_pic_marking_bit_size %u\n"
> -		  "pic_order_cnt_bit_size %u\n"
> -		  "slice_group_change_cycle %u\n"
> -		  "flags %s\n",
> -		  __entry->d.nal_ref_idc,
> -		  __entry->d.frame_num,
> -		  __entry->d.top_field_order_cnt,
> -		  __entry->d.bottom_field_order_cnt,
> -		  __entry->d.idr_pic_id,
> -		  __entry->d.pic_order_cnt_lsb,
> -		  __entry->d.delta_pic_order_cnt_bottom,
> -		  __entry->d.delta_pic_order_cnt0,
> -		  __entry->d.delta_pic_order_cnt1,
> -		  __entry->d.dec_ref_pic_marking_bit_size,
> -		  __entry->d.pic_order_cnt_bit_size,
> -		  __entry->d.slice_group_change_cycle,
> -		  __print_flags(__entry->d.flags, "|",
> -		  {V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC, "IDR_PIC"},
> -		  {V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC, "FIELD_PIC"},
> -		  {V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD, "BOTTOM_FIELD"},
> -		  {V4L2_H264_DECODE_PARAM_FLAG_PFRAME, "PFRAME"},
> -		  {V4L2_H264_DECODE_PARAM_FLAG_BFRAME, "BFRAME"})
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_h264_dpb_entry_tmpl,
> -	TP_PROTO(const struct v4l2_h264_dpb_entry *e, int i),
> -	TP_ARGS(e, i),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_h264_dpb_entry, e)
> -			 __field(int, i)),
> -	TP_fast_assign(__entry->e = *e; __entry->i = i;),
> -	TP_printk("[%d]: reference_ts %llu, pic_num %u frame_num %u fields %s "
> -		  "top_field_order_cnt %d bottom_field_order_cnt %d flags %s",
> -		  __entry->i,
> -		  __entry->e.reference_ts,
> -		  __entry->e.pic_num,
> -		  __entry->e.frame_num,
> -		  __print_flags(__entry->e.fields, "|",
> -		  {V4L2_H264_TOP_FIELD_REF, "TOP_FIELD_REF"},
> -		  {V4L2_H264_BOTTOM_FIELD_REF, "BOTTOM_FIELD_REF"},
> -		  {V4L2_H264_FRAME_REF, "FRAME_REF"}),
> -		  __entry->e.top_field_order_cnt,
> -		  __entry->e.bottom_field_order_cnt,
> -		  __print_flags(__entry->e.flags, "|",
> -		  {V4L2_H264_DPB_ENTRY_FLAG_VALID, "VALID"},
> -		  {V4L2_H264_DPB_ENTRY_FLAG_ACTIVE, "ACTIVE"},
> -		  {V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM, "LONG_TERM"},
> -		  {V4L2_H264_DPB_ENTRY_FLAG_FIELD, "FIELD"})
> -
> -	)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_h264_sps_tmpl, v4l2_ctrl_h264_sps,
> -	TP_PROTO(const struct v4l2_ctrl_h264_sps *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_h264_pps_tmpl, v4l2_ctrl_h264_pps,
> -	TP_PROTO(const struct v4l2_ctrl_h264_pps *p),
> -	TP_ARGS(p)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_h264_scaling_matrix_tmpl, v4l2_ctrl_h264_scaling_matrix,
> -	TP_PROTO(const struct v4l2_ctrl_h264_scaling_matrix *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_h264_pred_weights_tmpl, v4l2_ctrl_h264_pred_weights,
> -	TP_PROTO(const struct v4l2_ctrl_h264_pred_weights *p),
> -	TP_ARGS(p)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_h264_slice_params_tmpl, v4l2_ctrl_h264_slice_params,
> -	TP_PROTO(const struct v4l2_ctrl_h264_slice_params *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_h264_reference_tmpl, v4l2_h264_ref_pic_list0,
> -	TP_PROTO(const struct v4l2_h264_reference *r, int i),
> -	TP_ARGS(r, i)
> -);
> -
> -DEFINE_EVENT(v4l2_h264_reference_tmpl, v4l2_h264_ref_pic_list1,
> -	TP_PROTO(const struct v4l2_h264_reference *r, int i),
> -	TP_ARGS(r, i)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_h264_decode_params_tmpl, v4l2_ctrl_h264_decode_params,
> -	TP_PROTO(const struct v4l2_ctrl_h264_decode_params *d),
> -	TP_ARGS(d)
> -);
> -
> -DEFINE_EVENT(v4l2_h264_dpb_entry_tmpl, v4l2_h264_dpb_entry,
> -	TP_PROTO(const struct v4l2_h264_dpb_entry *e, int i),
> -	TP_ARGS(e, i)
> -);
> -
> -#endif
> -
> -#undef TRACE_INCLUDE_PATH
> -#undef TRACE_INCLUDE_FILE
> -#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
> -#define TRACE_INCLUDE_FILE visl-trace-h264
> -#include <trace/define_trace.h>
> diff --git a/drivers/media/test-drivers/visl/visl-trace-hevc.h b/drivers/media/test-drivers/visl/visl-trace-hevc.h
> deleted file mode 100644
> index 963914c463db..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-hevc.h
> +++ /dev/null
> @@ -1,464 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -#include "linux/v4l2-controls.h"
> -#if !defined(_VISL_TRACE_HEVC_H_) || defined(TRACE_HEADER_MULTI_READ)
> -#define _VISL_TRACE_HEVC_H_
> -
> -#include <linux/tracepoint.h>
> -#include "visl.h"
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM visl_hevc_controls
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_sps_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_sps *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_sps, s)),
> -	TP_fast_assign(__entry->s = *s),
> -	TP_printk("\nvideo_parameter_set_id %u\n"
> -		  "seq_parameter_set_id %u\n"
> -		  "pic_width_in_luma_samples %u\n"
> -		  "pic_height_in_luma_samples %u\n"
> -		  "bit_depth_luma_minus8 %u\n"
> -		  "bit_depth_chroma_minus8 %u\n"
> -		  "log2_max_pic_order_cnt_lsb_minus4 %u\n"
> -		  "sps_max_dec_pic_buffering_minus1 %u\n"
> -		  "sps_max_num_reorder_pics %u\n"
> -		  "sps_max_latency_increase_plus1 %u\n"
> -		  "log2_min_luma_coding_block_size_minus3 %u\n"
> -		  "log2_diff_max_min_luma_coding_block_size %u\n"
> -		  "log2_min_luma_transform_block_size_minus2 %u\n"
> -		  "log2_diff_max_min_luma_transform_block_size %u\n"
> -		  "max_transform_hierarchy_depth_inter %u\n"
> -		  "max_transform_hierarchy_depth_intra %u\n"
> -		  "pcm_sample_bit_depth_luma_minus1 %u\n"
> -		  "pcm_sample_bit_depth_chroma_minus1 %u\n"
> -		  "log2_min_pcm_luma_coding_block_size_minus3 %u\n"
> -		  "log2_diff_max_min_pcm_luma_coding_block_size %u\n"
> -		  "num_short_term_ref_pic_sets %u\n"
> -		  "num_long_term_ref_pics_sps %u\n"
> -		  "chroma_format_idc %u\n"
> -		  "sps_max_sub_layers_minus1 %u\n"
> -		  "flags %s",
> -		  __entry->s.video_parameter_set_id,
> -		  __entry->s.seq_parameter_set_id,
> -		  __entry->s.pic_width_in_luma_samples,
> -		  __entry->s.pic_height_in_luma_samples,
> -		  __entry->s.bit_depth_luma_minus8,
> -		  __entry->s.bit_depth_chroma_minus8,
> -		  __entry->s.log2_max_pic_order_cnt_lsb_minus4,
> -		  __entry->s.sps_max_dec_pic_buffering_minus1,
> -		  __entry->s.sps_max_num_reorder_pics,
> -		  __entry->s.sps_max_latency_increase_plus1,
> -		  __entry->s.log2_min_luma_coding_block_size_minus3,
> -		  __entry->s.log2_diff_max_min_luma_coding_block_size,
> -		  __entry->s.log2_min_luma_transform_block_size_minus2,
> -		  __entry->s.log2_diff_max_min_luma_transform_block_size,
> -		  __entry->s.max_transform_hierarchy_depth_inter,
> -		  __entry->s.max_transform_hierarchy_depth_intra,
> -		  __entry->s.pcm_sample_bit_depth_luma_minus1,
> -		  __entry->s.pcm_sample_bit_depth_chroma_minus1,
> -		  __entry->s.log2_min_pcm_luma_coding_block_size_minus3,
> -		  __entry->s.log2_diff_max_min_pcm_luma_coding_block_size,
> -		  __entry->s.num_short_term_ref_pic_sets,
> -		  __entry->s.num_long_term_ref_pics_sps,
> -		  __entry->s.chroma_format_idc,
> -		  __entry->s.sps_max_sub_layers_minus1,
> -		  __print_flags(__entry->s.flags, "|",
> -		  {V4L2_HEVC_SPS_FLAG_SEPARATE_COLOUR_PLANE, "SEPARATE_COLOUR_PLANE"},
> -		  {V4L2_HEVC_SPS_FLAG_SCALING_LIST_ENABLED, "SCALING_LIST_ENABLED"},
> -		  {V4L2_HEVC_SPS_FLAG_AMP_ENABLED, "AMP_ENABLED"},
> -		  {V4L2_HEVC_SPS_FLAG_SAMPLE_ADAPTIVE_OFFSET, "SAMPLE_ADAPTIVE_OFFSET"},
> -		  {V4L2_HEVC_SPS_FLAG_PCM_ENABLED, "PCM_ENABLED"},
> -		  {V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED, "V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED"},
> -		  {V4L2_HEVC_SPS_FLAG_LONG_TERM_REF_PICS_PRESENT, "LONG_TERM_REF_PICS_PRESENT"},
> -		  {V4L2_HEVC_SPS_FLAG_SPS_TEMPORAL_MVP_ENABLED, "TEMPORAL_MVP_ENABLED"},
> -		  {V4L2_HEVC_SPS_FLAG_STRONG_INTRA_SMOOTHING_ENABLED, "STRONG_INTRA_SMOOTHING_ENABLED"}
> -	))
> -
> -);
> -
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_pps_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_pps *p),
> -	TP_ARGS(p),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_pps, p)),
> -	TP_fast_assign(__entry->p = *p),
> -	TP_printk("\npic_parameter_set_id %u\n"
> -		  "num_extra_slice_header_bits %u\n"
> -		  "num_ref_idx_l0_default_active_minus1 %u\n"
> -		  "num_ref_idx_l1_default_active_minus1 %u\n"
> -		  "init_qp_minus26 %d\n"
> -		  "diff_cu_qp_delta_depth %u\n"
> -		  "pps_cb_qp_offset %d\n"
> -		  "pps_cr_qp_offset %d\n"
> -		  "num_tile_columns_minus1 %d\n"
> -		  "num_tile_rows_minus1 %d\n"
> -		  "column_width_minus1 %s\n"
> -		  "row_height_minus1 %s\n"
> -		  "pps_beta_offset_div2 %d\n"
> -		  "pps_tc_offset_div2 %d\n"
> -		  "log2_parallel_merge_level_minus2 %u\n"
> -		  "flags %s",
> -		  __entry->p.pic_parameter_set_id,
> -		  __entry->p.num_extra_slice_header_bits,
> -		  __entry->p.num_ref_idx_l0_default_active_minus1,
> -		  __entry->p.num_ref_idx_l1_default_active_minus1,
> -		  __entry->p.init_qp_minus26,
> -		  __entry->p.diff_cu_qp_delta_depth,
> -		  __entry->p.pps_cb_qp_offset,
> -		  __entry->p.pps_cr_qp_offset,
> -		  __entry->p.num_tile_columns_minus1,
> -		  __entry->p.num_tile_rows_minus1,
> -		  __print_array(__entry->p.column_width_minus1,
> -				ARRAY_SIZE(__entry->p.column_width_minus1),
> -				sizeof(__entry->p.column_width_minus1[0])),
> -		  __print_array(__entry->p.row_height_minus1,
> -				ARRAY_SIZE(__entry->p.row_height_minus1),
> -				sizeof(__entry->p.row_height_minus1[0])),
> -		  __entry->p.pps_beta_offset_div2,
> -		  __entry->p.pps_tc_offset_div2,
> -		  __entry->p.log2_parallel_merge_level_minus2,
> -		  __print_flags(__entry->p.flags, "|",
> -		  {V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT_ENABLED, "DEPENDENT_SLICE_SEGMENT_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT, "OUTPUT_FLAG_PRESENT"},
> -		  {V4L2_HEVC_PPS_FLAG_SIGN_DATA_HIDING_ENABLED, "SIGN_DATA_HIDING_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_CABAC_INIT_PRESENT, "CABAC_INIT_PRESENT"},
> -		  {V4L2_HEVC_PPS_FLAG_CONSTRAINED_INTRA_PRED, "CONSTRAINED_INTRA_PRED"},
> -		  {V4L2_HEVC_PPS_FLAG_CU_QP_DELTA_ENABLED, "CU_QP_DELTA_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT, "PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT"},
> -		  {V4L2_HEVC_PPS_FLAG_WEIGHTED_PRED, "WEIGHTED_PRED"},
> -		  {V4L2_HEVC_PPS_FLAG_WEIGHTED_BIPRED, "WEIGHTED_BIPRED"},
> -		  {V4L2_HEVC_PPS_FLAG_TRANSQUANT_BYPASS_ENABLED, "TRANSQUANT_BYPASS_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_TILES_ENABLED, "TILES_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_ENTROPY_CODING_SYNC_ENABLED, "ENTROPY_CODING_SYNC_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_LOOP_FILTER_ACROSS_TILES_ENABLED, "LOOP_FILTER_ACROSS_TILES_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED, "PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_OVERRIDE_ENABLED, "DEBLOCKING_FILTER_OVERRIDE_ENABLED"},
> -		  {V4L2_HEVC_PPS_FLAG_PPS_DISABLE_DEBLOCKING_FILTER, "DISABLE_DEBLOCKING_FILTER"},
> -		  {V4L2_HEVC_PPS_FLAG_LISTS_MODIFICATION_PRESENT, "LISTS_MODIFICATION_PRESENT"},
> -		  {V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT, "SLICE_SEGMENT_HEADER_EXTENSION_PRESENT"},
> -		  {V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT, "DEBLOCKING_FILTER_CONTROL_PRESENT"},
> -		  {V4L2_HEVC_PPS_FLAG_UNIFORM_SPACING, "UNIFORM_SPACING"}
> -	))
> -
> -);
> -
> -
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_slice_params_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_slice_params *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_slice_params, s)),
> -	TP_fast_assign(__entry->s = *s),
> -	TP_printk("\nbit_size %u\n"
> -		  "data_byte_offset %u\n"
> -		  "num_entry_point_offsets %u\n"
> -		  "nal_unit_type %u\n"
> -		  "nuh_temporal_id_plus1 %u\n"
> -		  "slice_type %u\n"
> -		  "colour_plane_id %u\n"
> -		  "slice_pic_order_cnt %d\n"
> -		  "num_ref_idx_l0_active_minus1 %u\n"
> -		  "num_ref_idx_l1_active_minus1 %u\n"
> -		  "collocated_ref_idx %u\n"
> -		  "five_minus_max_num_merge_cand %u\n"
> -		  "slice_qp_delta %d\n"
> -		  "slice_cb_qp_offset %d\n"
> -		  "slice_cr_qp_offset %d\n"
> -		  "slice_act_y_qp_offset %d\n"
> -		  "slice_act_cb_qp_offset %d\n"
> -		  "slice_act_cr_qp_offset %d\n"
> -		  "slice_beta_offset_div2 %d\n"
> -		  "slice_tc_offset_div2 %d\n"
> -		  "pic_struct %u\n"
> -		  "slice_segment_addr %u\n"
> -		  "ref_idx_l0 %s\n"
> -		  "ref_idx_l1 %s\n"
> -		  "short_term_ref_pic_set_size %u\n"
> -		  "long_term_ref_pic_set_size %u\n"
> -		  "flags %s",
> -		  __entry->s.bit_size,
> -		  __entry->s.data_byte_offset,
> -		  __entry->s.num_entry_point_offsets,
> -		  __entry->s.nal_unit_type,
> -		  __entry->s.nuh_temporal_id_plus1,
> -		  __entry->s.slice_type,
> -		  __entry->s.colour_plane_id,
> -		  __entry->s.slice_pic_order_cnt,
> -		  __entry->s.num_ref_idx_l0_active_minus1,
> -		  __entry->s.num_ref_idx_l1_active_minus1,
> -		  __entry->s.collocated_ref_idx,
> -		  __entry->s.five_minus_max_num_merge_cand,
> -		  __entry->s.slice_qp_delta,
> -		  __entry->s.slice_cb_qp_offset,
> -		  __entry->s.slice_cr_qp_offset,
> -		  __entry->s.slice_act_y_qp_offset,
> -		  __entry->s.slice_act_cb_qp_offset,
> -		  __entry->s.slice_act_cr_qp_offset,
> -		  __entry->s.slice_beta_offset_div2,
> -		  __entry->s.slice_tc_offset_div2,
> -		  __entry->s.pic_struct,
> -		  __entry->s.slice_segment_addr,
> -		  __print_array(__entry->s.ref_idx_l0,
> -				ARRAY_SIZE(__entry->s.ref_idx_l0),
> -				sizeof(__entry->s.ref_idx_l0[0])),
> -		  __print_array(__entry->s.ref_idx_l1,
> -				ARRAY_SIZE(__entry->s.ref_idx_l1),
> -				sizeof(__entry->s.ref_idx_l1[0])),
> -		  __entry->s.short_term_ref_pic_set_size,
> -		  __entry->s.long_term_ref_pic_set_size,
> -		  __print_flags(__entry->s.flags, "|",
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_LUMA, "SLICE_SAO_LUMA"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_CHROMA, "SLICE_SAO_CHROMA"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_TEMPORAL_MVP_ENABLED, "SLICE_TEMPORAL_MVP_ENABLED"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_MVD_L1_ZERO, "MVD_L1_ZERO"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_CABAC_INIT, "CABAC_INIT"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_COLLOCATED_FROM_L0, "COLLOCATED_FROM_L0"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_USE_INTEGER_MV, "USE_INTEGER_MV"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED, "SLICE_DEBLOCKING_FILTER_DISABLED"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED, "SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED"},
> -		  {V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT, "DEPENDENT_SLICE_SEGMENT"}
> -
> -	))
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_hevc_pred_weight_table_tmpl,
> -	TP_PROTO(const struct v4l2_hevc_pred_weight_table *p),
> -	TP_ARGS(p),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_hevc_pred_weight_table, p)),
> -	TP_fast_assign(__entry->p = *p),
> -	TP_printk("\ndelta_luma_weight_l0 %s\n"
> -		  "luma_offset_l0 %s\n"
> -		  "delta_chroma_weight_l0 {%s}\n"
> -		  "chroma_offset_l0 {%s}\n"
> -		  "delta_luma_weight_l1 %s\n"
> -		  "luma_offset_l1 %s\n"
> -		  "delta_chroma_weight_l1 {%s}\n"
> -		  "chroma_offset_l1 {%s}\n"
> -		  "luma_log2_weight_denom %d\n"
> -		  "delta_chroma_log2_weight_denom %d\n",
> -		  __print_array(__entry->p.delta_luma_weight_l0,
> -				ARRAY_SIZE(__entry->p.delta_luma_weight_l0),
> -				sizeof(__entry->p.delta_luma_weight_l0[0])),
> -		  __print_array(__entry->p.luma_offset_l0,
> -				ARRAY_SIZE(__entry->p.luma_offset_l0),
> -				sizeof(__entry->p.luma_offset_l0[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.delta_chroma_weight_l0,
> -				   sizeof(__entry->p.delta_chroma_weight_l0),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.chroma_offset_l0,
> -				   sizeof(__entry->p.chroma_offset_l0),
> -				   false),
> -		  __print_array(__entry->p.delta_luma_weight_l1,
> -				ARRAY_SIZE(__entry->p.delta_luma_weight_l1),
> -				sizeof(__entry->p.delta_luma_weight_l1[0])),
> -		  __print_array(__entry->p.luma_offset_l1,
> -				ARRAY_SIZE(__entry->p.luma_offset_l1),
> -				sizeof(__entry->p.luma_offset_l1[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.delta_chroma_weight_l1,
> -				   sizeof(__entry->p.delta_chroma_weight_l1),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.chroma_offset_l1,
> -				   sizeof(__entry->p.chroma_offset_l1),
> -				   false),
> -		__entry->p.luma_log2_weight_denom,
> -		__entry->p.delta_chroma_log2_weight_denom
> -
> -	))
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_scaling_matrix_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_scaling_matrix *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_scaling_matrix, s)),
> -	TP_fast_assign(__entry->s = *s),
> -	TP_printk("\nscaling_list_4x4 {%s}\n"
> -		  "scaling_list_8x8 {%s}\n"
> -		  "scaling_list_16x16 {%s}\n"
> -		  "scaling_list_32x32 {%s}\n"
> -		  "scaling_list_dc_coef_16x16 %s\n"
> -		  "scaling_list_dc_coef_32x32 %s\n",
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->s.scaling_list_4x4,
> -				   sizeof(__entry->s.scaling_list_4x4),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->s.scaling_list_8x8,
> -				   sizeof(__entry->s.scaling_list_8x8),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->s.scaling_list_16x16,
> -				   sizeof(__entry->s.scaling_list_16x16),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->s.scaling_list_32x32,
> -				   sizeof(__entry->s.scaling_list_32x32),
> -				   false),
> -		  __print_array(__entry->s.scaling_list_dc_coef_16x16,
> -				ARRAY_SIZE(__entry->s.scaling_list_dc_coef_16x16),
> -				sizeof(__entry->s.scaling_list_dc_coef_16x16[0])),
> -		  __print_array(__entry->s.scaling_list_dc_coef_32x32,
> -				ARRAY_SIZE(__entry->s.scaling_list_dc_coef_32x32),
> -				sizeof(__entry->s.scaling_list_dc_coef_32x32[0]))
> -	))
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_decode_params_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_decode_params *d),
> -	TP_ARGS(d),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_decode_params, d)),
> -	TP_fast_assign(__entry->d = *d),
> -	TP_printk("\npic_order_cnt_val %d\n"
> -		  "short_term_ref_pic_set_size %u\n"
> -		  "long_term_ref_pic_set_size %u\n"
> -		  "num_active_dpb_entries %u\n"
> -		  "num_poc_st_curr_before %u\n"
> -		  "num_poc_st_curr_after %u\n"
> -		  "num_poc_lt_curr %u\n"
> -		  "poc_st_curr_before %s\n"
> -		  "poc_st_curr_after %s\n"
> -		  "poc_lt_curr %s\n"
> -		  "flags %s",
> -		  __entry->d.pic_order_cnt_val,
> -		  __entry->d.short_term_ref_pic_set_size,
> -		  __entry->d.long_term_ref_pic_set_size,
> -		  __entry->d.num_active_dpb_entries,
> -		  __entry->d.num_poc_st_curr_before,
> -		  __entry->d.num_poc_st_curr_after,
> -		  __entry->d.num_poc_lt_curr,
> -		  __print_array(__entry->d.poc_st_curr_before,
> -				ARRAY_SIZE(__entry->d.poc_st_curr_before),
> -				sizeof(__entry->d.poc_st_curr_before[0])),
> -		  __print_array(__entry->d.poc_st_curr_after,
> -				ARRAY_SIZE(__entry->d.poc_st_curr_after),
> -				sizeof(__entry->d.poc_st_curr_after[0])),
> -		  __print_array(__entry->d.poc_lt_curr,
> -				ARRAY_SIZE(__entry->d.poc_lt_curr),
> -				sizeof(__entry->d.poc_lt_curr[0])),
> -		  __print_flags(__entry->d.flags, "|",
> -		  {V4L2_HEVC_DECODE_PARAM_FLAG_IRAP_PIC, "IRAP_PIC"},
> -		  {V4L2_HEVC_DECODE_PARAM_FLAG_IDR_PIC, "IDR_PIC"},
> -		  {V4L2_HEVC_DECODE_PARAM_FLAG_NO_OUTPUT_OF_PRIOR, "NO_OUTPUT_OF_PRIOR"}
> -	))
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_ext_sps_lt_rps_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_lt_rps *lt),
> -	TP_ARGS(lt),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_ext_sps_lt_rps, lt)),
> -	TP_fast_assign(__entry->lt = *lt),
> -	TP_printk("\nflags %s\n"
> -		  "lt_ref_pic_poc_lsb_sps %x\n",
> -		  __print_flags(__entry->lt.flags, "|",
> -		  {V4L2_HEVC_EXT_SPS_LT_RPS_FLAG_USED_LT, "USED_LT"}
> -		  ),
> -		  __entry->lt.lt_ref_pic_poc_lsb_sps
> -	)
> -)
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_ext_sps_st_rps_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_st_rps *st),
> -	TP_ARGS(st),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_ext_sps_st_rps, st)),
> -	TP_fast_assign(__entry->st = *st),
> -	TP_printk("\nflags %s\n"
> -		  "delta_idx_minus1: %u\n"
> -		  "delta_rps_sign: %u\n"
> -		  "abs_delta_rps_minus1: %u\n"
> -		  "num_negative_pics: %u\n"
> -		  "num_positive_pics: %u\n"
> -		  "used_by_curr_pic: %08x\n"
> -		  "use_delta_flag: %08x\n"
> -		  "delta_poc_s0_minus1: %s\n"
> -		  "delta_poc_s1_minus1: %s\n",
> -		  __print_flags(__entry->st.flags, "|",
> -		  {V4L2_HEVC_EXT_SPS_ST_RPS_FLAG_INTER_REF_PIC_SET_PRED, "INTER_REF_PIC_SET_PRED"}
> -		  ),
> -		  __entry->st.delta_idx_minus1,
> -		  __entry->st.delta_rps_sign,
> -		  __entry->st.abs_delta_rps_minus1,
> -		  __entry->st.num_negative_pics,
> -		  __entry->st.num_positive_pics,
> -		  __entry->st.used_by_curr_pic,
> -		  __entry->st.use_delta_flag,
> -		  __print_array(__entry->st.delta_poc_s0_minus1,
> -				ARRAY_SIZE(__entry->st.delta_poc_s0_minus1),
> -				sizeof(__entry->st.delta_poc_s0_minus1[0])),
> -		  __print_array(__entry->st.delta_poc_s1_minus1,
> -				ARRAY_SIZE(__entry->st.delta_poc_s1_minus1),
> -				sizeof(__entry->st.delta_poc_s1_minus1[0]))
> -	)
> -)
> -
> -
> -DECLARE_EVENT_CLASS(v4l2_hevc_dpb_entry_tmpl,
> -	TP_PROTO(const struct v4l2_hevc_dpb_entry *e),
> -	TP_ARGS(e),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_hevc_dpb_entry, e)),
> -	TP_fast_assign(__entry->e = *e),
> -	TP_printk("\ntimestamp %llu\n"
> -		  "flags %s\n"
> -		  "field_pic %u\n"
> -		  "pic_order_cnt_val %d\n",
> -		__entry->e.timestamp,
> -		__print_flags(__entry->e.flags, "|",
> -		{V4L2_HEVC_DPB_ENTRY_LONG_TERM_REFERENCE, "LONG_TERM_REFERENCE"}
> -		  ),
> -		__entry->e.field_pic,
> -		__entry->e.pic_order_cnt_val
> -	))
> -
> -DEFINE_EVENT(v4l2_ctrl_hevc_sps_tmpl, v4l2_ctrl_hevc_sps,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_sps *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_hevc_pps_tmpl, v4l2_ctrl_hevc_pps,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_pps *p),
> -	TP_ARGS(p)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_hevc_slice_params_tmpl, v4l2_ctrl_hevc_slice_params,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_slice_params *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_hevc_pred_weight_table_tmpl, v4l2_hevc_pred_weight_table,
> -	TP_PROTO(const struct v4l2_hevc_pred_weight_table *p),
> -	TP_ARGS(p)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_hevc_scaling_matrix_tmpl, v4l2_ctrl_hevc_scaling_matrix,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_scaling_matrix *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_hevc_decode_params_tmpl, v4l2_ctrl_hevc_decode_params,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_decode_params *d),
> -	TP_ARGS(d)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_hevc_ext_sps_lt_rps_tmpl, v4l2_ctrl_hevc_ext_sps_lt_rps,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_lt_rps *lt),
> -	TP_ARGS(lt)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_hevc_ext_sps_st_rps_tmpl, v4l2_ctrl_hevc_ext_sps_st_rps,
> -	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_st_rps *st),
> -	TP_ARGS(st)
> -);
> -
> -DEFINE_EVENT(v4l2_hevc_dpb_entry_tmpl, v4l2_hevc_dpb_entry,
> -	TP_PROTO(const struct v4l2_hevc_dpb_entry *e),
> -	TP_ARGS(e)
> -);
> -
> -#endif
> -
> -#undef TRACE_INCLUDE_PATH
> -#undef TRACE_INCLUDE_FILE
> -#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
> -#define TRACE_INCLUDE_FILE visl-trace-hevc
> -#include <trace/define_trace.h>
> diff --git a/drivers/media/test-drivers/visl/visl-trace-mpeg2.h b/drivers/media/test-drivers/visl/visl-trace-mpeg2.h
> deleted file mode 100644
> index ba6c65481194..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-mpeg2.h
> +++ /dev/null
> @@ -1,99 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#if !defined(_VISL_TRACE_MPEG2_H_) || defined(TRACE_HEADER_MULTI_READ)
> -#define _VISL_TRACE_MPEG2_H_
> -
> -#include <linux/tracepoint.h>
> -#include "visl.h"
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM visl_mpeg2_controls
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_mpeg2_seq_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_mpeg2_sequence *s),
> -	TP_ARGS(s),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_mpeg2_sequence, s)),
> -	TP_fast_assign(__entry->s = *s;),
> -	TP_printk("\nhorizontal_size %u\nvertical_size %u\nvbv_buffer_size %u\n"
> -		  "profile_and_level_indication %u\nchroma_format %u\nflags %s\n",
> -		  __entry->s.horizontal_size,
> -		  __entry->s.vertical_size,
> -		  __entry->s.vbv_buffer_size,
> -		  __entry->s.profile_and_level_indication,
> -		  __entry->s.chroma_format,
> -		  __print_flags(__entry->s.flags, "|",
> -		  {V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE, "PROGRESSIVE"})
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_mpeg2_pic_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_mpeg2_picture *p),
> -	TP_ARGS(p),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_mpeg2_picture, p)),
> -	TP_fast_assign(__entry->p = *p;),
> -	TP_printk("\nbackward_ref_ts %llu\nforward_ref_ts %llu\nflags %s\nf_code {%s}\n"
> -		  "picture_coding_type: %u\npicture_structure %u\nintra_dc_precision %u\n",
> -		  __entry->p.backward_ref_ts,
> -		  __entry->p.forward_ref_ts,
> -		  __print_flags(__entry->p.flags, "|",
> -		  {V4L2_MPEG2_PIC_FLAG_TOP_FIELD_FIRST, "TOP_FIELD_FIRST"},
> -		  {V4L2_MPEG2_PIC_FLAG_FRAME_PRED_DCT, "FRAME_PRED_DCT"},
> -		  {V4L2_MPEG2_PIC_FLAG_CONCEALMENT_MV, "CONCEALMENT_MV"},
> -		  {V4L2_MPEG2_PIC_FLAG_Q_SCALE_TYPE, "Q_SCALE_TYPE"},
> -		  {V4L2_MPEG2_PIC_FLAG_INTRA_VLC, "INTA_VLC"},
> -		  {V4L2_MPEG2_PIC_FLAG_ALT_SCAN, "ALT_SCAN"},
> -		  {V4L2_MPEG2_PIC_FLAG_REPEAT_FIRST, "REPEAT_FIRST"},
> -		  {V4L2_MPEG2_PIC_FLAG_PROGRESSIVE, "PROGRESSIVE"}),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.f_code,
> -				   sizeof(__entry->p.f_code),
> -				   false),
> -		  __entry->p.picture_coding_type,
> -		  __entry->p.picture_structure,
> -		  __entry->p.intra_dc_precision
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_mpeg2_quant_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_mpeg2_quantisation *q),
> -	TP_ARGS(q),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_mpeg2_quantisation, q)),
> -	TP_fast_assign(__entry->q = *q;),
> -	TP_printk("\nintra_quantiser_matrix %s\nnon_intra_quantiser_matrix %s\n"
> -		  "chroma_intra_quantiser_matrix %s\nchroma_non_intra_quantiser_matrix %s\n",
> -		  __print_array(__entry->q.intra_quantiser_matrix,
> -				ARRAY_SIZE(__entry->q.intra_quantiser_matrix),
> -				sizeof(__entry->q.intra_quantiser_matrix[0])),
> -		  __print_array(__entry->q.non_intra_quantiser_matrix,
> -				ARRAY_SIZE(__entry->q.non_intra_quantiser_matrix),
> -				sizeof(__entry->q.non_intra_quantiser_matrix[0])),
> -		  __print_array(__entry->q.chroma_intra_quantiser_matrix,
> -				ARRAY_SIZE(__entry->q.chroma_intra_quantiser_matrix),
> -				sizeof(__entry->q.chroma_intra_quantiser_matrix[0])),
> -		  __print_array(__entry->q.chroma_non_intra_quantiser_matrix,
> -				ARRAY_SIZE(__entry->q.chroma_non_intra_quantiser_matrix),
> -				sizeof(__entry->q.chroma_non_intra_quantiser_matrix[0]))
> -		  )
> -)
> -
> -DEFINE_EVENT(v4l2_ctrl_mpeg2_seq_tmpl, v4l2_ctrl_mpeg2_sequence,
> -	TP_PROTO(const struct v4l2_ctrl_mpeg2_sequence *s),
> -	TP_ARGS(s)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_mpeg2_pic_tmpl, v4l2_ctrl_mpeg2_picture,
> -	TP_PROTO(const struct v4l2_ctrl_mpeg2_picture *p),
> -	TP_ARGS(p)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_mpeg2_quant_tmpl, v4l2_ctrl_mpeg2_quantisation,
> -	TP_PROTO(const struct v4l2_ctrl_mpeg2_quantisation *q),
> -	TP_ARGS(q)
> -);
> -
> -#endif
> -
> -#undef TRACE_INCLUDE_PATH
> -#undef TRACE_INCLUDE_FILE
> -#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
> -#define TRACE_INCLUDE_FILE visl-trace-mpeg2
> -#include <trace/define_trace.h>
> diff --git a/drivers/media/test-drivers/visl/visl-trace-points.c b/drivers/media/test-drivers/visl/visl-trace-points.c
> deleted file mode 100644
> index 321ff732c682..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-points.c
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -#include "visl.h"
> -
> -#define CREATE_TRACE_POINTS
> -#include "visl-trace-fwht.h"
> -#include "visl-trace-mpeg2.h"
> -#include "visl-trace-vp8.h"
> -#include "visl-trace-vp9.h"
> -#include "visl-trace-h264.h"
> -#include "visl-trace-hevc.h"
> -#include "visl-trace-av1.h"
> diff --git a/drivers/media/test-drivers/visl/visl-trace-vp8.h b/drivers/media/test-drivers/visl/visl-trace-vp8.h
> deleted file mode 100644
> index dabe17d69ddc..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-vp8.h
> +++ /dev/null
> @@ -1,156 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#if !defined(_VISL_TRACE_VP8_H_) || defined(TRACE_HEADER_MULTI_READ)
> -#define _VISL_TRACE_VP8_H_
> -
> -#include <linux/tracepoint.h>
> -#include "visl.h"
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM visl_vp8_controls
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_vp8_entropy_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> -	TP_ARGS(f),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp8_frame, f)),
> -	TP_fast_assign(__entry->f = *f;),
> -	TP_printk("\nentropy.coeff_probs {%s}\n"
> -		  "entropy.y_mode_probs %s\n"
> -		  "entropy.uv_mode_probs %s\n"
> -		  "entropy.mv_probs {%s}",
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->f.entropy.coeff_probs,
> -				   sizeof(__entry->f.entropy.coeff_probs),
> -				   false),
> -		  __print_array(__entry->f.entropy.y_mode_probs,
> -				ARRAY_SIZE(__entry->f.entropy.y_mode_probs),
> -				sizeof(__entry->f.entropy.y_mode_probs[0])),
> -		  __print_array(__entry->f.entropy.uv_mode_probs,
> -				ARRAY_SIZE(__entry->f.entropy.uv_mode_probs),
> -				sizeof(__entry->f.entropy.uv_mode_probs[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->f.entropy.mv_probs,
> -				   sizeof(__entry->f.entropy.mv_probs),
> -				   false)
> -		  )
> -)
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_vp8_frame_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> -	TP_ARGS(f),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp8_frame, f)),
> -	TP_fast_assign(__entry->f = *f;),
> -	TP_printk("\nsegment.quant_update %s\n"
> -		  "segment.lf_update %s\n"
> -		  "segment.segment_probs %s\n"
> -		  "segment.flags %s\n"
> -		  "lf.ref_frm_delta %s\n"
> -		  "lf.mb_mode_delta %s\n"
> -		  "lf.sharpness_level %u\n"
> -		  "lf.level %u\n"
> -		  "lf.flags %s\n"
> -		  "quant.y_ac_qi %u\n"
> -		  "quant.y_dc_delta %d\n"
> -		  "quant.y2_dc_delta %d\n"
> -		  "quant.y2_ac_delta %d\n"
> -		  "quant.uv_dc_delta %d\n"
> -		  "quant.uv_ac_delta %d\n"
> -		  "coder_state.range %u\n"
> -		  "coder_state.value %u\n"
> -		  "coder_state.bit_count %u\n"
> -		  "width %u\n"
> -		  "height %u\n"
> -		  "horizontal_scale %u\n"
> -		  "vertical_scale %u\n"
> -		  "version %u\n"
> -		  "prob_skip_false %u\n"
> -		  "prob_intra %u\n"
> -		  "prob_last %u\n"
> -		  "prob_gf %u\n"
> -		  "num_dct_parts %u\n"
> -		  "first_part_size %u\n"
> -		  "first_part_header_bits %u\n"
> -		  "dct_part_sizes %s\n"
> -		  "last_frame_ts %llu\n"
> -		  "golden_frame_ts %llu\n"
> -		  "alt_frame_ts %llu\n"
> -		  "flags %s",
> -		  __print_array(__entry->f.segment.quant_update,
> -				ARRAY_SIZE(__entry->f.segment.quant_update),
> -				sizeof(__entry->f.segment.quant_update[0])),
> -		  __print_array(__entry->f.segment.lf_update,
> -				ARRAY_SIZE(__entry->f.segment.lf_update),
> -				sizeof(__entry->f.segment.lf_update[0])),
> -		  __print_array(__entry->f.segment.segment_probs,
> -				ARRAY_SIZE(__entry->f.segment.segment_probs),
> -				sizeof(__entry->f.segment.segment_probs[0])),
> -		  __print_flags(__entry->f.segment.flags, "|",
> -		  {V4L2_VP8_SEGMENT_FLAG_ENABLED, "SEGMENT_ENABLED"},
> -		  {V4L2_VP8_SEGMENT_FLAG_UPDATE_MAP, "SEGMENT_UPDATE_MAP"},
> -		  {V4L2_VP8_SEGMENT_FLAG_UPDATE_FEATURE_DATA, "SEGMENT_UPDATE_FEATURE_DATA"},
> -		  {V4L2_VP8_SEGMENT_FLAG_DELTA_VALUE_MODE, "SEGMENT_DELTA_VALUE_MODE"}),
> -		  __print_array(__entry->f.lf.ref_frm_delta,
> -				ARRAY_SIZE(__entry->f.lf.ref_frm_delta),
> -				sizeof(__entry->f.lf.ref_frm_delta[0])),
> -		  __print_array(__entry->f.lf.mb_mode_delta,
> -				ARRAY_SIZE(__entry->f.lf.mb_mode_delta),
> -				sizeof(__entry->f.lf.mb_mode_delta[0])),
> -		  __entry->f.lf.sharpness_level,
> -		  __entry->f.lf.level,
> -		  __print_flags(__entry->f.lf.flags, "|",
> -		  {V4L2_VP8_LF_ADJ_ENABLE, "LF_ADJ_ENABLED"},
> -		  {V4L2_VP8_LF_DELTA_UPDATE, "LF_DELTA_UPDATE"},
> -		  {V4L2_VP8_LF_FILTER_TYPE_SIMPLE, "LF_FILTER_TYPE_SIMPLE"}),
> -		  __entry->f.quant.y_ac_qi,
> -		  __entry->f.quant.y_dc_delta,
> -		  __entry->f.quant.y2_dc_delta,
> -		  __entry->f.quant.y2_ac_delta,
> -		  __entry->f.quant.uv_dc_delta,
> -		  __entry->f.quant.uv_ac_delta,
> -		  __entry->f.coder_state.range,
> -		  __entry->f.coder_state.value,
> -		  __entry->f.coder_state.bit_count,
> -		  __entry->f.width,
> -		  __entry->f.height,
> -		  __entry->f.horizontal_scale,
> -		  __entry->f.vertical_scale,
> -		  __entry->f.version,
> -		  __entry->f.prob_skip_false,
> -		  __entry->f.prob_intra,
> -		  __entry->f.prob_last,
> -		  __entry->f.prob_gf,
> -		  __entry->f.num_dct_parts,
> -		  __entry->f.first_part_size,
> -		  __entry->f.first_part_header_bits,
> -		  __print_array(__entry->f.dct_part_sizes,
> -				ARRAY_SIZE(__entry->f.dct_part_sizes),
> -				sizeof(__entry->f.dct_part_sizes[0])),
> -		  __entry->f.last_frame_ts,
> -		  __entry->f.golden_frame_ts,
> -		  __entry->f.alt_frame_ts,
> -		  __print_flags(__entry->f.flags, "|",
> -		  {V4L2_VP8_FRAME_FLAG_KEY_FRAME, "KEY_FRAME"},
> -		  {V4L2_VP8_FRAME_FLAG_EXPERIMENTAL, "EXPERIMENTAL"},
> -		  {V4L2_VP8_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
> -		  {V4L2_VP8_FRAME_FLAG_MB_NO_SKIP_COEFF, "MB_NO_SKIP_COEFF"},
> -		  {V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN, "SIGN_BIAS_GOLDEN"},
> -		  {V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT, "SIGN_BIAS_ALT"})
> -		  )
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_vp8_frame_tmpl, v4l2_ctrl_vp8_frame,
> -	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> -	TP_ARGS(f)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_vp8_entropy_tmpl, v4l2_ctrl_vp8_entropy,
> -	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> -	TP_ARGS(f)
> -);
> -
> -#endif
> -
> -#undef TRACE_INCLUDE_PATH
> -#undef TRACE_INCLUDE_FILE
> -#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
> -#define TRACE_INCLUDE_FILE visl-trace-vp8
> -#include <trace/define_trace.h>
> diff --git a/drivers/media/test-drivers/visl/visl-trace-vp9.h b/drivers/media/test-drivers/visl/visl-trace-vp9.h
> deleted file mode 100644
> index 362b92b07f93..000000000000
> --- a/drivers/media/test-drivers/visl/visl-trace-vp9.h
> +++ /dev/null
> @@ -1,292 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#if !defined(_VISL_TRACE_VP9_H_) || defined(TRACE_HEADER_MULTI_READ)
> -#define _VISL_TRACE_VP9_H_
> -
> -#include <linux/tracepoint.h>
> -#include "visl.h"
> -
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM visl_vp9_controls
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_vp9_frame_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_vp9_frame *f),
> -	TP_ARGS(f),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp9_frame, f)),
> -	TP_fast_assign(__entry->f = *f;),
> -	TP_printk("\nlf.ref_deltas %s\n"
> -		  "lf.mode_deltas %s\n"
> -		  "lf.level %u\n"
> -		  "lf.sharpness %u\n"
> -		  "lf.flags %s\n"
> -		  "quant.base_q_idx %u\n"
> -		  "quant.delta_q_y_dc %d\n"
> -		  "quant.delta_q_uv_dc %d\n"
> -		  "quant.delta_q_uv_ac %d\n"
> -		  "seg.feature_data {%s}\n"
> -		  "seg.feature_enabled %s\n"
> -		  "seg.tree_probs %s\n"
> -		  "seg.pred_probs %s\n"
> -		  "seg.flags %s\n"
> -		  "flags %s\n"
> -		  "compressed_header_size %u\n"
> -		  "uncompressed_header_size %u\n"
> -		  "frame_width_minus_1 %u\n"
> -		  "frame_height_minus_1 %u\n"
> -		  "render_width_minus_1 %u\n"
> -		  "render_height_minus_1 %u\n"
> -		  "last_frame_ts %llu\n"
> -		  "golden_frame_ts %llu\n"
> -		  "alt_frame_ts %llu\n"
> -		  "ref_frame_sign_bias %s\n"
> -		  "reset_frame_context %s\n"
> -		  "frame_context_idx %u\n"
> -		  "profile %u\n"
> -		  "bit_depth %u\n"
> -		  "interpolation_filter %s\n"
> -		  "tile_cols_log2 %u\n"
> -		  "tile_rows_log_2 %u\n"
> -		  "reference_mode %s\n",
> -		  __print_array(__entry->f.lf.ref_deltas,
> -				ARRAY_SIZE(__entry->f.lf.ref_deltas),
> -				sizeof(__entry->f.lf.ref_deltas[0])),
> -		  __print_array(__entry->f.lf.mode_deltas,
> -				ARRAY_SIZE(__entry->f.lf.mode_deltas),
> -				sizeof(__entry->f.lf.mode_deltas[0])),
> -		  __entry->f.lf.level,
> -		  __entry->f.lf.sharpness,
> -		  __print_flags(__entry->f.lf.flags, "|",
> -		  {V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED, "DELTA_ENABLED"},
> -		  {V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE, "DELTA_UPDATE"}),
> -		  __entry->f.quant.base_q_idx,
> -		  __entry->f.quant.delta_q_y_dc,
> -		  __entry->f.quant.delta_q_uv_dc,
> -		  __entry->f.quant.delta_q_uv_ac,
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->f.seg.feature_data,
> -				   sizeof(__entry->f.seg.feature_data),
> -				   false),
> -		  __print_array(__entry->f.seg.feature_enabled,
> -				ARRAY_SIZE(__entry->f.seg.feature_enabled),
> -				sizeof(__entry->f.seg.feature_enabled[0])),
> -		  __print_array(__entry->f.seg.tree_probs,
> -				ARRAY_SIZE(__entry->f.seg.tree_probs),
> -				sizeof(__entry->f.seg.tree_probs[0])),
> -		  __print_array(__entry->f.seg.pred_probs,
> -				ARRAY_SIZE(__entry->f.seg.pred_probs),
> -				sizeof(__entry->f.seg.pred_probs[0])),
> -		  __print_flags(__entry->f.seg.flags, "|",
> -		  {V4L2_VP9_SEGMENTATION_FLAG_ENABLED, "ENABLED"},
> -		  {V4L2_VP9_SEGMENTATION_FLAG_UPDATE_MAP, "UPDATE_MAP"},
> -		  {V4L2_VP9_SEGMENTATION_FLAG_TEMPORAL_UPDATE, "TEMPORAL_UPDATE"},
> -		  {V4L2_VP9_SEGMENTATION_FLAG_UPDATE_DATA, "UPDATE_DATA"},
> -		  {V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE, "ABS_OR_DELTA_UPDATE"}),
> -		  __print_flags(__entry->f.flags, "|",
> -		  {V4L2_VP9_FRAME_FLAG_KEY_FRAME, "KEY_FRAME"},
> -		  {V4L2_VP9_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
> -		  {V4L2_VP9_FRAME_FLAG_ERROR_RESILIENT, "ERROR_RESILIENT"},
> -		  {V4L2_VP9_FRAME_FLAG_INTRA_ONLY, "INTRA_ONLY"},
> -		  {V4L2_VP9_FRAME_FLAG_ALLOW_HIGH_PREC_MV, "ALLOW_HIGH_PREC_MV"},
> -		  {V4L2_VP9_FRAME_FLAG_REFRESH_FRAME_CTX, "REFRESH_FRAME_CTX"},
> -		  {V4L2_VP9_FRAME_FLAG_PARALLEL_DEC_MODE, "PARALLEL_DEC_MODE"},
> -		  {V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING, "X_SUBSAMPLING"},
> -		  {V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING, "Y_SUBSAMPLING"},
> -		  {V4L2_VP9_FRAME_FLAG_COLOR_RANGE_FULL_SWING, "COLOR_RANGE_FULL_SWING"}),
> -		  __entry->f.compressed_header_size,
> -		  __entry->f.uncompressed_header_size,
> -		  __entry->f.frame_width_minus_1,
> -		  __entry->f.frame_height_minus_1,
> -		  __entry->f.render_width_minus_1,
> -		  __entry->f.render_height_minus_1,
> -		  __entry->f.last_frame_ts,
> -		  __entry->f.golden_frame_ts,
> -		  __entry->f.alt_frame_ts,
> -		  __print_symbolic(__entry->f.ref_frame_sign_bias,
> -		  {V4L2_VP9_SIGN_BIAS_LAST, "SIGN_BIAS_LAST"},
> -		  {V4L2_VP9_SIGN_BIAS_GOLDEN, "SIGN_BIAS_GOLDEN"},
> -		  {V4L2_VP9_SIGN_BIAS_ALT, "SIGN_BIAS_ALT"}),
> -		  __print_symbolic(__entry->f.reset_frame_context,
> -		  {V4L2_VP9_RESET_FRAME_CTX_NONE, "RESET_FRAME_CTX_NONE"},
> -		  {V4L2_VP9_RESET_FRAME_CTX_SPEC, "RESET_FRAME_CTX_SPEC"},
> -		  {V4L2_VP9_RESET_FRAME_CTX_ALL, "RESET_FRAME_CTX_ALL"}),
> -		  __entry->f.frame_context_idx,
> -		  __entry->f.profile,
> -		  __entry->f.bit_depth,
> -		  __print_symbolic(__entry->f.interpolation_filter,
> -		  {V4L2_VP9_INTERP_FILTER_EIGHTTAP, "INTERP_FILTER_EIGHTTAP"},
> -		  {V4L2_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH, "INTERP_FILTER_EIGHTTAP_SMOOTH"},
> -		  {V4L2_VP9_INTERP_FILTER_EIGHTTAP_SHARP, "INTERP_FILTER_EIGHTTAP_SHARP"},
> -		  {V4L2_VP9_INTERP_FILTER_BILINEAR, "INTERP_FILTER_BILINEAR"},
> -		  {V4L2_VP9_INTERP_FILTER_SWITCHABLE, "INTERP_FILTER_SWITCHABLE"}),
> -		  __entry->f.tile_cols_log2,
> -		  __entry->f.tile_rows_log2,
> -		  __print_symbolic(__entry->f.reference_mode,
> -		  {V4L2_VP9_REFERENCE_MODE_SINGLE_REFERENCE, "REFERENCE_MODE_SINGLE_REFERENCE"},
> -		  {V4L2_VP9_REFERENCE_MODE_COMPOUND_REFERENCE, "REFERENCE_MODE_COMPOUND_REFERENCE"},
> -		  {V4L2_VP9_REFERENCE_MODE_SELECT, "REFERENCE_MODE_SELECT"}))
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_vp9_compressed_hdr_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> -	TP_ARGS(h),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp9_compressed_hdr, h)),
> -	TP_fast_assign(__entry->h = *h;),
> -	TP_printk("\ntx_mode %s\n"
> -		  "tx8 {%s}\n"
> -		  "tx16 {%s}\n"
> -		  "tx32 {%s}\n"
> -		  "skip %s\n"
> -		  "inter_mode {%s}\n"
> -		  "interp_filter {%s}\n"
> -		  "is_inter %s\n"
> -		  "comp_mode %s\n"
> -		  "single_ref {%s}\n"
> -		  "comp_ref %s\n"
> -		  "y_mode {%s}\n"
> -		  "uv_mode {%s}\n"
> -		  "partition {%s}\n",
> -		  __print_symbolic(__entry->h.tx_mode,
> -		  {V4L2_VP9_TX_MODE_ONLY_4X4, "TX_MODE_ONLY_4X4"},
> -		  {V4L2_VP9_TX_MODE_ALLOW_8X8, "TX_MODE_ALLOW_8X8"},
> -		  {V4L2_VP9_TX_MODE_ALLOW_16X16, "TX_MODE_ALLOW_16X16"},
> -		  {V4L2_VP9_TX_MODE_ALLOW_32X32, "TX_MODE_ALLOW_32X32"},
> -		  {V4L2_VP9_TX_MODE_SELECT, "TX_MODE_SELECT"}),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.tx8,
> -				   sizeof(__entry->h.tx8),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.tx16,
> -				   sizeof(__entry->h.tx16),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.tx32,
> -				   sizeof(__entry->h.tx32),
> -				   false),
> -		  __print_array(__entry->h.skip,
> -				ARRAY_SIZE(__entry->h.skip),
> -				sizeof(__entry->h.skip[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.inter_mode,
> -				   sizeof(__entry->h.inter_mode),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.interp_filter,
> -				   sizeof(__entry->h.interp_filter),
> -				   false),
> -		  __print_array(__entry->h.is_inter,
> -				ARRAY_SIZE(__entry->h.is_inter),
> -				sizeof(__entry->h.is_inter[0])),
> -		  __print_array(__entry->h.comp_mode,
> -				ARRAY_SIZE(__entry->h.comp_mode),
> -				sizeof(__entry->h.comp_mode[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.single_ref,
> -				   sizeof(__entry->h.single_ref),
> -				   false),
> -		  __print_array(__entry->h.comp_ref,
> -				ARRAY_SIZE(__entry->h.comp_ref),
> -				sizeof(__entry->h.comp_ref[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.y_mode,
> -				   sizeof(__entry->h.y_mode),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.uv_mode,
> -				   sizeof(__entry->h.uv_mode),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.partition,
> -				   sizeof(__entry->h.partition),
> -				   false)
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_ctrl_vp9_compressed_coef_tmpl,
> -	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> -	TP_ARGS(h),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp9_compressed_hdr, h)),
> -	TP_fast_assign(__entry->h = *h;),
> -	TP_printk("\n coef {%s}",
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->h.coef,
> -				   sizeof(__entry->h.coef),
> -				   false)
> -	)
> -);
> -
> -DECLARE_EVENT_CLASS(v4l2_vp9_mv_probs_tmpl,
> -	TP_PROTO(const struct v4l2_vp9_mv_probs *p),
> -	TP_ARGS(p),
> -	TP_STRUCT__entry(__field_struct(struct v4l2_vp9_mv_probs, p)),
> -	TP_fast_assign(__entry->p = *p;),
> -	TP_printk("\n joint %s\n"
> -		  "sign %s\n"
> -		  "classes {%s}\n"
> -		  "class0_bit %s\n"
> -		  "bits {%s}\n"
> -		  "class0_fr {%s}\n"
> -		  "fr {%s}\n"
> -		  "class0_hp %s\n"
> -		  "hp %s\n",
> -		  __print_array(__entry->p.joint,
> -				ARRAY_SIZE(__entry->p.joint),
> -				sizeof(__entry->p.joint[0])),
> -		  __print_array(__entry->p.sign,
> -				ARRAY_SIZE(__entry->p.sign),
> -				sizeof(__entry->p.sign[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.classes,
> -				   sizeof(__entry->p.classes),
> -				   false),
> -		  __print_array(__entry->p.class0_bit,
> -				ARRAY_SIZE(__entry->p.class0_bit),
> -				sizeof(__entry->p.class0_bit[0])),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.bits,
> -				   sizeof(__entry->p.bits),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.class0_fr,
> -				   sizeof(__entry->p.class0_fr),
> -				   false),
> -		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> -				   __entry->p.fr,
> -				   sizeof(__entry->p.fr),
> -				   false),
> -		  __print_array(__entry->p.class0_hp,
> -				ARRAY_SIZE(__entry->p.class0_hp),
> -				sizeof(__entry->p.class0_hp[0])),
> -		  __print_array(__entry->p.hp,
> -				ARRAY_SIZE(__entry->p.hp),
> -				sizeof(__entry->p.hp[0]))
> -	)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_vp9_frame_tmpl, v4l2_ctrl_vp9_frame,
> -	TP_PROTO(const struct v4l2_ctrl_vp9_frame *f),
> -	TP_ARGS(f)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_vp9_compressed_hdr_tmpl, v4l2_ctrl_vp9_compressed_hdr,
> -	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> -	TP_ARGS(h)
> -);
> -
> -DEFINE_EVENT(v4l2_ctrl_vp9_compressed_coef_tmpl, v4l2_ctrl_vp9_compressed_coeff,
> -	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> -	TP_ARGS(h)
> -);
> -
> -
> -DEFINE_EVENT(v4l2_vp9_mv_probs_tmpl, v4l2_vp9_mv_probs,
> -	TP_PROTO(const struct v4l2_vp9_mv_probs *p),
> -	TP_ARGS(p)
> -);
> -
> -#endif
> -
> -#undef TRACE_INCLUDE_PATH
> -#undef TRACE_INCLUDE_FILE
> -#define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
> -#define TRACE_INCLUDE_FILE visl-trace-vp9
> -#include <trace/define_trace.h>
> diff --git a/drivers/media/v4l2-core/v4l2-trace.c b/drivers/media/v4l2-core/v4l2-trace.c
> index 95f3b02e1f84..9ce54c1968ef 100644
> --- a/drivers/media/v4l2-core/v4l2-trace.c
> +++ b/drivers/media/v4l2-core/v4l2-trace.c
> @@ -5,8 +5,53 @@
>  
>  #define CREATE_TRACE_POINTS
>  #include <trace/events/v4l2.h>
> +#include <trace/events/v4l2_requests.h>
>  
>  EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_v4l2_buf_done);
>  EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_v4l2_buf_queue);
>  EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_v4l2_dqbuf);
>  EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_v4l2_qbuf);
> +
> +/* Export AV1 controls */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_av1_sequence);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_av1_frame);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_av1_tile_group_entry);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_av1_film_grain);
> +
> +/* Export FWHT controls */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_fwht_params);
> +
> +/* Export H264 controls */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_h264_sps);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_h264_pps);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_h264_scaling_matrix);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_h264_pred_weights);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_h264_slice_params);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_h264_ref_pic_list0);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_h264_ref_pic_list1);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_h264_decode_params);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_h264_dpb_entry);
> +
> +/* Export HEVC controls */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_hevc_sps);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_hevc_pps);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_hevc_slice_params);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_hevc_pred_weight_table);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_hevc_scaling_matrix);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_hevc_decode_params);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_hevc_dpb_entry);
> +
> +/* Export MPEG2 controls */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_mpeg2_sequence);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_mpeg2_picture);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_mpeg2_quantisation);
> +
> +/* Export VP8 controls */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_vp8_frame);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_vp8_entropy);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_vp9_frame);
> +
> +/* Export VP9 controls */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_vp9_compressed_hdr);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_ctrl_vp9_compressed_coeff);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(v4l2_vp9_mv_probs);
> diff --git a/include/trace/events/v4l2_requests.h b/include/trace/events/v4l2_requests.h
> new file mode 100644
> index 000000000000..1e137d39d5fe
> --- /dev/null
> +++ b/include/trace/events/v4l2_requests.h
> @@ -0,0 +1,1645 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#if !defined(_TRACE_V4L2_REQUESTS_H_) || defined(TRACE_HEADER_MULTI_READ)
> +#define _TRACE_V4L2_REQUESTS_H_
> +
> +#include <linux/tracepoint.h>
> +#include <linux/v4l2-controls.h>
> +
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM v4l2_requests
> +
> +/* AV1 controls */
> +DECLARE_EVENT_CLASS(v4l2_ctrl_av1_seq_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_av1_sequence *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_sequence, s)),
> +	TP_fast_assign(__entry->s = *s;),
> +	TP_printk("\nflags %s\nseq_profile: %u\norder_hint_bits: %u\nbit_depth: %u\n"
> +		  "max_frame_width_minus_1: %u\nmax_frame_height_minus_1: %u\n",
> +		  __print_flags(__entry->s.flags, "|",
> +		  {V4L2_AV1_SEQUENCE_FLAG_STILL_PICTURE, "STILL_PICTURE"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_USE_128X128_SUPERBLOCK, "USE_128X128_SUPERBLOCK"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_FILTER_INTRA, "ENABLE_FILTER_INTRA"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTRA_EDGE_FILTER, "ENABLE_INTRA_EDGE_FILTER"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTERINTRA_COMPOUND, "ENABLE_INTERINTRA_COMPOUND"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND, "ENABLE_MASKED_COMPOUND"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_WARPED_MOTION, "ENABLE_WARPED_MOTION"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_DUAL_FILTER, "ENABLE_DUAL_FILTER"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_ORDER_HINT, "ENABLE_ORDER_HINT"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_JNT_COMP, "ENABLE_JNT_COMP"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_REF_FRAME_MVS, "ENABLE_REF_FRAME_MVS"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_SUPERRES, "ENABLE_SUPERRES"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF, "ENABLE_CDEF"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_ENABLE_RESTORATION, "ENABLE_RESTORATION"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_MONO_CHROME, "MONO_CHROME"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_COLOR_RANGE, "COLOR_RANGE"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X, "SUBSAMPLING_X"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_Y, "SUBSAMPLING_Y"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_FILM_GRAIN_PARAMS_PRESENT, "FILM_GRAIN_PARAMS_PRESENT"},
> +		  {V4L2_AV1_SEQUENCE_FLAG_SEPARATE_UV_DELTA_Q, "SEPARATE_UV_DELTA_Q"}),
> +		  __entry->s.seq_profile,
> +		  __entry->s.order_hint_bits,
> +		  __entry->s.bit_depth,
> +		  __entry->s.max_frame_width_minus_1,
> +		  __entry->s.max_frame_height_minus_1
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_av1_tge_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_av1_tile_group_entry *t),
> +	TP_ARGS(t),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_tile_group_entry, t)),
> +	TP_fast_assign(__entry->t = *t;),
> +	TP_printk("\ntile_offset: %u\n tile_size: %u\n tile_row: %u\ntile_col: %u\n",
> +		  __entry->t.tile_offset,
> +		  __entry->t.tile_size,
> +		  __entry->t.tile_row,
> +		  __entry->t.tile_col
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_av1_frame_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_av1_frame *f),
> +	TP_ARGS(f),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_frame, f)),
> +	TP_fast_assign(__entry->f = *f;),
> +	TP_printk("\ntile_info.flags: %s\ntile_info.context_update_tile_id: %u\n"
> +		  "tile_info.tile_cols: %u\ntile_info.tile_rows: %u\n"
> +		  "tile_info.mi_col_starts: %s\ntile_info.mi_row_starts: %s\n"
> +		  "tile_info.width_in_sbs_minus_1: %s\ntile_info.height_in_sbs_minus_1: %s\n"
> +		  "tile_info.tile_size_bytes: %u\nquantization.flags: %s\n"
> +		  "quantization.base_q_idx: %u\nquantization.delta_q_y_dc: %d\n"
> +		  "quantization.delta_q_u_dc: %d\nquantization.delta_q_u_ac: %d\n"
> +		  "quantization.delta_q_v_dc: %d\nquantization.delta_q_v_ac: %d\n"
> +		  "quantization.qm_y: %u\nquantization.qm_u: %u\nquantization.qm_v: %u\n"
> +		  "quantization.delta_q_res: %u\nsuperres_denom: %u\nsegmentation.flags: %s\n"
> +		  "segmentation.last_active_seg_id: %u\nsegmentation.feature_enabled:%s\n"
> +		  "loop_filter.flags: %s\nloop_filter.level: %s\nloop_filter.sharpness: %u\n"
> +		  "loop_filter.ref_deltas: %s\nloop_filter.mode_deltas: %s\n"
> +		  "loop_filter.delta_lf_res: %u\ncdef.damping_minus_3: %u\ncdef.bits: %u\n"
> +		  "cdef.y_pri_strength: %s\ncdef.y_sec_strength: %s\n"
> +		  "cdef.uv_pri_strength: %s\ncdef.uv_sec_strength:%s\nskip_mode_frame: %s\n"
> +		  "primary_ref_frame: %u\nloop_restoration.flags: %s\n"
> +		  "loop_restoration.lr_unit_shift: %u\nloop_restoration.lr_uv_shift: %u\n"
> +		  "loop_restoration.frame_restoration_type: %s\n"
> +		  "loop_restoration.loop_restoration_size: %s\nflags: %s\norder_hint: %u\n"
> +		  "upscaled_width: %u\nframe_width_minus_1: %u\nframe_height_minus_1: %u\n"
> +		  "render_width_minus_1: %u\nrender_height_minus_1: %u\ncurrent_frame_id: %u\n"
> +		  "buffer_removal_time: %s\norder_hints: %s\nreference_frame_ts: %s\n"
> +		  "ref_frame_idx: %s\nrefresh_frame_flags: %u\n",
> +		  __print_flags(__entry->f.tile_info.flags, "|",
> +		  {V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING, "UNIFORM_TILE_SPACING"}),
> +		  __entry->f.tile_info.context_update_tile_id,
> +		  __entry->f.tile_info.tile_cols,
> +		  __entry->f.tile_info.tile_rows,
> +		  __print_array(__entry->f.tile_info.mi_col_starts,
> +				ARRAY_SIZE(__entry->f.tile_info.mi_col_starts),
> +				sizeof(__entry->f.tile_info.mi_col_starts[0])),
> +		  __print_array(__entry->f.tile_info.mi_row_starts,
> +				ARRAY_SIZE(__entry->f.tile_info.mi_row_starts),
> +				sizeof(__entry->f.tile_info.mi_row_starts[0])),
> +		  __print_array(__entry->f.tile_info.width_in_sbs_minus_1,
> +				ARRAY_SIZE(__entry->f.tile_info.width_in_sbs_minus_1),
> +				sizeof(__entry->f.tile_info.width_in_sbs_minus_1[0])),
> +		  __print_array(__entry->f.tile_info.height_in_sbs_minus_1,
> +				ARRAY_SIZE(__entry->f.tile_info.height_in_sbs_minus_1),
> +				sizeof(__entry->f.tile_info.height_in_sbs_minus_1[0])),
> +		  __entry->f.tile_info.tile_size_bytes,
> +		  __print_flags(__entry->f.quantization.flags, "|",
> +		  {V4L2_AV1_QUANTIZATION_FLAG_DIFF_UV_DELTA, "DIFF_UV_DELTA"},
> +		  {V4L2_AV1_QUANTIZATION_FLAG_USING_QMATRIX, "USING_QMATRIX"},
> +		  {V4L2_AV1_QUANTIZATION_FLAG_DELTA_Q_PRESENT, "DELTA_Q_PRESENT"}),
> +		  __entry->f.quantization.base_q_idx,
> +		  __entry->f.quantization.delta_q_y_dc,
> +		  __entry->f.quantization.delta_q_u_dc,
> +		  __entry->f.quantization.delta_q_u_ac,
> +		  __entry->f.quantization.delta_q_v_dc,
> +		  __entry->f.quantization.delta_q_v_ac,
> +		  __entry->f.quantization.qm_y,
> +		  __entry->f.quantization.qm_u,
> +		  __entry->f.quantization.qm_v,
> +		  __entry->f.quantization.delta_q_res,
> +		  __entry->f.superres_denom,
> +		  __print_flags(__entry->f.segmentation.flags, "|",
> +		  {V4L2_AV1_SEGMENTATION_FLAG_ENABLED, "ENABLED"},
> +		  {V4L2_AV1_SEGMENTATION_FLAG_UPDATE_MAP, "UPDATE_MAP"},
> +		  {V4L2_AV1_SEGMENTATION_FLAG_TEMPORAL_UPDATE, "TEMPORAL_UPDATE"},
> +		  {V4L2_AV1_SEGMENTATION_FLAG_UPDATE_DATA, "UPDATE_DATA"},
> +		  {V4L2_AV1_SEGMENTATION_FLAG_SEG_ID_PRE_SKIP, "SEG_ID_PRE_SKIP"}),
> +		  __entry->f.segmentation.last_active_seg_id,
> +		  __print_array(__entry->f.segmentation.feature_enabled,
> +				ARRAY_SIZE(__entry->f.segmentation.feature_enabled),
> +				sizeof(__entry->f.segmentation.feature_enabled[0])),
> +		  __print_flags(__entry->f.loop_filter.flags, "|",
> +		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_ENABLED, "DELTA_ENABLED"},
> +		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_UPDATE, "DELTA_UPDATE"},
> +		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_PRESENT, "DELTA_LF_PRESENT"},
> +		  {V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_MULTI, "DELTA_LF_MULTI"}),
> +		  __print_array(__entry->f.loop_filter.level,
> +				ARRAY_SIZE(__entry->f.loop_filter.level),
> +				sizeof(__entry->f.loop_filter.level[0])),
> +		  __entry->f.loop_filter.sharpness,
> +		  __print_array(__entry->f.loop_filter.ref_deltas,
> +				ARRAY_SIZE(__entry->f.loop_filter.ref_deltas),
> +				sizeof(__entry->f.loop_filter.ref_deltas[0])),
> +		  __print_array(__entry->f.loop_filter.mode_deltas,
> +				ARRAY_SIZE(__entry->f.loop_filter.mode_deltas),
> +				sizeof(__entry->f.loop_filter.mode_deltas[0])),
> +		  __entry->f.loop_filter.delta_lf_res,
> +		  __entry->f.cdef.damping_minus_3,
> +		  __entry->f.cdef.bits,
> +		  __print_array(__entry->f.cdef.y_pri_strength,
> +				ARRAY_SIZE(__entry->f.cdef.y_pri_strength),
> +				sizeof(__entry->f.cdef.y_pri_strength[0])),
> +		  __print_array(__entry->f.cdef.y_sec_strength,
> +				ARRAY_SIZE(__entry->f.cdef.y_sec_strength),
> +				sizeof(__entry->f.cdef.y_sec_strength[0])),
> +		  __print_array(__entry->f.cdef.uv_pri_strength,
> +				ARRAY_SIZE(__entry->f.cdef.uv_pri_strength),
> +				sizeof(__entry->f.cdef.uv_pri_strength[0])),
> +		  __print_array(__entry->f.cdef.uv_sec_strength,
> +				ARRAY_SIZE(__entry->f.cdef.uv_sec_strength),
> +				sizeof(__entry->f.cdef.uv_sec_strength[0])),
> +		  __print_array(__entry->f.skip_mode_frame,
> +				ARRAY_SIZE(__entry->f.skip_mode_frame),
> +				sizeof(__entry->f.skip_mode_frame[0])),
> +		  __entry->f.primary_ref_frame,
> +		  __print_flags(__entry->f.loop_restoration.flags, "|",
> +		  {V4L2_AV1_LOOP_RESTORATION_FLAG_USES_LR, "USES_LR"},
> +		  {V4L2_AV1_LOOP_RESTORATION_FLAG_USES_CHROMA_LR, "USES_CHROMA_LR"}),
> +		  __entry->f.loop_restoration.lr_unit_shift,
> +		  __entry->f.loop_restoration.lr_uv_shift,
> +		  __print_array(__entry->f.loop_restoration.frame_restoration_type,
> +				ARRAY_SIZE(__entry->f.loop_restoration.frame_restoration_type),
> +				sizeof(__entry->f.loop_restoration.frame_restoration_type[0])),
> +		  __print_array(__entry->f.loop_restoration.loop_restoration_size,
> +				ARRAY_SIZE(__entry->f.loop_restoration.loop_restoration_size),
> +				sizeof(__entry->f.loop_restoration.loop_restoration_size[0])),
> +		  __print_flags(__entry->f.flags, "|",
> +		  {V4L2_AV1_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
> +		  {V4L2_AV1_FRAME_FLAG_SHOWABLE_FRAME, "SHOWABLE_FRAME"},
> +		  {V4L2_AV1_FRAME_FLAG_ERROR_RESILIENT_MODE, "ERROR_RESILIENT_MODE"},
> +		  {V4L2_AV1_FRAME_FLAG_DISABLE_CDF_UPDATE, "DISABLE_CDF_UPDATE"},
> +		  {V4L2_AV1_FRAME_FLAG_ALLOW_SCREEN_CONTENT_TOOLS, "ALLOW_SCREEN_CONTENT_TOOLS"},
> +		  {V4L2_AV1_FRAME_FLAG_FORCE_INTEGER_MV, "FORCE_INTEGER_MV"},
> +		  {V4L2_AV1_FRAME_FLAG_ALLOW_INTRABC, "ALLOW_INTRABC"},
> +		  {V4L2_AV1_FRAME_FLAG_USE_SUPERRES, "USE_SUPERRES"},
> +		  {V4L2_AV1_FRAME_FLAG_ALLOW_HIGH_PRECISION_MV, "ALLOW_HIGH_PRECISION_MV"},
> +		  {V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE, "IS_MOTION_MODE_SWITCHABLE"},
> +		  {V4L2_AV1_FRAME_FLAG_USE_REF_FRAME_MVS, "USE_REF_FRAME_MVS"},
> +		  {V4L2_AV1_FRAME_FLAG_DISABLE_FRAME_END_UPDATE_CDF,
> +		   "DISABLE_FRAME_END_UPDATE_CDF"},
> +		  {V4L2_AV1_FRAME_FLAG_ALLOW_WARPED_MOTION, "ALLOW_WARPED_MOTION"},
> +		  {V4L2_AV1_FRAME_FLAG_REFERENCE_SELECT, "REFERENCE_SELECT"},
> +		  {V4L2_AV1_FRAME_FLAG_REDUCED_TX_SET, "REDUCED_TX_SET"},
> +		  {V4L2_AV1_FRAME_FLAG_SKIP_MODE_ALLOWED, "SKIP_MODE_ALLOWED"},
> +		  {V4L2_AV1_FRAME_FLAG_SKIP_MODE_PRESENT, "SKIP_MODE_PRESENT"},
> +		  {V4L2_AV1_FRAME_FLAG_FRAME_SIZE_OVERRIDE, "FRAME_SIZE_OVERRIDE"},
> +		  {V4L2_AV1_FRAME_FLAG_BUFFER_REMOVAL_TIME_PRESENT, "BUFFER_REMOVAL_TIME_PRESENT"},
> +		  {V4L2_AV1_FRAME_FLAG_FRAME_REFS_SHORT_SIGNALING, "FRAME_REFS_SHORT_SIGNALING"}),
> +		  __entry->f.order_hint,
> +		  __entry->f.upscaled_width,
> +		  __entry->f.frame_width_minus_1,
> +		  __entry->f.frame_height_minus_1,
> +		  __entry->f.render_width_minus_1,
> +		  __entry->f.render_height_minus_1,
> +		  __entry->f.current_frame_id,
> +		  __print_array(__entry->f.buffer_removal_time,
> +				ARRAY_SIZE(__entry->f.buffer_removal_time),
> +				sizeof(__entry->f.buffer_removal_time[0])),
> +		  __print_array(__entry->f.order_hints,
> +				ARRAY_SIZE(__entry->f.order_hints),
> +				sizeof(__entry->f.order_hints[0])),
> +		  __print_array(__entry->f.reference_frame_ts,
> +				ARRAY_SIZE(__entry->f.reference_frame_ts),
> +				sizeof(__entry->f.reference_frame_ts[0])),
> +		  __print_array(__entry->f.ref_frame_idx,
> +				ARRAY_SIZE(__entry->f.ref_frame_idx),
> +				sizeof(__entry->f.ref_frame_idx[0])),
> +		  __entry->f.refresh_frame_flags
> +	)
> +);
> +
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_av1_film_grain_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_av1_film_grain *f),
> +	TP_ARGS(f),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_av1_film_grain, f)),
> +	TP_fast_assign(__entry->f = *f;),
> +	TP_printk("\nflags %s\ncr_mult: %u\ngrain_seed: %u\n"
> +		  "film_grain_params_ref_idx: %u\nnum_y_points: %u\npoint_y_value: %s\n"
> +		  "point_y_scaling: %s\nnum_cb_points: %u\npoint_cb_value: %s\n"
> +		  "point_cb_scaling: %s\nnum_cr_points: %u\npoint_cr_value: %s\n"
> +		  "point_cr_scaling: %s\ngrain_scaling_minus_8: %u\nar_coeff_lag: %u\n"
> +		  "ar_coeffs_y_plus_128: %s\nar_coeffs_cb_plus_128: %s\n"
> +		  "ar_coeffs_cr_plus_128: %s\nar_coeff_shift_minus_6: %u\n"
> +		  "grain_scale_shift: %u\ncb_mult: %u\ncb_luma_mult: %u\ncr_luma_mult: %u\n"
> +		  "cb_offset: %u\ncr_offset: %u\n",
> +		  __print_flags(__entry->f.flags, "|",
> +		  {V4L2_AV1_FILM_GRAIN_FLAG_APPLY_GRAIN, "APPLY_GRAIN"},
> +		  {V4L2_AV1_FILM_GRAIN_FLAG_UPDATE_GRAIN, "UPDATE_GRAIN"},
> +		  {V4L2_AV1_FILM_GRAIN_FLAG_CHROMA_SCALING_FROM_LUMA, "CHROMA_SCALING_FROM_LUMA"},
> +		  {V4L2_AV1_FILM_GRAIN_FLAG_OVERLAP, "OVERLAP"},
> +		  {V4L2_AV1_FILM_GRAIN_FLAG_CLIP_TO_RESTRICTED_RANGE, "CLIP_TO_RESTRICTED_RANGE"}),
> +		  __entry->f.cr_mult,
> +		  __entry->f.grain_seed,
> +		  __entry->f.film_grain_params_ref_idx,
> +		  __entry->f.num_y_points,
> +		  __print_array(__entry->f.point_y_value,
> +				ARRAY_SIZE(__entry->f.point_y_value),
> +				sizeof(__entry->f.point_y_value[0])),
> +		  __print_array(__entry->f.point_y_scaling,
> +				ARRAY_SIZE(__entry->f.point_y_scaling),
> +				sizeof(__entry->f.point_y_scaling[0])),
> +		  __entry->f.num_cb_points,
> +		  __print_array(__entry->f.point_cb_value,
> +				ARRAY_SIZE(__entry->f.point_cb_value),
> +				sizeof(__entry->f.point_cb_value[0])),
> +		  __print_array(__entry->f.point_cb_scaling,
> +				ARRAY_SIZE(__entry->f.point_cb_scaling),
> +				sizeof(__entry->f.point_cb_scaling[0])),
> +		  __entry->f.num_cr_points,
> +		  __print_array(__entry->f.point_cr_value,
> +				ARRAY_SIZE(__entry->f.point_cr_value),
> +				sizeof(__entry->f.point_cr_value[0])),
> +		  __print_array(__entry->f.point_cr_scaling,
> +				ARRAY_SIZE(__entry->f.point_cr_scaling),
> +				sizeof(__entry->f.point_cr_scaling[0])),
> +		  __entry->f.grain_scaling_minus_8,
> +		  __entry->f.ar_coeff_lag,
> +		  __print_array(__entry->f.ar_coeffs_y_plus_128,
> +				ARRAY_SIZE(__entry->f.ar_coeffs_y_plus_128),
> +				sizeof(__entry->f.ar_coeffs_y_plus_128[0])),
> +		  __print_array(__entry->f.ar_coeffs_cb_plus_128,
> +				ARRAY_SIZE(__entry->f.ar_coeffs_cb_plus_128),
> +				sizeof(__entry->f.ar_coeffs_cb_plus_128[0])),
> +		  __print_array(__entry->f.ar_coeffs_cr_plus_128,
> +				ARRAY_SIZE(__entry->f.ar_coeffs_cr_plus_128),
> +				sizeof(__entry->f.ar_coeffs_cr_plus_128[0])),
> +		  __entry->f.ar_coeff_shift_minus_6,
> +		  __entry->f.grain_scale_shift,
> +		  __entry->f.cb_mult,
> +		  __entry->f.cb_luma_mult,
> +		  __entry->f.cr_luma_mult,
> +		  __entry->f.cb_offset,
> +		  __entry->f.cr_offset
> +	)
> +)
> +
> +DEFINE_EVENT(v4l2_ctrl_av1_seq_tmpl, v4l2_ctrl_av1_sequence,
> +	TP_PROTO(const struct v4l2_ctrl_av1_sequence *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_av1_frame_tmpl, v4l2_ctrl_av1_frame,
> +	TP_PROTO(const struct v4l2_ctrl_av1_frame *f),
> +	TP_ARGS(f)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_av1_tge_tmpl, v4l2_ctrl_av1_tile_group_entry,
> +	TP_PROTO(const struct v4l2_ctrl_av1_tile_group_entry *t),
> +	TP_ARGS(t)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_av1_film_grain_tmpl, v4l2_ctrl_av1_film_grain,
> +	TP_PROTO(const struct v4l2_ctrl_av1_film_grain *f),
> +	TP_ARGS(f)
> +);
> +
> +/* FWHT controls */
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_fwht_params_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_fwht_params *p),
> +	TP_ARGS(p),
> +	TP_STRUCT__entry(
> +			 __field(u64, backward_ref_ts)
> +			 __field(u32, version)
> +			 __field(u32, width)
> +			 __field(u32, height)
> +			 __field(u32, flags)
> +			 __field(u32, colorspace)
> +			 __field(u32, xfer_func)
> +			 __field(u32, ycbcr_enc)
> +			 __field(u32, quantization)
> +			 ),
> +	TP_fast_assign(
> +		       __entry->backward_ref_ts = p->backward_ref_ts;
> +		       __entry->version = p->version;
> +		       __entry->width = p->width;
> +		       __entry->height = p->height;
> +		       __entry->flags = p->flags;
> +		       __entry->colorspace = p->colorspace;
> +		       __entry->xfer_func = p->xfer_func;
> +		       __entry->ycbcr_enc = p->ycbcr_enc;
> +		       __entry->quantization = p->quantization;
> +		       ),
> +	TP_printk("backward_ref_ts %llu version %u width %u height %u flags %s colorspace %u xfer_func %u ycbcr_enc %u quantization %u",
> +		  __entry->backward_ref_ts, __entry->version, __entry->width, __entry->height,
> +		  __print_flags(__entry->flags, "|",
> +		  {V4L2_FWHT_FL_IS_INTERLACED, "IS_INTERLACED"},
> +		  {V4L2_FWHT_FL_IS_BOTTOM_FIRST, "IS_BOTTOM_FIRST"},
> +		  {V4L2_FWHT_FL_IS_ALTERNATE, "IS_ALTERNATE"},
> +		  {V4L2_FWHT_FL_IS_BOTTOM_FIELD, "IS_BOTTOM_FIELD"},
> +		  {V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED, "LUMA_IS_UNCOMPRESSED"},
> +		  {V4L2_FWHT_FL_CB_IS_UNCOMPRESSED, "CB_IS_UNCOMPRESSED"},
> +		  {V4L2_FWHT_FL_CR_IS_UNCOMPRESSED, "CR_IS_UNCOMPRESSED"},
> +		  {V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED, "ALPHA_IS_UNCOMPRESSED"},
> +		  {V4L2_FWHT_FL_I_FRAME, "I_FRAME"},
> +		  {V4L2_FWHT_FL_PIXENC_HSV, "PIXENC_HSV"},
> +		  {V4L2_FWHT_FL_PIXENC_RGB, "PIXENC_RGB"},
> +		  {V4L2_FWHT_FL_PIXENC_YUV, "PIXENC_YUV"}),
> +		  __entry->colorspace, __entry->xfer_func, __entry->ycbcr_enc,
> +		  __entry->quantization)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_fwht_params_tmpl, v4l2_ctrl_fwht_params,
> +	TP_PROTO(const struct v4l2_ctrl_fwht_params *p),
> +	TP_ARGS(p)
> +);
> +
> +/* H264 controls */
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_h264_sps_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_h264_sps *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_sps, s)),
> +	TP_fast_assign(__entry->s = *s),
> +	TP_printk("\nprofile_idc %u\n"
> +		  "constraint_set_flags %s\n"
> +		  "level_idc %u\n"
> +		  "seq_parameter_set_id %u\n"
> +		  "chroma_format_idc %u\n"
> +		  "bit_depth_luma_minus8 %u\n"
> +		  "bit_depth_chroma_minus8 %u\n"
> +		  "log2_max_frame_num_minus4 %u\n"
> +		  "pic_order_cnt_type %u\n"
> +		  "log2_max_pic_order_cnt_lsb_minus4 %u\n"
> +		  "max_num_ref_frames %u\n"
> +		  "num_ref_frames_in_pic_order_cnt_cycle %u\n"
> +		  "offset_for_ref_frame %s\n"
> +		  "offset_for_non_ref_pic %d\n"
> +		  "offset_for_top_to_bottom_field %d\n"
> +		  "pic_width_in_mbs_minus1 %u\n"
> +		  "pic_height_in_map_units_minus1 %u\n"
> +		  "flags %s",
> +		  __entry->s.profile_idc,
> +		  __print_flags(__entry->s.constraint_set_flags, "|",
> +		  {V4L2_H264_SPS_CONSTRAINT_SET0_FLAG, "CONSTRAINT_SET0_FLAG"},
> +		  {V4L2_H264_SPS_CONSTRAINT_SET1_FLAG, "CONSTRAINT_SET1_FLAG"},
> +		  {V4L2_H264_SPS_CONSTRAINT_SET2_FLAG, "CONSTRAINT_SET2_FLAG"},
> +		  {V4L2_H264_SPS_CONSTRAINT_SET3_FLAG, "CONSTRAINT_SET3_FLAG"},
> +		  {V4L2_H264_SPS_CONSTRAINT_SET4_FLAG, "CONSTRAINT_SET4_FLAG"},
> +		  {V4L2_H264_SPS_CONSTRAINT_SET5_FLAG, "CONSTRAINT_SET5_FLAG"}),
> +		  __entry->s.level_idc,
> +		  __entry->s.seq_parameter_set_id,
> +		  __entry->s.chroma_format_idc,
> +		  __entry->s.bit_depth_luma_minus8,
> +		  __entry->s.bit_depth_chroma_minus8,
> +		  __entry->s.log2_max_frame_num_minus4,
> +		  __entry->s.pic_order_cnt_type,
> +		  __entry->s.log2_max_pic_order_cnt_lsb_minus4,
> +		  __entry->s.max_num_ref_frames,
> +		  __entry->s.num_ref_frames_in_pic_order_cnt_cycle,
> +		  __print_array(__entry->s.offset_for_ref_frame,
> +				ARRAY_SIZE(__entry->s.offset_for_ref_frame),
> +				sizeof(__entry->s.offset_for_ref_frame[0])),
> +		  __entry->s.offset_for_non_ref_pic,
> +		  __entry->s.offset_for_top_to_bottom_field,
> +		  __entry->s.pic_width_in_mbs_minus1,
> +		  __entry->s.pic_height_in_map_units_minus1,
> +		  __print_flags(__entry->s.flags, "|",
> +		  {V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE, "SEPARATE_COLOUR_PLANE"},
> +		  {V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS, "QPPRIME_Y_ZERO_TRANSFORM_BYPASS"},
> +		  {V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO, "DELTA_PIC_ORDER_ALWAYS_ZERO"},
> +		  {V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED, "GAPS_IN_FRAME_NUM_VALUE_ALLOWED"},
> +		  {V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY, "FRAME_MBS_ONLY"},
> +		  {V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD, "MB_ADAPTIVE_FRAME_FIELD"},
> +		  {V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE, "DIRECT_8X8_INFERENCE"}
> +		  ))
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_h264_pps_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_h264_pps *p),
> +	TP_ARGS(p),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_pps, p)),
> +	TP_fast_assign(__entry->p = *p),
> +	TP_printk("\npic_parameter_set_id %u\n"
> +		  "seq_parameter_set_id %u\n"
> +		  "num_slice_groups_minus1 %u\n"
> +		  "num_ref_idx_l0_default_active_minus1 %u\n"
> +		  "num_ref_idx_l1_default_active_minus1 %u\n"
> +		  "weighted_bipred_idc %u\n"
> +		  "pic_init_qp_minus26 %d\n"
> +		  "pic_init_qs_minus26 %d\n"
> +		  "chroma_qp_index_offset %d\n"
> +		  "second_chroma_qp_index_offset %d\n"
> +		  "flags %s",
> +		  __entry->p.pic_parameter_set_id,
> +		  __entry->p.seq_parameter_set_id,
> +		  __entry->p.num_slice_groups_minus1,
> +		  __entry->p.num_ref_idx_l0_default_active_minus1,
> +		  __entry->p.num_ref_idx_l1_default_active_minus1,
> +		  __entry->p.weighted_bipred_idc,
> +		  __entry->p.pic_init_qp_minus26,
> +		  __entry->p.pic_init_qs_minus26,
> +		  __entry->p.chroma_qp_index_offset,
> +		  __entry->p.second_chroma_qp_index_offset,
> +		  __print_flags(__entry->p.flags, "|",
> +		  {V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE, "ENTROPY_CODING_MODE"},
> +		  {V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT, "BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT"},
> +		  {V4L2_H264_PPS_FLAG_WEIGHTED_PRED, "WEIGHTED_PRED"},
> +		  {V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT, "DEBLOCKING_FILTER_CONTROL_PRESENT"},
> +		  {V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED, "CONSTRAINED_INTRA_PRED"},
> +		  {V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT, "REDUNDANT_PIC_CNT_PRESENT"},
> +		  {V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE, "TRANSFORM_8X8_MODE"},
> +		  {V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT, "SCALING_MATRIX_PRESENT"}
> +		  ))
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_h264_scaling_matrix_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_h264_scaling_matrix *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_scaling_matrix, s)),
> +	TP_fast_assign(__entry->s = *s),
> +	TP_printk("\nscaling_list_4x4 {%s}\nscaling_list_8x8 {%s}",
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->s.scaling_list_4x4,
> +				   sizeof(__entry->s.scaling_list_4x4),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->s.scaling_list_8x8,
> +				   sizeof(__entry->s.scaling_list_8x8),
> +				   false)
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_h264_pred_weights_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_h264_pred_weights *p),
> +	TP_ARGS(p),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_pred_weights, p)),
> +	TP_fast_assign(__entry->p = *p),
> +	TP_printk("\nluma_log2_weight_denom %u\n"
> +		  "chroma_log2_weight_denom %u\n"
> +		  "weight_factor[0].luma_weight %s\n"
> +		  "weight_factor[0].luma_offset %s\n"
> +		  "weight_factor[0].chroma_weight {%s}\n"
> +		  "weight_factor[0].chroma_offset {%s}\n"
> +		  "weight_factor[1].luma_weight %s\n"
> +		  "weight_factor[1].luma_offset %s\n"
> +		  "weight_factor[1].chroma_weight {%s}\n"
> +		  "weight_factor[1].chroma_offset {%s}\n",
> +		  __entry->p.luma_log2_weight_denom,
> +		  __entry->p.chroma_log2_weight_denom,
> +		  __print_array(__entry->p.weight_factors[0].luma_weight,
> +				ARRAY_SIZE(__entry->p.weight_factors[0].luma_weight),
> +				sizeof(__entry->p.weight_factors[0].luma_weight[0])),
> +		  __print_array(__entry->p.weight_factors[0].luma_offset,
> +				ARRAY_SIZE(__entry->p.weight_factors[0].luma_offset),
> +				sizeof(__entry->p.weight_factors[0].luma_offset[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.weight_factors[0].chroma_weight,
> +				   sizeof(__entry->p.weight_factors[0].chroma_weight),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.weight_factors[0].chroma_offset,
> +				   sizeof(__entry->p.weight_factors[0].chroma_offset),
> +				   false),
> +		  __print_array(__entry->p.weight_factors[1].luma_weight,
> +				ARRAY_SIZE(__entry->p.weight_factors[1].luma_weight),
> +				sizeof(__entry->p.weight_factors[1].luma_weight[0])),
> +		  __print_array(__entry->p.weight_factors[1].luma_offset,
> +				ARRAY_SIZE(__entry->p.weight_factors[1].luma_offset),
> +				sizeof(__entry->p.weight_factors[1].luma_offset[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.weight_factors[1].chroma_weight,
> +				   sizeof(__entry->p.weight_factors[1].chroma_weight),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.weight_factors[1].chroma_offset,
> +				   sizeof(__entry->p.weight_factors[1].chroma_offset),
> +				   false)
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_h264_slice_params_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_h264_slice_params *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_slice_params, s)),
> +	TP_fast_assign(__entry->s = *s),
> +	TP_printk("\nheader_bit_size %u\n"
> +		  "first_mb_in_slice %u\n"
> +		  "slice_type %s\n"
> +		  "colour_plane_id %u\n"
> +		  "redundant_pic_cnt %u\n"
> +		  "cabac_init_idc %u\n"
> +		  "slice_qp_delta %d\n"
> +		  "slice_qs_delta %d\n"
> +		  "disable_deblocking_filter_idc %u\n"
> +		  "slice_alpha_c0_offset_div2 %u\n"
> +		  "slice_beta_offset_div2 %u\n"
> +		  "num_ref_idx_l0_active_minus1 %u\n"
> +		  "num_ref_idx_l1_active_minus1 %u\n"
> +		  "flags %s",
> +		  __entry->s.header_bit_size,
> +		  __entry->s.first_mb_in_slice,
> +		  __print_symbolic(__entry->s.slice_type,
> +		  {V4L2_H264_SLICE_TYPE_P, "P"},
> +		  {V4L2_H264_SLICE_TYPE_B, "B"},
> +		  {V4L2_H264_SLICE_TYPE_I, "I"},
> +		  {V4L2_H264_SLICE_TYPE_SP, "SP"},
> +		  {V4L2_H264_SLICE_TYPE_SI, "SI"}),
> +		  __entry->s.colour_plane_id,
> +		  __entry->s.redundant_pic_cnt,
> +		  __entry->s.cabac_init_idc,
> +		  __entry->s.slice_qp_delta,
> +		  __entry->s.slice_qs_delta,
> +		  __entry->s.disable_deblocking_filter_idc,
> +		  __entry->s.slice_alpha_c0_offset_div2,
> +		  __entry->s.slice_beta_offset_div2,
> +		  __entry->s.num_ref_idx_l0_active_minus1,
> +		  __entry->s.num_ref_idx_l1_active_minus1,
> +		  __print_flags(__entry->s.flags, "|",
> +		  {V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED, "DIRECT_SPATIAL_MV_PRED"},
> +		  {V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH, "SP_FOR_SWITCH"})
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_h264_reference_tmpl,
> +	TP_PROTO(const struct v4l2_h264_reference *r, int i),
> +	TP_ARGS(r, i),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_h264_reference, r)
> +			 __field(int, i)),
> +	TP_fast_assign(__entry->r = *r; __entry->i = i;),
> +	TP_printk("[%d]: fields %s index %u",
> +		  __entry->i,
> +		  __print_flags(__entry->r.fields, "|",
> +		  {V4L2_H264_TOP_FIELD_REF, "TOP_FIELD_REF"},
> +		  {V4L2_H264_BOTTOM_FIELD_REF, "BOTTOM_FIELD_REF"},
> +		  {V4L2_H264_FRAME_REF, "FRAME_REF"}),
> +		  __entry->r.index
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_h264_decode_params_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_h264_decode_params *d),
> +	TP_ARGS(d),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_h264_decode_params, d)),
> +	TP_fast_assign(__entry->d = *d),
> +	TP_printk("\nnal_ref_idc %u\n"
> +		  "frame_num %u\n"
> +		  "top_field_order_cnt %d\n"
> +		  "bottom_field_order_cnt %d\n"
> +		  "idr_pic_id %u\n"
> +		  "pic_order_cnt_lsb %u\n"
> +		  "delta_pic_order_cnt_bottom %d\n"
> +		  "delta_pic_order_cnt0 %d\n"
> +		  "delta_pic_order_cnt1 %d\n"
> +		  "dec_ref_pic_marking_bit_size %u\n"
> +		  "pic_order_cnt_bit_size %u\n"
> +		  "slice_group_change_cycle %u\n"
> +		  "flags %s\n",
> +		  __entry->d.nal_ref_idc,
> +		  __entry->d.frame_num,
> +		  __entry->d.top_field_order_cnt,
> +		  __entry->d.bottom_field_order_cnt,
> +		  __entry->d.idr_pic_id,
> +		  __entry->d.pic_order_cnt_lsb,
> +		  __entry->d.delta_pic_order_cnt_bottom,
> +		  __entry->d.delta_pic_order_cnt0,
> +		  __entry->d.delta_pic_order_cnt1,
> +		  __entry->d.dec_ref_pic_marking_bit_size,
> +		  __entry->d.pic_order_cnt_bit_size,
> +		  __entry->d.slice_group_change_cycle,
> +		  __print_flags(__entry->d.flags, "|",
> +		  {V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC, "IDR_PIC"},
> +		  {V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC, "FIELD_PIC"},
> +		  {V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD, "BOTTOM_FIELD"},
> +		  {V4L2_H264_DECODE_PARAM_FLAG_PFRAME, "PFRAME"},
> +		  {V4L2_H264_DECODE_PARAM_FLAG_BFRAME, "BFRAME"})
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_h264_dpb_entry_tmpl,
> +	TP_PROTO(const struct v4l2_h264_dpb_entry *e, int i),
> +	TP_ARGS(e, i),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_h264_dpb_entry, e)
> +			 __field(int, i)),
> +	TP_fast_assign(__entry->e = *e; __entry->i = i;),
> +	TP_printk("[%d]: reference_ts %llu, pic_num %u frame_num %u fields %s "
> +		  "top_field_order_cnt %d bottom_field_order_cnt %d flags %s",
> +		  __entry->i,
> +		  __entry->e.reference_ts,
> +		  __entry->e.pic_num,
> +		  __entry->e.frame_num,
> +		  __print_flags(__entry->e.fields, "|",
> +		  {V4L2_H264_TOP_FIELD_REF, "TOP_FIELD_REF"},
> +		  {V4L2_H264_BOTTOM_FIELD_REF, "BOTTOM_FIELD_REF"},
> +		  {V4L2_H264_FRAME_REF, "FRAME_REF"}),
> +		  __entry->e.top_field_order_cnt,
> +		  __entry->e.bottom_field_order_cnt,
> +		  __print_flags(__entry->e.flags, "|",
> +		  {V4L2_H264_DPB_ENTRY_FLAG_VALID, "VALID"},
> +		  {V4L2_H264_DPB_ENTRY_FLAG_ACTIVE, "ACTIVE"},
> +		  {V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM, "LONG_TERM"},
> +		  {V4L2_H264_DPB_ENTRY_FLAG_FIELD, "FIELD"})
> +
> +	)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_h264_sps_tmpl, v4l2_ctrl_h264_sps,
> +	TP_PROTO(const struct v4l2_ctrl_h264_sps *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_h264_pps_tmpl, v4l2_ctrl_h264_pps,
> +	TP_PROTO(const struct v4l2_ctrl_h264_pps *p),
> +	TP_ARGS(p)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_h264_scaling_matrix_tmpl, v4l2_ctrl_h264_scaling_matrix,
> +	TP_PROTO(const struct v4l2_ctrl_h264_scaling_matrix *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_h264_pred_weights_tmpl, v4l2_ctrl_h264_pred_weights,
> +	TP_PROTO(const struct v4l2_ctrl_h264_pred_weights *p),
> +	TP_ARGS(p)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_h264_slice_params_tmpl, v4l2_ctrl_h264_slice_params,
> +	TP_PROTO(const struct v4l2_ctrl_h264_slice_params *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_h264_reference_tmpl, v4l2_h264_ref_pic_list0,
> +	TP_PROTO(const struct v4l2_h264_reference *r, int i),
> +	TP_ARGS(r, i)
> +);
> +
> +DEFINE_EVENT(v4l2_h264_reference_tmpl, v4l2_h264_ref_pic_list1,
> +	TP_PROTO(const struct v4l2_h264_reference *r, int i),
> +	TP_ARGS(r, i)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_h264_decode_params_tmpl, v4l2_ctrl_h264_decode_params,
> +	TP_PROTO(const struct v4l2_ctrl_h264_decode_params *d),
> +	TP_ARGS(d)
> +);
> +
> +DEFINE_EVENT(v4l2_h264_dpb_entry_tmpl, v4l2_h264_dpb_entry,
> +	TP_PROTO(const struct v4l2_h264_dpb_entry *e, int i),
> +	TP_ARGS(e, i)
> +);
> +
> +/* HEVC controls */
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_sps_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_sps *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_sps, s)),
> +	TP_fast_assign(__entry->s = *s),
> +	TP_printk("\nvideo_parameter_set_id %u\n"
> +		  "seq_parameter_set_id %u\n"
> +		  "pic_width_in_luma_samples %u\n"
> +		  "pic_height_in_luma_samples %u\n"
> +		  "bit_depth_luma_minus8 %u\n"
> +		  "bit_depth_chroma_minus8 %u\n"
> +		  "log2_max_pic_order_cnt_lsb_minus4 %u\n"
> +		  "sps_max_dec_pic_buffering_minus1 %u\n"
> +		  "sps_max_num_reorder_pics %u\n"
> +		  "sps_max_latency_increase_plus1 %u\n"
> +		  "log2_min_luma_coding_block_size_minus3 %u\n"
> +		  "log2_diff_max_min_luma_coding_block_size %u\n"
> +		  "log2_min_luma_transform_block_size_minus2 %u\n"
> +		  "log2_diff_max_min_luma_transform_block_size %u\n"
> +		  "max_transform_hierarchy_depth_inter %u\n"
> +		  "max_transform_hierarchy_depth_intra %u\n"
> +		  "pcm_sample_bit_depth_luma_minus1 %u\n"
> +		  "pcm_sample_bit_depth_chroma_minus1 %u\n"
> +		  "log2_min_pcm_luma_coding_block_size_minus3 %u\n"
> +		  "log2_diff_max_min_pcm_luma_coding_block_size %u\n"
> +		  "num_short_term_ref_pic_sets %u\n"
> +		  "num_long_term_ref_pics_sps %u\n"
> +		  "chroma_format_idc %u\n"
> +		  "sps_max_sub_layers_minus1 %u\n"
> +		  "flags %s",
> +		  __entry->s.video_parameter_set_id,
> +		  __entry->s.seq_parameter_set_id,
> +		  __entry->s.pic_width_in_luma_samples,
> +		  __entry->s.pic_height_in_luma_samples,
> +		  __entry->s.bit_depth_luma_minus8,
> +		  __entry->s.bit_depth_chroma_minus8,
> +		  __entry->s.log2_max_pic_order_cnt_lsb_minus4,
> +		  __entry->s.sps_max_dec_pic_buffering_minus1,
> +		  __entry->s.sps_max_num_reorder_pics,
> +		  __entry->s.sps_max_latency_increase_plus1,
> +		  __entry->s.log2_min_luma_coding_block_size_minus3,
> +		  __entry->s.log2_diff_max_min_luma_coding_block_size,
> +		  __entry->s.log2_min_luma_transform_block_size_minus2,
> +		  __entry->s.log2_diff_max_min_luma_transform_block_size,
> +		  __entry->s.max_transform_hierarchy_depth_inter,
> +		  __entry->s.max_transform_hierarchy_depth_intra,
> +		  __entry->s.pcm_sample_bit_depth_luma_minus1,
> +		  __entry->s.pcm_sample_bit_depth_chroma_minus1,
> +		  __entry->s.log2_min_pcm_luma_coding_block_size_minus3,
> +		  __entry->s.log2_diff_max_min_pcm_luma_coding_block_size,
> +		  __entry->s.num_short_term_ref_pic_sets,
> +		  __entry->s.num_long_term_ref_pics_sps,
> +		  __entry->s.chroma_format_idc,
> +		  __entry->s.sps_max_sub_layers_minus1,
> +		  __print_flags(__entry->s.flags, "|",
> +		  {V4L2_HEVC_SPS_FLAG_SEPARATE_COLOUR_PLANE, "SEPARATE_COLOUR_PLANE"},
> +		  {V4L2_HEVC_SPS_FLAG_SCALING_LIST_ENABLED, "SCALING_LIST_ENABLED"},
> +		  {V4L2_HEVC_SPS_FLAG_AMP_ENABLED, "AMP_ENABLED"},
> +		  {V4L2_HEVC_SPS_FLAG_SAMPLE_ADAPTIVE_OFFSET, "SAMPLE_ADAPTIVE_OFFSET"},
> +		  {V4L2_HEVC_SPS_FLAG_PCM_ENABLED, "PCM_ENABLED"},
> +		  {V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED, "V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED"},
> +		  {V4L2_HEVC_SPS_FLAG_LONG_TERM_REF_PICS_PRESENT, "LONG_TERM_REF_PICS_PRESENT"},
> +		  {V4L2_HEVC_SPS_FLAG_SPS_TEMPORAL_MVP_ENABLED, "TEMPORAL_MVP_ENABLED"},
> +		  {V4L2_HEVC_SPS_FLAG_STRONG_INTRA_SMOOTHING_ENABLED, "STRONG_INTRA_SMOOTHING_ENABLED"}
> +	))
> +
> +);
> +
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_pps_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_pps *p),
> +	TP_ARGS(p),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_pps, p)),
> +	TP_fast_assign(__entry->p = *p),
> +	TP_printk("\npic_parameter_set_id %u\n"
> +		  "num_extra_slice_header_bits %u\n"
> +		  "num_ref_idx_l0_default_active_minus1 %u\n"
> +		  "num_ref_idx_l1_default_active_minus1 %u\n"
> +		  "init_qp_minus26 %d\n"
> +		  "diff_cu_qp_delta_depth %u\n"
> +		  "pps_cb_qp_offset %d\n"
> +		  "pps_cr_qp_offset %d\n"
> +		  "num_tile_columns_minus1 %d\n"
> +		  "num_tile_rows_minus1 %d\n"
> +		  "column_width_minus1 %s\n"
> +		  "row_height_minus1 %s\n"
> +		  "pps_beta_offset_div2 %d\n"
> +		  "pps_tc_offset_div2 %d\n"
> +		  "log2_parallel_merge_level_minus2 %u\n"
> +		  "flags %s",
> +		  __entry->p.pic_parameter_set_id,
> +		  __entry->p.num_extra_slice_header_bits,
> +		  __entry->p.num_ref_idx_l0_default_active_minus1,
> +		  __entry->p.num_ref_idx_l1_default_active_minus1,
> +		  __entry->p.init_qp_minus26,
> +		  __entry->p.diff_cu_qp_delta_depth,
> +		  __entry->p.pps_cb_qp_offset,
> +		  __entry->p.pps_cr_qp_offset,
> +		  __entry->p.num_tile_columns_minus1,
> +		  __entry->p.num_tile_rows_minus1,
> +		  __print_array(__entry->p.column_width_minus1,
> +				ARRAY_SIZE(__entry->p.column_width_minus1),
> +				sizeof(__entry->p.column_width_minus1[0])),
> +		  __print_array(__entry->p.row_height_minus1,
> +				ARRAY_SIZE(__entry->p.row_height_minus1),
> +				sizeof(__entry->p.row_height_minus1[0])),
> +		  __entry->p.pps_beta_offset_div2,
> +		  __entry->p.pps_tc_offset_div2,
> +		  __entry->p.log2_parallel_merge_level_minus2,
> +		  __print_flags(__entry->p.flags, "|",
> +		  {V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT_ENABLED, "DEPENDENT_SLICE_SEGMENT_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT, "OUTPUT_FLAG_PRESENT"},
> +		  {V4L2_HEVC_PPS_FLAG_SIGN_DATA_HIDING_ENABLED, "SIGN_DATA_HIDING_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_CABAC_INIT_PRESENT, "CABAC_INIT_PRESENT"},
> +		  {V4L2_HEVC_PPS_FLAG_CONSTRAINED_INTRA_PRED, "CONSTRAINED_INTRA_PRED"},
> +		  {V4L2_HEVC_PPS_FLAG_CU_QP_DELTA_ENABLED, "CU_QP_DELTA_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT, "PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT"},
> +		  {V4L2_HEVC_PPS_FLAG_WEIGHTED_PRED, "WEIGHTED_PRED"},
> +		  {V4L2_HEVC_PPS_FLAG_WEIGHTED_BIPRED, "WEIGHTED_BIPRED"},
> +		  {V4L2_HEVC_PPS_FLAG_TRANSQUANT_BYPASS_ENABLED, "TRANSQUANT_BYPASS_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_TILES_ENABLED, "TILES_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_ENTROPY_CODING_SYNC_ENABLED, "ENTROPY_CODING_SYNC_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_LOOP_FILTER_ACROSS_TILES_ENABLED, "LOOP_FILTER_ACROSS_TILES_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED, "PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_OVERRIDE_ENABLED, "DEBLOCKING_FILTER_OVERRIDE_ENABLED"},
> +		  {V4L2_HEVC_PPS_FLAG_PPS_DISABLE_DEBLOCKING_FILTER, "DISABLE_DEBLOCKING_FILTER"},
> +		  {V4L2_HEVC_PPS_FLAG_LISTS_MODIFICATION_PRESENT, "LISTS_MODIFICATION_PRESENT"},
> +		  {V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT, "SLICE_SEGMENT_HEADER_EXTENSION_PRESENT"},
> +		  {V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT, "DEBLOCKING_FILTER_CONTROL_PRESENT"},
> +		  {V4L2_HEVC_PPS_FLAG_UNIFORM_SPACING, "UNIFORM_SPACING"}
> +	))
> +
> +);
> +
> +
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_slice_params_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_slice_params *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_slice_params, s)),
> +	TP_fast_assign(__entry->s = *s),
> +	TP_printk("\nbit_size %u\n"
> +		  "data_byte_offset %u\n"
> +		  "num_entry_point_offsets %u\n"
> +		  "nal_unit_type %u\n"
> +		  "nuh_temporal_id_plus1 %u\n"
> +		  "slice_type %u\n"
> +		  "colour_plane_id %u\n"
> +		  "slice_pic_order_cnt %d\n"
> +		  "num_ref_idx_l0_active_minus1 %u\n"
> +		  "num_ref_idx_l1_active_minus1 %u\n"
> +		  "collocated_ref_idx %u\n"
> +		  "five_minus_max_num_merge_cand %u\n"
> +		  "slice_qp_delta %d\n"
> +		  "slice_cb_qp_offset %d\n"
> +		  "slice_cr_qp_offset %d\n"
> +		  "slice_act_y_qp_offset %d\n"
> +		  "slice_act_cb_qp_offset %d\n"
> +		  "slice_act_cr_qp_offset %d\n"
> +		  "slice_beta_offset_div2 %d\n"
> +		  "slice_tc_offset_div2 %d\n"
> +		  "pic_struct %u\n"
> +		  "slice_segment_addr %u\n"
> +		  "ref_idx_l0 %s\n"
> +		  "ref_idx_l1 %s\n"
> +		  "short_term_ref_pic_set_size %u\n"
> +		  "long_term_ref_pic_set_size %u\n"
> +		  "flags %s",
> +		  __entry->s.bit_size,
> +		  __entry->s.data_byte_offset,
> +		  __entry->s.num_entry_point_offsets,
> +		  __entry->s.nal_unit_type,
> +		  __entry->s.nuh_temporal_id_plus1,
> +		  __entry->s.slice_type,
> +		  __entry->s.colour_plane_id,
> +		  __entry->s.slice_pic_order_cnt,
> +		  __entry->s.num_ref_idx_l0_active_minus1,
> +		  __entry->s.num_ref_idx_l1_active_minus1,
> +		  __entry->s.collocated_ref_idx,
> +		  __entry->s.five_minus_max_num_merge_cand,
> +		  __entry->s.slice_qp_delta,
> +		  __entry->s.slice_cb_qp_offset,
> +		  __entry->s.slice_cr_qp_offset,
> +		  __entry->s.slice_act_y_qp_offset,
> +		  __entry->s.slice_act_cb_qp_offset,
> +		  __entry->s.slice_act_cr_qp_offset,
> +		  __entry->s.slice_beta_offset_div2,
> +		  __entry->s.slice_tc_offset_div2,
> +		  __entry->s.pic_struct,
> +		  __entry->s.slice_segment_addr,
> +		  __print_array(__entry->s.ref_idx_l0,
> +				ARRAY_SIZE(__entry->s.ref_idx_l0),
> +				sizeof(__entry->s.ref_idx_l0[0])),
> +		  __print_array(__entry->s.ref_idx_l1,
> +				ARRAY_SIZE(__entry->s.ref_idx_l1),
> +				sizeof(__entry->s.ref_idx_l1[0])),
> +		  __entry->s.short_term_ref_pic_set_size,
> +		  __entry->s.long_term_ref_pic_set_size,
> +		  __print_flags(__entry->s.flags, "|",
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_LUMA, "SLICE_SAO_LUMA"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_CHROMA, "SLICE_SAO_CHROMA"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_TEMPORAL_MVP_ENABLED, "SLICE_TEMPORAL_MVP_ENABLED"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_MVD_L1_ZERO, "MVD_L1_ZERO"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_CABAC_INIT, "CABAC_INIT"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_COLLOCATED_FROM_L0, "COLLOCATED_FROM_L0"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_USE_INTEGER_MV, "USE_INTEGER_MV"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED, "SLICE_DEBLOCKING_FILTER_DISABLED"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED, "SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED"},
> +		  {V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT, "DEPENDENT_SLICE_SEGMENT"}
> +
> +	))
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_hevc_pred_weight_table_tmpl,
> +	TP_PROTO(const struct v4l2_hevc_pred_weight_table *p),
> +	TP_ARGS(p),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_hevc_pred_weight_table, p)),
> +	TP_fast_assign(__entry->p = *p),
> +	TP_printk("\ndelta_luma_weight_l0 %s\n"
> +		  "luma_offset_l0 %s\n"
> +		  "delta_chroma_weight_l0 {%s}\n"
> +		  "chroma_offset_l0 {%s}\n"
> +		  "delta_luma_weight_l1 %s\n"
> +		  "luma_offset_l1 %s\n"
> +		  "delta_chroma_weight_l1 {%s}\n"
> +		  "chroma_offset_l1 {%s}\n"
> +		  "luma_log2_weight_denom %d\n"
> +		  "delta_chroma_log2_weight_denom %d\n",
> +		  __print_array(__entry->p.delta_luma_weight_l0,
> +				ARRAY_SIZE(__entry->p.delta_luma_weight_l0),
> +				sizeof(__entry->p.delta_luma_weight_l0[0])),
> +		  __print_array(__entry->p.luma_offset_l0,
> +				ARRAY_SIZE(__entry->p.luma_offset_l0),
> +				sizeof(__entry->p.luma_offset_l0[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.delta_chroma_weight_l0,
> +				   sizeof(__entry->p.delta_chroma_weight_l0),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.chroma_offset_l0,
> +				   sizeof(__entry->p.chroma_offset_l0),
> +				   false),
> +		  __print_array(__entry->p.delta_luma_weight_l1,
> +				ARRAY_SIZE(__entry->p.delta_luma_weight_l1),
> +				sizeof(__entry->p.delta_luma_weight_l1[0])),
> +		  __print_array(__entry->p.luma_offset_l1,
> +				ARRAY_SIZE(__entry->p.luma_offset_l1),
> +				sizeof(__entry->p.luma_offset_l1[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.delta_chroma_weight_l1,
> +				   sizeof(__entry->p.delta_chroma_weight_l1),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.chroma_offset_l1,
> +				   sizeof(__entry->p.chroma_offset_l1),
> +				   false),
> +		__entry->p.luma_log2_weight_denom,
> +		__entry->p.delta_chroma_log2_weight_denom
> +
> +	))
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_scaling_matrix_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_scaling_matrix *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_scaling_matrix, s)),
> +	TP_fast_assign(__entry->s = *s),
> +	TP_printk("\nscaling_list_4x4 {%s}\n"
> +		  "scaling_list_8x8 {%s}\n"
> +		  "scaling_list_16x16 {%s}\n"
> +		  "scaling_list_32x32 {%s}\n"
> +		  "scaling_list_dc_coef_16x16 %s\n"
> +		  "scaling_list_dc_coef_32x32 %s\n",
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->s.scaling_list_4x4,
> +				   sizeof(__entry->s.scaling_list_4x4),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->s.scaling_list_8x8,
> +				   sizeof(__entry->s.scaling_list_8x8),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->s.scaling_list_16x16,
> +				   sizeof(__entry->s.scaling_list_16x16),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->s.scaling_list_32x32,
> +				   sizeof(__entry->s.scaling_list_32x32),
> +				   false),
> +		  __print_array(__entry->s.scaling_list_dc_coef_16x16,
> +				ARRAY_SIZE(__entry->s.scaling_list_dc_coef_16x16),
> +				sizeof(__entry->s.scaling_list_dc_coef_16x16[0])),
> +		  __print_array(__entry->s.scaling_list_dc_coef_32x32,
> +				ARRAY_SIZE(__entry->s.scaling_list_dc_coef_32x32),
> +				sizeof(__entry->s.scaling_list_dc_coef_32x32[0]))
> +	))
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_decode_params_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_decode_params *d),
> +	TP_ARGS(d),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_decode_params, d)),
> +	TP_fast_assign(__entry->d = *d),
> +	TP_printk("\npic_order_cnt_val %d\n"
> +		  "short_term_ref_pic_set_size %u\n"
> +		  "long_term_ref_pic_set_size %u\n"
> +		  "num_active_dpb_entries %u\n"
> +		  "num_poc_st_curr_before %u\n"
> +		  "num_poc_st_curr_after %u\n"
> +		  "num_poc_lt_curr %u\n"
> +		  "poc_st_curr_before %s\n"
> +		  "poc_st_curr_after %s\n"
> +		  "poc_lt_curr %s\n"
> +		  "flags %s",
> +		  __entry->d.pic_order_cnt_val,
> +		  __entry->d.short_term_ref_pic_set_size,
> +		  __entry->d.long_term_ref_pic_set_size,
> +		  __entry->d.num_active_dpb_entries,
> +		  __entry->d.num_poc_st_curr_before,
> +		  __entry->d.num_poc_st_curr_after,
> +		  __entry->d.num_poc_lt_curr,
> +		  __print_array(__entry->d.poc_st_curr_before,
> +				ARRAY_SIZE(__entry->d.poc_st_curr_before),
> +				sizeof(__entry->d.poc_st_curr_before[0])),
> +		  __print_array(__entry->d.poc_st_curr_after,
> +				ARRAY_SIZE(__entry->d.poc_st_curr_after),
> +				sizeof(__entry->d.poc_st_curr_after[0])),
> +		  __print_array(__entry->d.poc_lt_curr,
> +				ARRAY_SIZE(__entry->d.poc_lt_curr),
> +				sizeof(__entry->d.poc_lt_curr[0])),
> +		  __print_flags(__entry->d.flags, "|",
> +		  {V4L2_HEVC_DECODE_PARAM_FLAG_IRAP_PIC, "IRAP_PIC"},
> +		  {V4L2_HEVC_DECODE_PARAM_FLAG_IDR_PIC, "IDR_PIC"},
> +		  {V4L2_HEVC_DECODE_PARAM_FLAG_NO_OUTPUT_OF_PRIOR, "NO_OUTPUT_OF_PRIOR"}
> +	))
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_ext_sps_lt_rps_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_lt_rps *lt),
> +	TP_ARGS(lt),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_ext_sps_lt_rps, lt)),
> +	TP_fast_assign(__entry->lt = *lt),
> +	TP_printk("\nflags %s\n"
> +		  "lt_ref_pic_poc_lsb_sps %x\n",
> +		  __print_flags(__entry->lt.flags, "|",
> +		  {V4L2_HEVC_EXT_SPS_LT_RPS_FLAG_USED_LT, "USED_LT"}
> +		  ),
> +		  __entry->lt.lt_ref_pic_poc_lsb_sps
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_hevc_ext_sps_st_rps_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_st_rps *st),
> +	TP_ARGS(st),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_hevc_ext_sps_st_rps, st)),
> +	TP_fast_assign(__entry->st = *st),
> +	TP_printk("\nflags %s\n"
> +		  "delta_idx_minus1: %u\n"
> +		  "delta_rps_sign: %u\n"
> +		  "abs_delta_rps_minus1: %u\n"
> +		  "num_negative_pics: %u\n"
> +		  "num_positive_pics: %u\n"
> +		  "used_by_curr_pic: %08x\n"
> +		  "use_delta_flag: %08x\n"
> +		  "delta_poc_s0_minus1: %s\n"
> +		  "delta_poc_s1_minus1: %s\n",
> +		  __print_flags(__entry->st.flags, "|",
> +		  {V4L2_HEVC_EXT_SPS_ST_RPS_FLAG_INTER_REF_PIC_SET_PRED, "INTER_REF_PIC_SET_PRED"}
> +		  ),
> +		  __entry->st.delta_idx_minus1,
> +		  __entry->st.delta_rps_sign,
> +		  __entry->st.abs_delta_rps_minus1,
> +		  __entry->st.num_negative_pics,
> +		  __entry->st.num_positive_pics,
> +		  __entry->st.used_by_curr_pic,
> +		  __entry->st.use_delta_flag,
> +		  __print_array(__entry->st.delta_poc_s0_minus1,
> +				ARRAY_SIZE(__entry->st.delta_poc_s0_minus1),
> +				sizeof(__entry->st.delta_poc_s0_minus1[0])),
> +		  __print_array(__entry->st.delta_poc_s1_minus1,
> +				ARRAY_SIZE(__entry->st.delta_poc_s1_minus1),
> +				sizeof(__entry->st.delta_poc_s1_minus1[0]))
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_hevc_dpb_entry_tmpl,
> +	TP_PROTO(const struct v4l2_hevc_dpb_entry *e),
> +	TP_ARGS(e),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_hevc_dpb_entry, e)),
> +	TP_fast_assign(__entry->e = *e),
> +	TP_printk("\ntimestamp %llu\n"
> +		  "flags %s\n"
> +		  "field_pic %u\n"
> +		  "pic_order_cnt_val %d\n",
> +		__entry->e.timestamp,
> +		__print_flags(__entry->e.flags, "|",
> +		{V4L2_HEVC_DPB_ENTRY_LONG_TERM_REFERENCE, "LONG_TERM_REFERENCE"}
> +		  ),
> +		__entry->e.field_pic,
> +		__entry->e.pic_order_cnt_val
> +	))
> +
> +DEFINE_EVENT(v4l2_ctrl_hevc_sps_tmpl, v4l2_ctrl_hevc_sps,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_sps *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_hevc_pps_tmpl, v4l2_ctrl_hevc_pps,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_pps *p),
> +	TP_ARGS(p)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_hevc_slice_params_tmpl, v4l2_ctrl_hevc_slice_params,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_slice_params *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_hevc_pred_weight_table_tmpl, v4l2_hevc_pred_weight_table,
> +	TP_PROTO(const struct v4l2_hevc_pred_weight_table *p),
> +	TP_ARGS(p)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_hevc_scaling_matrix_tmpl, v4l2_ctrl_hevc_scaling_matrix,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_scaling_matrix *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_hevc_decode_params_tmpl, v4l2_ctrl_hevc_decode_params,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_decode_params *d),
> +	TP_ARGS(d)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_hevc_ext_sps_lt_rps_tmpl, v4l2_ctrl_hevc_ext_sps_lt_rps,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_lt_rps *lt),
> +	TP_ARGS(lt)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_hevc_ext_sps_st_rps_tmpl, v4l2_ctrl_hevc_ext_sps_st_rps,
> +	TP_PROTO(const struct v4l2_ctrl_hevc_ext_sps_st_rps *st),
> +	TP_ARGS(st)
> +);
> +
> +DEFINE_EVENT(v4l2_hevc_dpb_entry_tmpl, v4l2_hevc_dpb_entry,
> +	TP_PROTO(const struct v4l2_hevc_dpb_entry *e),
> +	TP_ARGS(e)
> +);
> +
> +/* MPEG2 controls */
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_mpeg2_seq_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_mpeg2_sequence *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_mpeg2_sequence, s)),
> +	TP_fast_assign(__entry->s = *s;),
> +	TP_printk("\nhorizontal_size %u\nvertical_size %u\nvbv_buffer_size %u\n"
> +		  "profile_and_level_indication %u\nchroma_format %u\nflags %s\n",
> +		  __entry->s.horizontal_size,
> +		  __entry->s.vertical_size,
> +		  __entry->s.vbv_buffer_size,
> +		  __entry->s.profile_and_level_indication,
> +		  __entry->s.chroma_format,
> +		  __print_flags(__entry->s.flags, "|",
> +		  {V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE, "PROGRESSIVE"})
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_mpeg2_pic_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_mpeg2_picture *p),
> +	TP_ARGS(p),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_mpeg2_picture, p)),
> +	TP_fast_assign(__entry->p = *p;),
> +	TP_printk("\nbackward_ref_ts %llu\nforward_ref_ts %llu\nflags %s\nf_code {%s}\n"
> +		  "picture_coding_type: %u\npicture_structure %u\nintra_dc_precision %u\n",
> +		  __entry->p.backward_ref_ts,
> +		  __entry->p.forward_ref_ts,
> +		  __print_flags(__entry->p.flags, "|",
> +		  {V4L2_MPEG2_PIC_FLAG_TOP_FIELD_FIRST, "TOP_FIELD_FIRST"},
> +		  {V4L2_MPEG2_PIC_FLAG_FRAME_PRED_DCT, "FRAME_PRED_DCT"},
> +		  {V4L2_MPEG2_PIC_FLAG_CONCEALMENT_MV, "CONCEALMENT_MV"},
> +		  {V4L2_MPEG2_PIC_FLAG_Q_SCALE_TYPE, "Q_SCALE_TYPE"},
> +		  {V4L2_MPEG2_PIC_FLAG_INTRA_VLC, "INTA_VLC"},
> +		  {V4L2_MPEG2_PIC_FLAG_ALT_SCAN, "ALT_SCAN"},
> +		  {V4L2_MPEG2_PIC_FLAG_REPEAT_FIRST, "REPEAT_FIRST"},
> +		  {V4L2_MPEG2_PIC_FLAG_PROGRESSIVE, "PROGRESSIVE"}),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.f_code,
> +				   sizeof(__entry->p.f_code),
> +				   false),
> +		  __entry->p.picture_coding_type,
> +		  __entry->p.picture_structure,
> +		  __entry->p.intra_dc_precision
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_mpeg2_quant_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_mpeg2_quantisation *q),
> +	TP_ARGS(q),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_mpeg2_quantisation, q)),
> +	TP_fast_assign(__entry->q = *q;),
> +	TP_printk("\nintra_quantiser_matrix %s\nnon_intra_quantiser_matrix %s\n"
> +		  "chroma_intra_quantiser_matrix %s\nchroma_non_intra_quantiser_matrix %s\n",
> +		  __print_array(__entry->q.intra_quantiser_matrix,
> +				ARRAY_SIZE(__entry->q.intra_quantiser_matrix),
> +				sizeof(__entry->q.intra_quantiser_matrix[0])),
> +		  __print_array(__entry->q.non_intra_quantiser_matrix,
> +				ARRAY_SIZE(__entry->q.non_intra_quantiser_matrix),
> +				sizeof(__entry->q.non_intra_quantiser_matrix[0])),
> +		  __print_array(__entry->q.chroma_intra_quantiser_matrix,
> +				ARRAY_SIZE(__entry->q.chroma_intra_quantiser_matrix),
> +				sizeof(__entry->q.chroma_intra_quantiser_matrix[0])),
> +		  __print_array(__entry->q.chroma_non_intra_quantiser_matrix,
> +				ARRAY_SIZE(__entry->q.chroma_non_intra_quantiser_matrix),
> +				sizeof(__entry->q.chroma_non_intra_quantiser_matrix[0]))
> +		  )
> +)
> +
> +DEFINE_EVENT(v4l2_ctrl_mpeg2_seq_tmpl, v4l2_ctrl_mpeg2_sequence,
> +	TP_PROTO(const struct v4l2_ctrl_mpeg2_sequence *s),
> +	TP_ARGS(s)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_mpeg2_pic_tmpl, v4l2_ctrl_mpeg2_picture,
> +	TP_PROTO(const struct v4l2_ctrl_mpeg2_picture *p),
> +	TP_ARGS(p)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_mpeg2_quant_tmpl, v4l2_ctrl_mpeg2_quantisation,
> +	TP_PROTO(const struct v4l2_ctrl_mpeg2_quantisation *q),
> +	TP_ARGS(q)
> +);
> +
> +/* VP8 controls */
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_vp8_entropy_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> +	TP_ARGS(f),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp8_frame, f)),
> +	TP_fast_assign(__entry->f = *f;),
> +	TP_printk("\nentropy.coeff_probs {%s}\n"
> +		  "entropy.y_mode_probs %s\n"
> +		  "entropy.uv_mode_probs %s\n"
> +		  "entropy.mv_probs {%s}",
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->f.entropy.coeff_probs,
> +				   sizeof(__entry->f.entropy.coeff_probs),
> +				   false),
> +		  __print_array(__entry->f.entropy.y_mode_probs,
> +				ARRAY_SIZE(__entry->f.entropy.y_mode_probs),
> +				sizeof(__entry->f.entropy.y_mode_probs[0])),
> +		  __print_array(__entry->f.entropy.uv_mode_probs,
> +				ARRAY_SIZE(__entry->f.entropy.uv_mode_probs),
> +				sizeof(__entry->f.entropy.uv_mode_probs[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->f.entropy.mv_probs,
> +				   sizeof(__entry->f.entropy.mv_probs),
> +				   false)
> +		  )
> +)
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_vp8_frame_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> +	TP_ARGS(f),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp8_frame, f)),
> +	TP_fast_assign(__entry->f = *f;),
> +	TP_printk("\nsegment.quant_update %s\n"
> +		  "segment.lf_update %s\n"
> +		  "segment.segment_probs %s\n"
> +		  "segment.flags %s\n"
> +		  "lf.ref_frm_delta %s\n"
> +		  "lf.mb_mode_delta %s\n"
> +		  "lf.sharpness_level %u\n"
> +		  "lf.level %u\n"
> +		  "lf.flags %s\n"
> +		  "quant.y_ac_qi %u\n"
> +		  "quant.y_dc_delta %d\n"
> +		  "quant.y2_dc_delta %d\n"
> +		  "quant.y2_ac_delta %d\n"
> +		  "quant.uv_dc_delta %d\n"
> +		  "quant.uv_ac_delta %d\n"
> +		  "coder_state.range %u\n"
> +		  "coder_state.value %u\n"
> +		  "coder_state.bit_count %u\n"
> +		  "width %u\n"
> +		  "height %u\n"
> +		  "horizontal_scale %u\n"
> +		  "vertical_scale %u\n"
> +		  "version %u\n"
> +		  "prob_skip_false %u\n"
> +		  "prob_intra %u\n"
> +		  "prob_last %u\n"
> +		  "prob_gf %u\n"
> +		  "num_dct_parts %u\n"
> +		  "first_part_size %u\n"
> +		  "first_part_header_bits %u\n"
> +		  "dct_part_sizes %s\n"
> +		  "last_frame_ts %llu\n"
> +		  "golden_frame_ts %llu\n"
> +		  "alt_frame_ts %llu\n"
> +		  "flags %s",
> +		  __print_array(__entry->f.segment.quant_update,
> +				ARRAY_SIZE(__entry->f.segment.quant_update),
> +				sizeof(__entry->f.segment.quant_update[0])),
> +		  __print_array(__entry->f.segment.lf_update,
> +				ARRAY_SIZE(__entry->f.segment.lf_update),
> +				sizeof(__entry->f.segment.lf_update[0])),
> +		  __print_array(__entry->f.segment.segment_probs,
> +				ARRAY_SIZE(__entry->f.segment.segment_probs),
> +				sizeof(__entry->f.segment.segment_probs[0])),
> +		  __print_flags(__entry->f.segment.flags, "|",
> +		  {V4L2_VP8_SEGMENT_FLAG_ENABLED, "SEGMENT_ENABLED"},
> +		  {V4L2_VP8_SEGMENT_FLAG_UPDATE_MAP, "SEGMENT_UPDATE_MAP"},
> +		  {V4L2_VP8_SEGMENT_FLAG_UPDATE_FEATURE_DATA, "SEGMENT_UPDATE_FEATURE_DATA"},
> +		  {V4L2_VP8_SEGMENT_FLAG_DELTA_VALUE_MODE, "SEGMENT_DELTA_VALUE_MODE"}),
> +		  __print_array(__entry->f.lf.ref_frm_delta,
> +				ARRAY_SIZE(__entry->f.lf.ref_frm_delta),
> +				sizeof(__entry->f.lf.ref_frm_delta[0])),
> +		  __print_array(__entry->f.lf.mb_mode_delta,
> +				ARRAY_SIZE(__entry->f.lf.mb_mode_delta),
> +				sizeof(__entry->f.lf.mb_mode_delta[0])),
> +		  __entry->f.lf.sharpness_level,
> +		  __entry->f.lf.level,
> +		  __print_flags(__entry->f.lf.flags, "|",
> +		  {V4L2_VP8_LF_ADJ_ENABLE, "LF_ADJ_ENABLED"},
> +		  {V4L2_VP8_LF_DELTA_UPDATE, "LF_DELTA_UPDATE"},
> +		  {V4L2_VP8_LF_FILTER_TYPE_SIMPLE, "LF_FILTER_TYPE_SIMPLE"}),
> +		  __entry->f.quant.y_ac_qi,
> +		  __entry->f.quant.y_dc_delta,
> +		  __entry->f.quant.y2_dc_delta,
> +		  __entry->f.quant.y2_ac_delta,
> +		  __entry->f.quant.uv_dc_delta,
> +		  __entry->f.quant.uv_ac_delta,
> +		  __entry->f.coder_state.range,
> +		  __entry->f.coder_state.value,
> +		  __entry->f.coder_state.bit_count,
> +		  __entry->f.width,
> +		  __entry->f.height,
> +		  __entry->f.horizontal_scale,
> +		  __entry->f.vertical_scale,
> +		  __entry->f.version,
> +		  __entry->f.prob_skip_false,
> +		  __entry->f.prob_intra,
> +		  __entry->f.prob_last,
> +		  __entry->f.prob_gf,
> +		  __entry->f.num_dct_parts,
> +		  __entry->f.first_part_size,
> +		  __entry->f.first_part_header_bits,
> +		  __print_array(__entry->f.dct_part_sizes,
> +				ARRAY_SIZE(__entry->f.dct_part_sizes),
> +				sizeof(__entry->f.dct_part_sizes[0])),
> +		  __entry->f.last_frame_ts,
> +		  __entry->f.golden_frame_ts,
> +		  __entry->f.alt_frame_ts,
> +		  __print_flags(__entry->f.flags, "|",
> +		  {V4L2_VP8_FRAME_FLAG_KEY_FRAME, "KEY_FRAME"},
> +		  {V4L2_VP8_FRAME_FLAG_EXPERIMENTAL, "EXPERIMENTAL"},
> +		  {V4L2_VP8_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
> +		  {V4L2_VP8_FRAME_FLAG_MB_NO_SKIP_COEFF, "MB_NO_SKIP_COEFF"},
> +		  {V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN, "SIGN_BIAS_GOLDEN"},
> +		  {V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT, "SIGN_BIAS_ALT"})
> +		  )
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_vp8_frame_tmpl, v4l2_ctrl_vp8_frame,
> +	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> +	TP_ARGS(f)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_vp8_entropy_tmpl, v4l2_ctrl_vp8_entropy,
> +	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
> +	TP_ARGS(f)
> +);
> +
> +/* VP9 controls */
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_vp9_frame_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_vp9_frame *f),
> +	TP_ARGS(f),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp9_frame, f)),
> +	TP_fast_assign(__entry->f = *f;),
> +	TP_printk("\nlf.ref_deltas %s\n"
> +		  "lf.mode_deltas %s\n"
> +		  "lf.level %u\n"
> +		  "lf.sharpness %u\n"
> +		  "lf.flags %s\n"
> +		  "quant.base_q_idx %u\n"
> +		  "quant.delta_q_y_dc %d\n"
> +		  "quant.delta_q_uv_dc %d\n"
> +		  "quant.delta_q_uv_ac %d\n"
> +		  "seg.feature_data {%s}\n"
> +		  "seg.feature_enabled %s\n"
> +		  "seg.tree_probs %s\n"
> +		  "seg.pred_probs %s\n"
> +		  "seg.flags %s\n"
> +		  "flags %s\n"
> +		  "compressed_header_size %u\n"
> +		  "uncompressed_header_size %u\n"
> +		  "frame_width_minus_1 %u\n"
> +		  "frame_height_minus_1 %u\n"
> +		  "render_width_minus_1 %u\n"
> +		  "render_height_minus_1 %u\n"
> +		  "last_frame_ts %llu\n"
> +		  "golden_frame_ts %llu\n"
> +		  "alt_frame_ts %llu\n"
> +		  "ref_frame_sign_bias %s\n"
> +		  "reset_frame_context %s\n"
> +		  "frame_context_idx %u\n"
> +		  "profile %u\n"
> +		  "bit_depth %u\n"
> +		  "interpolation_filter %s\n"
> +		  "tile_cols_log2 %u\n"
> +		  "tile_rows_log_2 %u\n"
> +		  "reference_mode %s\n",
> +		  __print_array(__entry->f.lf.ref_deltas,
> +				ARRAY_SIZE(__entry->f.lf.ref_deltas),
> +				sizeof(__entry->f.lf.ref_deltas[0])),
> +		  __print_array(__entry->f.lf.mode_deltas,
> +				ARRAY_SIZE(__entry->f.lf.mode_deltas),
> +				sizeof(__entry->f.lf.mode_deltas[0])),
> +		  __entry->f.lf.level,
> +		  __entry->f.lf.sharpness,
> +		  __print_flags(__entry->f.lf.flags, "|",
> +		  {V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED, "DELTA_ENABLED"},
> +		  {V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE, "DELTA_UPDATE"}),
> +		  __entry->f.quant.base_q_idx,
> +		  __entry->f.quant.delta_q_y_dc,
> +		  __entry->f.quant.delta_q_uv_dc,
> +		  __entry->f.quant.delta_q_uv_ac,
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->f.seg.feature_data,
> +				   sizeof(__entry->f.seg.feature_data),
> +				   false),
> +		  __print_array(__entry->f.seg.feature_enabled,
> +				ARRAY_SIZE(__entry->f.seg.feature_enabled),
> +				sizeof(__entry->f.seg.feature_enabled[0])),
> +		  __print_array(__entry->f.seg.tree_probs,
> +				ARRAY_SIZE(__entry->f.seg.tree_probs),
> +				sizeof(__entry->f.seg.tree_probs[0])),
> +		  __print_array(__entry->f.seg.pred_probs,
> +				ARRAY_SIZE(__entry->f.seg.pred_probs),
> +				sizeof(__entry->f.seg.pred_probs[0])),
> +		  __print_flags(__entry->f.seg.flags, "|",
> +		  {V4L2_VP9_SEGMENTATION_FLAG_ENABLED, "ENABLED"},
> +		  {V4L2_VP9_SEGMENTATION_FLAG_UPDATE_MAP, "UPDATE_MAP"},
> +		  {V4L2_VP9_SEGMENTATION_FLAG_TEMPORAL_UPDATE, "TEMPORAL_UPDATE"},
> +		  {V4L2_VP9_SEGMENTATION_FLAG_UPDATE_DATA, "UPDATE_DATA"},
> +		  {V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE, "ABS_OR_DELTA_UPDATE"}),
> +		  __print_flags(__entry->f.flags, "|",
> +		  {V4L2_VP9_FRAME_FLAG_KEY_FRAME, "KEY_FRAME"},
> +		  {V4L2_VP9_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
> +		  {V4L2_VP9_FRAME_FLAG_ERROR_RESILIENT, "ERROR_RESILIENT"},
> +		  {V4L2_VP9_FRAME_FLAG_INTRA_ONLY, "INTRA_ONLY"},
> +		  {V4L2_VP9_FRAME_FLAG_ALLOW_HIGH_PREC_MV, "ALLOW_HIGH_PREC_MV"},
> +		  {V4L2_VP9_FRAME_FLAG_REFRESH_FRAME_CTX, "REFRESH_FRAME_CTX"},
> +		  {V4L2_VP9_FRAME_FLAG_PARALLEL_DEC_MODE, "PARALLEL_DEC_MODE"},
> +		  {V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING, "X_SUBSAMPLING"},
> +		  {V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING, "Y_SUBSAMPLING"},
> +		  {V4L2_VP9_FRAME_FLAG_COLOR_RANGE_FULL_SWING, "COLOR_RANGE_FULL_SWING"}),
> +		  __entry->f.compressed_header_size,
> +		  __entry->f.uncompressed_header_size,
> +		  __entry->f.frame_width_minus_1,
> +		  __entry->f.frame_height_minus_1,
> +		  __entry->f.render_width_minus_1,
> +		  __entry->f.render_height_minus_1,
> +		  __entry->f.last_frame_ts,
> +		  __entry->f.golden_frame_ts,
> +		  __entry->f.alt_frame_ts,
> +		  __print_symbolic(__entry->f.ref_frame_sign_bias,
> +		  {V4L2_VP9_SIGN_BIAS_LAST, "SIGN_BIAS_LAST"},
> +		  {V4L2_VP9_SIGN_BIAS_GOLDEN, "SIGN_BIAS_GOLDEN"},
> +		  {V4L2_VP9_SIGN_BIAS_ALT, "SIGN_BIAS_ALT"}),
> +		  __print_symbolic(__entry->f.reset_frame_context,
> +		  {V4L2_VP9_RESET_FRAME_CTX_NONE, "RESET_FRAME_CTX_NONE"},
> +		  {V4L2_VP9_RESET_FRAME_CTX_SPEC, "RESET_FRAME_CTX_SPEC"},
> +		  {V4L2_VP9_RESET_FRAME_CTX_ALL, "RESET_FRAME_CTX_ALL"}),
> +		  __entry->f.frame_context_idx,
> +		  __entry->f.profile,
> +		  __entry->f.bit_depth,
> +		  __print_symbolic(__entry->f.interpolation_filter,
> +		  {V4L2_VP9_INTERP_FILTER_EIGHTTAP, "INTERP_FILTER_EIGHTTAP"},
> +		  {V4L2_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH, "INTERP_FILTER_EIGHTTAP_SMOOTH"},
> +		  {V4L2_VP9_INTERP_FILTER_EIGHTTAP_SHARP, "INTERP_FILTER_EIGHTTAP_SHARP"},
> +		  {V4L2_VP9_INTERP_FILTER_BILINEAR, "INTERP_FILTER_BILINEAR"},
> +		  {V4L2_VP9_INTERP_FILTER_SWITCHABLE, "INTERP_FILTER_SWITCHABLE"}),
> +		  __entry->f.tile_cols_log2,
> +		  __entry->f.tile_rows_log2,
> +		  __print_symbolic(__entry->f.reference_mode,
> +		  {V4L2_VP9_REFERENCE_MODE_SINGLE_REFERENCE, "REFERENCE_MODE_SINGLE_REFERENCE"},
> +		  {V4L2_VP9_REFERENCE_MODE_COMPOUND_REFERENCE, "REFERENCE_MODE_COMPOUND_REFERENCE"},
> +		  {V4L2_VP9_REFERENCE_MODE_SELECT, "REFERENCE_MODE_SELECT"}))
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_vp9_compressed_hdr_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> +	TP_ARGS(h),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp9_compressed_hdr, h)),
> +	TP_fast_assign(__entry->h = *h;),
> +	TP_printk("\ntx_mode %s\n"
> +		  "tx8 {%s}\n"
> +		  "tx16 {%s}\n"
> +		  "tx32 {%s}\n"
> +		  "skip %s\n"
> +		  "inter_mode {%s}\n"
> +		  "interp_filter {%s}\n"
> +		  "is_inter %s\n"
> +		  "comp_mode %s\n"
> +		  "single_ref {%s}\n"
> +		  "comp_ref %s\n"
> +		  "y_mode {%s}\n"
> +		  "uv_mode {%s}\n"
> +		  "partition {%s}\n",
> +		  __print_symbolic(__entry->h.tx_mode,
> +		  {V4L2_VP9_TX_MODE_ONLY_4X4, "TX_MODE_ONLY_4X4"},
> +		  {V4L2_VP9_TX_MODE_ALLOW_8X8, "TX_MODE_ALLOW_8X8"},
> +		  {V4L2_VP9_TX_MODE_ALLOW_16X16, "TX_MODE_ALLOW_16X16"},
> +		  {V4L2_VP9_TX_MODE_ALLOW_32X32, "TX_MODE_ALLOW_32X32"},
> +		  {V4L2_VP9_TX_MODE_SELECT, "TX_MODE_SELECT"}),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.tx8,
> +				   sizeof(__entry->h.tx8),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.tx16,
> +				   sizeof(__entry->h.tx16),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.tx32,
> +				   sizeof(__entry->h.tx32),
> +				   false),
> +		  __print_array(__entry->h.skip,
> +				ARRAY_SIZE(__entry->h.skip),
> +				sizeof(__entry->h.skip[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.inter_mode,
> +				   sizeof(__entry->h.inter_mode),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.interp_filter,
> +				   sizeof(__entry->h.interp_filter),
> +				   false),
> +		  __print_array(__entry->h.is_inter,
> +				ARRAY_SIZE(__entry->h.is_inter),
> +				sizeof(__entry->h.is_inter[0])),
> +		  __print_array(__entry->h.comp_mode,
> +				ARRAY_SIZE(__entry->h.comp_mode),
> +				sizeof(__entry->h.comp_mode[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.single_ref,
> +				   sizeof(__entry->h.single_ref),
> +				   false),
> +		  __print_array(__entry->h.comp_ref,
> +				ARRAY_SIZE(__entry->h.comp_ref),
> +				sizeof(__entry->h.comp_ref[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.y_mode,
> +				   sizeof(__entry->h.y_mode),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.uv_mode,
> +				   sizeof(__entry->h.uv_mode),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.partition,
> +				   sizeof(__entry->h.partition),
> +				   false)
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_vp9_compressed_coef_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> +	TP_ARGS(h),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp9_compressed_hdr, h)),
> +	TP_fast_assign(__entry->h = *h;),
> +	TP_printk("\n coef {%s}",
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->h.coef,
> +				   sizeof(__entry->h.coef),
> +				   false)
> +	)
> +);
> +
> +DECLARE_EVENT_CLASS(v4l2_vp9_mv_probs_tmpl,
> +	TP_PROTO(const struct v4l2_vp9_mv_probs *p),
> +	TP_ARGS(p),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_vp9_mv_probs, p)),
> +	TP_fast_assign(__entry->p = *p;),
> +	TP_printk("\n joint %s\n"
> +		  "sign %s\n"
> +		  "classes {%s}\n"
> +		  "class0_bit %s\n"
> +		  "bits {%s}\n"
> +		  "class0_fr {%s}\n"
> +		  "fr {%s}\n"
> +		  "class0_hp %s\n"
> +		  "hp %s\n",
> +		  __print_array(__entry->p.joint,
> +				ARRAY_SIZE(__entry->p.joint),
> +				sizeof(__entry->p.joint[0])),
> +		  __print_array(__entry->p.sign,
> +				ARRAY_SIZE(__entry->p.sign),
> +				sizeof(__entry->p.sign[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.classes,
> +				   sizeof(__entry->p.classes),
> +				   false),
> +		  __print_array(__entry->p.class0_bit,
> +				ARRAY_SIZE(__entry->p.class0_bit),
> +				sizeof(__entry->p.class0_bit[0])),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.bits,
> +				   sizeof(__entry->p.bits),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.class0_fr,
> +				   sizeof(__entry->p.class0_fr),
> +				   false),
> +		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
> +				   __entry->p.fr,
> +				   sizeof(__entry->p.fr),
> +				   false),
> +		  __print_array(__entry->p.class0_hp,
> +				ARRAY_SIZE(__entry->p.class0_hp),
> +				sizeof(__entry->p.class0_hp[0])),
> +		  __print_array(__entry->p.hp,
> +				ARRAY_SIZE(__entry->p.hp),
> +				sizeof(__entry->p.hp[0]))
> +	)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_vp9_frame_tmpl, v4l2_ctrl_vp9_frame,
> +	TP_PROTO(const struct v4l2_ctrl_vp9_frame *f),
> +	TP_ARGS(f)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_vp9_compressed_hdr_tmpl, v4l2_ctrl_vp9_compressed_hdr,
> +	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> +	TP_ARGS(h)
> +);
> +
> +DEFINE_EVENT(v4l2_ctrl_vp9_compressed_coef_tmpl, v4l2_ctrl_vp9_compressed_coeff,
> +	TP_PROTO(const struct v4l2_ctrl_vp9_compressed_hdr *h),
> +	TP_ARGS(h)
> +);
> +
> +
> +DEFINE_EVENT(v4l2_vp9_mv_probs_tmpl, v4l2_vp9_mv_probs,
> +	TP_PROTO(const struct v4l2_vp9_mv_probs *p),
> +	TP_ARGS(p)
> +);
> +
> +#endif /* if !defined(_TRACE_V4L2_REQUESTS_H_) || defined(TRACE_HEADER_MULTI_READ) */
> +
> +#include <trace/define_trace.h>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* [PATCH v13 5/5] rust: drm: gem: Add vmap functions to shmem bindings
From: Lyude Paul @ 2026-04-28 19:03 UTC (permalink / raw)
  To: nouveau, Gary Guo, Daniel Almeida, rust-for-linux,
	Danilo Krummrich, dri-devel
  Cc: Matthew Maurer, FUJITA Tomonori, Lorenzo Stoakes,
	christian.koenig, Asahi Lina, Miguel Ojeda, Andreas Hindborg,
	Simona Vetter, Alice Ryhl, Boqun Feng, Sumit Semwal,
	Krishna Ketan Rai, linux-media, Shankari Anand, David Airlie,
	Benno Lossin, Viresh Kumar, linaro-mm-sig, Asahi Lina,
	Greg Kroah-Hartman, kernel
In-Reply-To: <20260428190605.3355690-1-lyude@redhat.com>

One of the more obvious use cases for gem shmem objects is the ability to
create mappings into their contents. So, let's hook this up in our rust
bindings.

Similar to how we handle SGTables, we make sure there's two different types
of mappings: owned mappings (kernel::drm::gem::shmem::VMap) and borrowed
mappings (kernel::drm::gem::shmem::VMapRef).

Signed-off-by: Lyude Paul <lyude@redhat.com>

---
V7:
* Switch over to the new iosys map bindings that use the Io trait
V8:
* Get rid of iosys_map bindings for now, only support non-iomem types
* s/as_shmem()/as_raw_shmem()
V9:
* Get rid of some outdated comments I missed
* Add missing SIZE check to raw_vmap()
* Add a proper unit test that ensures that we actually validate SIZE at
  compile-time.
  Turns out it takes only 34 lines to make a boilerplate DRM driver for a
  kunit test :)
* Add unit tests
* Add some missing #[inline]s
V10:
* Correct issue with iomem error path
  We previously called raw_vunmap() if we got an iomem allocation, but
  raw_vunmap() was written such that it assumed all allocations were sysmem
  allocations. Fix this by just making raw_vunmap() accept a iosys_map.
V11:
* Use Alexandre's clever solution to remove the macros we were using for
  maintaining two different VMap types.
* Change the order of items in Object<T> to ensure that sgt_res is always
  dropped before obj.
* Fix typo in Object.raw_vmap()
* s/raw_vmap()/make_vmap()/
  Deduplicate code a bit more as well by using more generics here

 rust/kernel/drm/gem/shmem.rs | 352 ++++++++++++++++++++++++++++++++++-
 1 file changed, 351 insertions(+), 1 deletion(-)

diff --git a/rust/kernel/drm/gem/shmem.rs b/rust/kernel/drm/gem/shmem.rs
index c0187ff22e526..d68b6e3896915 100644
--- a/rust/kernel/drm/gem/shmem.rs
+++ b/rust/kernel/drm/gem/shmem.rs
@@ -26,6 +26,11 @@
         from_err_ptr,
         to_result, //
     },
+    io::{
+        Io,
+        IoCapable,
+        IoKnownSize, //
+    },
     prelude::*,
     scatterlist,
     sync::{
@@ -37,7 +42,11 @@
     types::Opaque, //
 };
 use core::{
-    mem,
+    ffi::c_void,
+    mem::{
+        self,
+        MaybeUninit, //
+    },
     ops::{
         Deref,
         DerefMut, //
@@ -48,6 +57,7 @@
     },
 };
 use gem::{
+    BaseObject,
     BaseObjectPrivate,
     DriverObject,
     IntoGEMObject, //
@@ -274,6 +284,80 @@ pub fn owned_sg_table(&self, dev: &device::Device<Bound>) -> Result<SGTable<T>>
         // `Devres<SGTableMap<T>>`.
         Ok(SGTable(self.into()))
     }
+
+    /// Attempt to create a vmap from the gem object, and confirm the size of said vmap.
+    fn make_vmap<'a, R, const SIZE: usize>(&'a self) -> Result<VMap<T, R, SIZE>>
+    where
+        R: Deref<Target = Self> + From<&'a Self>,
+    {
+        // INVARIANT: We check here that the gem object is at least as large as `SIZE`.
+        if self.size() < SIZE {
+            return Err(ENOSPC);
+        }
+
+        let mut map: MaybeUninit<bindings::iosys_map> = MaybeUninit::uninit();
+        let guard = DmaResvGuard::new(self);
+
+        // SAFETY: drm_gem_shmem_vmap can be called with the DMA reservation lock held
+        to_result(unsafe {
+            bindings::drm_gem_shmem_vmap_locked(self.as_raw_shmem(), map.as_mut_ptr())
+        })?;
+
+        // Drop the guard explicitly here, since we may need to call raw_vunmap() (which re-acquires
+        // the lock).
+        drop(guard);
+
+        // SAFETY: The call to drm_gem_shmem_vmap_locked succeeded above, so we are guaranteed that
+        // map is properly initialized.
+        let map = unsafe { map.assume_init() };
+
+        // XXX: We don't currently support iomem allocations
+        if map.is_iomem {
+            // SAFETY:
+            // - The vmap operation above succeeded, guaranteeing that `map` points to a valid
+            //   memory mapping.
+            // - We checked that this is an iomem allocation, making it safe to read vaddr_iomem
+            unsafe { self.raw_vunmap(map) };
+
+            Err(ENOTSUPP)
+        } else {
+            Ok(VMap {
+                // SAFETY: We checked that this is not an iomem allocation, making it safe to read
+                // vaddr
+                addr: unsafe { map.__bindgen_anon_1.vaddr },
+                owner: self.into(),
+            })
+        }
+    }
+
+    /// Unmap a vmap from the gem object.
+    ///
+    /// # Safety
+    ///
+    /// - The caller promises that `map` is a valid vmap on this gem object.
+    /// - The caller promises that the memory pointed to by map will no longer be accesed through
+    ///   this instance.
+    unsafe fn raw_vunmap(&self, mut map: bindings::iosys_map) {
+        let _guard = DmaResvGuard::new(self);
+
+        // SAFETY:
+        // - This function is safe to call with the DMA reservation lock held.
+        // - Our `ARef` is proof that the underlying gem object here is initialized and thus safe to
+        //   dereference.
+        unsafe { bindings::drm_gem_shmem_vunmap_locked(self.as_raw_shmem(), &mut map) };
+    }
+
+    /// Creates and returns a virtual kernel memory mapping for this object.
+    #[inline]
+    pub fn vmap<const SIZE: usize>(&self) -> Result<VMapRef<'_, T, SIZE>> {
+        self.make_vmap()
+    }
+
+    /// Creates and returns an owned reference to a virtual kernel memory mapping for this object.
+    #[inline]
+    pub fn owned_vmap<const SIZE: usize>(&self) -> Result<VMapOwned<T, SIZE>> {
+        self.make_vmap()
+    }
 }
 
 impl<T: DriverObject> Deref for Object<T> {
@@ -407,6 +491,155 @@ unsafe impl<T: DriverObject> Send for SGTableMap<T> {}
 // it points to is guaranteed to be thread-safe.
 unsafe impl<T: DriverObject> Sync for SGTableMap<T> {}
 
+macro_rules! impl_vmap_io_capable {
+    ($impl:ident, $ty:ty) => {
+        impl<D, R, const SIZE: usize> IoCapable<$ty> for $impl<D, R, SIZE>
+        where
+            D: DriverObject,
+            R: Deref<Target = Object<D>>,
+        {
+            #[inline(always)]
+            unsafe fn io_read(&self, address: usize) -> $ty {
+                let ptr = address as *mut $ty;
+
+                // SAFETY: The safety contract of `io_read` guarantees that address is a valid
+                // address within the bounds of `Self` of at least the size of $ty, and is properly
+                // aligned.
+                unsafe { ptr::read(ptr) }
+            }
+
+            #[inline(always)]
+            unsafe fn io_write(&self, value: $ty, address: usize) {
+                let ptr = address as *mut $ty;
+
+                // SAFETY: The safety contract of `io_write` guarantees that address is a valid
+                // address within the bounds of `Self` of at least the size of $ty, and is properly
+                // aligned.
+                unsafe { ptr::write(ptr, value) }
+            }
+        }
+    };
+}
+
+/// A reference to a virtual mapping for an shmem-based GEM object in kernel address space.
+///
+/// # Invariants
+///
+/// - The size of `owner` is >= SIZE.
+/// - The memory pointed to by addr remains valid at least until this object is dropped.
+pub struct VMap<D, R, const SIZE: usize = 0>
+where
+    D: DriverObject,
+    R: Deref<Target = Object<D>>,
+{
+    addr: *mut c_void,
+    owner: R,
+}
+
+/// An alias type for a reference to a shmem-based GEM object's VMap.
+pub type VMapRef<'a, D, const SIZE: usize = 0> = VMap<D, &'a Object<D>, SIZE>;
+
+/// An alias type for an owned reference to a shmem-based GEM object's VMap.
+pub type VMapOwned<D, const SIZE: usize = 0> = VMap<D, ARef<Object<D>>, SIZE>;
+
+impl<D, R, const SIZE: usize> VMap<D, R, SIZE>
+where
+    D: DriverObject,
+    R: Deref<Target = Object<D>>,
+{
+    /// Borrows a reference to the object that owns this virtual mapping.
+    #[inline(always)]
+    pub fn owner(&self) -> &Object<D> {
+        &self.owner
+    }
+}
+
+impl<D, R, const SIZE: usize> Drop for VMap<D, R, SIZE>
+where
+    D: DriverObject,
+    R: Deref<Target = Object<D>>,
+{
+    #[inline(always)]
+    fn drop(&mut self) {
+        // SAFETY:
+        // - Our existence is proof that this map was previously created using self.owner.
+        // - Since we are in Drop, we are guaranteed that no one will access the memory
+        //   through this mapping after calling this.
+        unsafe {
+            self.owner.raw_vunmap(bindings::iosys_map {
+                is_iomem: false,
+                __bindgen_anon_1: bindings::iosys_map__bindgen_ty_1 { vaddr: self.addr },
+            })
+        };
+    }
+}
+
+impl<D, R, const SIZE: usize> Io for VMap<D, R, SIZE>
+where
+    D: DriverObject,
+    R: Deref<Target = Object<D>>,
+{
+    #[inline(always)]
+    fn addr(&self) -> usize {
+        self.addr as usize
+    }
+
+    #[inline(always)]
+    fn maxsize(&self) -> usize {
+        self.owner.size()
+    }
+}
+
+impl<D, R, const SIZE: usize> IoKnownSize for VMap<D, R, SIZE>
+where
+    D: DriverObject,
+    R: Deref<Target = Object<D>>,
+{
+    const MIN_SIZE: usize = SIZE;
+}
+
+impl_vmap_io_capable!(VMap, u8);
+impl_vmap_io_capable!(VMap, u16);
+impl_vmap_io_capable!(VMap, u32);
+#[cfg(CONFIG_64BIT)]
+impl_vmap_io_capable!(VMap, u64);
+
+impl<D: DriverObject, const SIZE: usize> Clone for VMapOwned<D, SIZE> {
+    #[inline]
+    fn clone(&self) -> Self {
+        // SAFETY: We have a successful vmap already, so this can't fail.
+        unsafe { self.owner.owned_vmap().unwrap_unchecked() }
+    }
+}
+
+impl<'a, D: DriverObject, const SIZE: usize> Clone for VMapRef<'a, D, SIZE> {
+    #[inline]
+    fn clone(&self) -> Self {
+        // SAFETY: We have a successful vmap already, so this can't fail.
+        unsafe { self.owner.vmap().unwrap_unchecked() }
+    }
+}
+
+impl<'a, D: DriverObject, const SIZE: usize> From<VMapRef<'a, D, SIZE>> for VMapOwned<D, SIZE> {
+    #[inline]
+    fn from(value: VMapRef<'a, D, SIZE>) -> Self {
+        let this = Self {
+            addr: value.addr,
+            owner: value.owner.into(),
+        };
+
+        mem::forget(value);
+        this
+    }
+}
+
+// SAFETY: VMap is thread-safe, and the fact that this VMap has an owned reference to the object
+// means this object will remain valid until dropped.
+unsafe impl<D: DriverObject, const SIZE: usize> Send for VMapOwned<D, SIZE> {}
+// SAFETY: VMap is thread-safe, and the fact that this VMap has an owned reference to the object
+// means this object will remain valid until dropped.
+unsafe impl<D: DriverObject, const SIZE: usize> Sync for VMapOwned<D, SIZE> {}
+
 /// An owned reference to a scatter-gather table of DMA address spans for a GEM shmem object.
 ///
 /// This object holds an owned reference to the underlying GEM shmem object, ensuring that the
@@ -446,3 +679,120 @@ fn deref(&self) -> &Self::Target {
         unsafe { (*self.0.sgt_res.data.get()).as_ref().unwrap_unchecked() }
     }
 }
+
+#[kunit_tests(rust_drm_gem_shmem)]
+mod tests {
+    use super::*;
+    use crate::{
+        drm,
+        faux,
+        page::PAGE_SIZE, //
+    };
+
+    // The bare minimum needed to create a fake drm driver for kunit
+
+    #[pin_data]
+    struct KunitData {}
+    struct KunitDriver;
+    struct KunitFile;
+    #[pin_data]
+    struct KunitObject {}
+
+    const INFO: drm::DriverInfo = drm::DriverInfo {
+        major: 0,
+        minor: 0,
+        patchlevel: 0,
+        name: c"kunit",
+        desc: c"Kunit",
+    };
+
+    impl drm::file::DriverFile for KunitFile {
+        type Driver = KunitDriver;
+
+        fn open(_dev: &drm::Device<KunitDriver>) -> Result<Pin<KBox<Self>>> {
+            Ok(KBox::new(Self, GFP_KERNEL)?.into())
+        }
+    }
+
+    impl gem::DriverObject for KunitObject {
+        type Driver = KunitDriver;
+        type Args = ();
+
+        fn new(
+            _dev: &drm::Device<KunitDriver>,
+            _size: usize,
+            _args: Self::Args,
+        ) -> impl PinInit<Self, Error> {
+            try_pin_init!(KunitObject {})
+        }
+    }
+
+    #[vtable]
+    impl drm::Driver for KunitDriver {
+        type Data = KunitData;
+        type File = KunitFile;
+        type Object = Object<KunitObject>;
+
+        const INFO: drm::DriverInfo = INFO;
+        const IOCTLS: &'static [drm::ioctl::DrmIoctlDescriptor] = &[];
+    }
+
+    fn create_drm_dev() -> Result<(faux::Registration, ARef<drm::Device<KunitDriver>>)> {
+        // Create a faux DRM device so we can test gem object creation.
+        let data = try_pin_init!(KunitData {});
+        let dev = faux::Registration::new(c"Kunit", None)?;
+        let drm = drm::Device::<KunitDriver>::new(dev.as_ref(), data)?;
+
+        Ok((dev, drm))
+    }
+
+    #[test]
+    fn compile_time_vmap_sizes() -> Result {
+        let (_dev, drm) = create_drm_dev()?;
+
+        // Create a gem object to test with
+        let cfg_ = ObjectConfig::<KunitObject> {
+            map_wc: false,
+            parent_resv_obj: None,
+        };
+        let obj = Object::<KunitObject>::new(&drm, PAGE_SIZE, cfg_, ())?;
+
+        // Try creating a normal vmap
+        obj.vmap::<PAGE_SIZE>()?;
+
+        // Try creating a vmap that's smaller then the size we specified
+        obj.vmap::<{ PAGE_SIZE - 100 }>()?;
+
+        // Make sure creating a vmap that's too large fails
+        assert!(obj.vmap::<{ PAGE_SIZE + 200 }>().is_err());
+
+        Ok(())
+    }
+
+    #[test]
+    fn vmap_io() -> Result {
+        let (_dev, drm) = create_drm_dev()?;
+
+        // Create a gem object to test with
+        let cfg_ = ObjectConfig::<KunitObject> {
+            map_wc: false,
+            parent_resv_obj: None,
+        };
+        let obj = Object::<KunitObject>::new(&drm, PAGE_SIZE, cfg_, ())?;
+
+        let vmap = obj.vmap::<PAGE_SIZE>()?;
+
+        vmap.write8(0xDE, 0x0);
+        assert_eq!(vmap.read8(0x0), 0xDE);
+        vmap.write32(0xFFFFFFFF, 0x20);
+
+        assert_eq!(vmap.read32(0x20), 0xFFFFFFFF);
+
+        assert_eq!(vmap.read8(0x20), 0xFF);
+        assert_eq!(vmap.read8(0x21), 0xFF);
+        assert_eq!(vmap.read8(0x22), 0xFF);
+        assert_eq!(vmap.read8(0x23), 0xFF);
+
+        Ok(())
+    }
+}
-- 
2.54.0


^ permalink raw reply related

* [PATCH v13 4/5] rust: drm: gem: Introduce shmem::SGTable
From: Lyude Paul @ 2026-04-28 19:03 UTC (permalink / raw)
  To: nouveau, Gary Guo, Daniel Almeida, rust-for-linux,
	Danilo Krummrich, dri-devel
  Cc: Matthew Maurer, FUJITA Tomonori, Lorenzo Stoakes,
	christian.koenig, Asahi Lina, Miguel Ojeda, Andreas Hindborg,
	Simona Vetter, Alice Ryhl, Boqun Feng, Sumit Semwal,
	Krishna Ketan Rai, linux-media, Shankari Anand, David Airlie,
	Benno Lossin, Viresh Kumar, linaro-mm-sig, Asahi Lina,
	Greg Kroah-Hartman, kernel
In-Reply-To: <20260428190605.3355690-1-lyude@redhat.com>

In order to do this, we need to be careful to ensure that any interface we
expose for scatterlists ensures that any mappings created from one are
destroyed on driver-unbind. To do this, we introduce a Devres resource into
shmem::Object that we use in order to ensure that we release any SGTable
mappings on driver-unbind. We store this in an UnsafeCell and protect
access to it using the dma_resv lock that we already have from the shmem
gem object, which is the same lock that currently protects
drm_gem_object_shmem->sgt.

We also provide two different methods for acquiring an sg table:
self.sg_table(), and self.owned_sg_table(). The first function is for
short-term uses of mapped SGTables, the second is for callers that need to
hold onto the mapped SGTable for an extended period of time. The second
variant uses Devres of course, whereas the first simply relies on rust's
borrow checker to prevent driver-unbind when using the mapped SGTable.

Signed-off-by: Lyude Paul <lyude@redhat.com>

---
V3:
* Rename OwnedSGTable to shmem::SGTable. Since the current version of the
  SGTable abstractions now has a `Owned` and `Borrowed` variant, I think
  renaming this to shmem::SGTable makes things less confusing.
  We do however, keep the name of owned_sg_table() as-is.
V4:
* Clarify safety comments for SGTable to explain why the object is
  thread-safe.
* Rename from SGTableRef to SGTable
V10:
* Use Devres in order to ensure that SGTables are revocable, and are
  unmapped on driver-unbind.
V11:
* s/create_sg_table()/get_sg_table()
* Get rid of extraneous `ret = ` in shmem::Object::get_sg_table()
V12:
* Actually move sgt_res in this patch and not the next one
V13:
* Use DmaResvGuard suggestion from Alexander
* Use Alexander's (much better) solution for get_sg_table()
* Use SetOnce instead of UnsafeCell
* s/SGTableRef/SGTableMap
* Fix typo in SGTableMap documentation
* Create fallible constructor for SGTableMap
* Don't reuse dma_resv lock for protecting Object contents, just use Mutex
  + SetOnce
* Drop use of drm_gem_shmem_get_pages_sgt_locked(), since we don't need to
  hold the dma_resv lock ourselves for anything but this function.
* Check that the device we receive in the bounds for sg_table() and
  owned_sg_table() that said Device is in fact, the correct device.
* Remove redundant docs in owned_sg_table(), just point it back to
  sg_table().
* Implement Deborah's suggestion to fix double-free in
  free_callback()
* Restore original order of Object<T>
* Fix doc typo for SGTableMap

 rust/kernel/drm/gem/shmem.rs | 212 +++++++++++++++++++++++++++++++++--
 1 file changed, 203 insertions(+), 9 deletions(-)

diff --git a/rust/kernel/drm/gem/shmem.rs b/rust/kernel/drm/gem/shmem.rs
index 92ec2b67ed023..c0187ff22e526 100644
--- a/rust/kernel/drm/gem/shmem.rs
+++ b/rust/kernel/drm/gem/shmem.rs
@@ -11,18 +11,33 @@
 
 use crate::{
     container_of,
+    device::{
+        self,
+        Bound, //
+    },
+    devres::*,
     drm::{
         driver,
         gem,
         private::Sealed,
         Device, //
     },
-    error::to_result,
+    error::{
+        from_err_ptr,
+        to_result, //
+    },
     prelude::*,
-    sync::aref::ARef,
+    scatterlist,
+    sync::{
+        aref::ARef,
+        new_mutex,
+        Mutex,
+        SetOnce, //
+    },
     types::Opaque, //
 };
 use core::{
+    mem,
     ops::{
         Deref,
         DerefMut, //
@@ -66,6 +81,10 @@ pub struct Object<T: DriverObject> {
     obj: Opaque<bindings::drm_gem_shmem_object>,
     /// Parent object that owns this object's DMA reservation object.
     parent_resv_obj: Option<ARef<Object<T>>>,
+    /// Devres object for unmapping any SGTable on driver-unbind.
+    /// TODO: Drop the mutex once we can use Init with SetOnce.
+    #[pin]
+    sgt_res: Mutex<SetOnce<Devres<SGTableMap<T>>>>,
     #[pin]
     inner: T,
 }
@@ -118,6 +137,7 @@ pub fn new(
             try_pin_init!(Self {
                 obj <- Opaque::init_zeroed(),
                 parent_resv_obj: config.parent_resv_obj.map(|p| p.into()),
+                sgt_res <- new_mutex!(SetOnce::new()),
                 inner <- T::new(dev, size, args),
             }),
             GFP_KERNEL,
@@ -161,22 +181,99 @@ extern "C" fn free_callback(obj: *mut bindings::drm_gem_object) {
         // - DRM always passes a valid gem object here
         // - We used drm_gem_shmem_create() in our create_gem_object callback, so we know that
         //   `obj` is contained within a drm_gem_shmem_object
-        let this = unsafe { container_of!(obj, bindings::drm_gem_shmem_object, base) };
-
-        // SAFETY:
-        // - We're in free_callback - so this function is safe to call.
-        // - We won't be using the gem resources on `this` after this call.
-        unsafe { bindings::drm_gem_shmem_release(this) };
+        let base = unsafe { container_of!(obj, bindings::drm_gem_shmem_object, base) };
 
         // SAFETY:
         // - We verified above that `obj` is valid, which makes `this` valid
         // - This function is set in AllocOps, so we know that `this` is contained within a
         //   `Object<T>`
-        let this = unsafe { container_of!(Opaque::cast_from(this), Self, obj) }.cast_mut();
+        let this = unsafe { container_of!(Opaque::cast_from(base), Self, obj) }.cast_mut();
+
+        // SAFETY: We are in free_callback(), which means that we have exclusive access to `this`.
+        let mut sgt_guard = unsafe { (*this).sgt_res.lock() };
+
+        // drm_gem_shmem_release() will clear any existing sgt, so we need to clear sgt_res before
+        // calling it to prevent a double-free.
+        drop(mem::take(sgt_guard.deref_mut()));
+
+        // Drop the lock we acquired, we don't need it anymore and it will be acquired again when we
+        // perform the final drop in this function.
+        drop(sgt_guard);
+
+        // SAFETY:
+        // - We're in free_callback - so this function is safe to call.
+        // - We won't be using the gem resources on `this` after this call.
+        unsafe { bindings::drm_gem_shmem_release(base) };
 
         // SAFETY: We're recovering the Kbox<> we created in gem_create_object()
         let _ = unsafe { KBox::from_raw(this) };
     }
+
+    // If necessary, create an SGTable for the gem object and register a Devres for it to ensure
+    // that it is unmapped on driver unbind.
+    fn get_sg_table<'a>(
+        &'a self,
+        dev: &'a device::Device<Bound>,
+    ) -> Result<&'a Devres<SGTableMap<T>>> {
+        if dev.as_raw() != self.dev().as_ref().as_raw() {
+            return Err(EINVAL);
+        }
+
+        let sgt_res = self.sgt_res.lock();
+        let sgt_map = if let Some(devres) = sgt_res.as_ref() {
+            devres
+        } else {
+            // INVARIANT: We store this Devres in the object itself and don't move it, ensuring that
+            // the object it points to remains valid for the lifetime of the SGTableMap.
+            sgt_res.populate(Devres::new(dev, SGTableMap::new(self))?);
+
+            // SAFETY: We just populated `sgt_res` above, making this safe to unwrap.
+            unsafe { sgt_res.as_ref().unwrap_unchecked() }
+        };
+
+        // SAFETY:
+        // We only write to `sgt_res` in two places:
+        // - The above code.
+        // - `free_callback()`, which can't be called as long as `self` is alive.
+        // Therefore, it's safe to hold a reference to the contents of `sgt_res` without holding
+        // the lock for the lifetime of 'a, making this lifetime extension safe.
+        Ok(unsafe { mem::transmute::<&_, &'a _>(sgt_map) })
+    }
+
+    /// Creates (if necessary) and returns an immutable reference to a scatter-gather table of DMA
+    /// pages for this object.
+    ///
+    /// This will pin the object in memory. It is expected that `dev` should be a pointer to the
+    /// same [`device::Device`] which `self` belongs to, otherwise this function will return
+    /// `Err(EINVAL)`.
+    #[inline]
+    pub fn sg_table<'a>(
+        &'a self,
+        dev: &'a device::Device<Bound>,
+    ) -> Result<&'a scatterlist::SGTable> {
+        let sgt = self.get_sg_table(dev)?;
+
+        Ok(sgt.access(dev)?.deref())
+    }
+
+    /// Creates (if necessary) and returns an owned reference to a scatter-gather table of DMA pages
+    /// for this object.
+    ///
+    /// This is the same as [`sg_table`], except that it instead returns an
+    /// [`shmem::SGTable`] which holds a reference to the associated gem object, instead of a
+    /// reference to an [`scatterlist::SGTable`].
+    ///
+    /// See [`sg_table`] for more info.
+    ///
+    /// [`shmem::SGTable`]: SGTable
+    /// [`sg_table`]: Self::sg_table
+    pub fn owned_sg_table(&self, dev: &device::Device<Bound>) -> Result<SGTable<T>> {
+        self.get_sg_table(dev)?;
+
+        // INVARIANT: We just ensured above that `self.sgt_res` is initialized with
+        // `Devres<SGTableMap<T>>`.
+        Ok(SGTable(self.into()))
+    }
 }
 
 impl<T: DriverObject> Deref for Object<T> {
@@ -252,3 +349,100 @@ fn drop(&mut self) {
         unsafe { bindings::dma_resv_unlock(self.0.raw_dma_resv()) };
     }
 }
+
+/// A reference to a GEM object that is known to have a mapped [`SGTable`].
+///
+/// This is used by the Rust bindings with [`Devres`] in order to ensure that mappings for SGTables
+/// on GEM shmem objects are revoked on driver-unbind.
+///
+/// # Invariants
+///
+/// - `self.obj` always points to a valid GEM object.
+/// - This object is proof that `self.obj.owner.sgt` has an initialized and valid
+///   [`scatterlist::SGTable`].
+pub struct SGTableMap<T: DriverObject> {
+    obj: NonNull<Object<T>>,
+}
+
+impl<T: DriverObject> Deref for SGTableMap<T> {
+    type Target = scatterlist::SGTable;
+
+    fn deref(&self) -> &Self::Target {
+        // SAFETY:
+        // - The NonNull is guaranteed to be valid via our type invariants.
+        // - The sgt field is guaranteed to be initialized and valid via our type invariants.
+        unsafe { scatterlist::SGTable::from_raw((*self.obj.as_ref().as_raw_shmem()).sgt) }
+    }
+}
+
+impl<T: DriverObject> Drop for SGTableMap<T> {
+    fn drop(&mut self) {
+        // SAFETY: `obj` is always valid via our type invariants
+        let obj = unsafe { self.obj.as_ref() };
+        let _lock = DmaResvGuard::new(obj);
+
+        // SAFETY: We acquired the lock needed for calling this function above
+        unsafe { bindings::__drm_gem_shmem_free_sgt_locked(obj.as_raw_shmem()) };
+    }
+}
+
+impl<T: DriverObject> SGTableMap<T> {
+    fn new(obj: &Object<T>) -> impl Init<Self, Error> {
+        // INVARIANT:
+        // - We call drm_gem_shmem_get_pages_sgt_locked below and check whether or not it
+        //   succeeds, fulfilling the invariant of SGTableMap that the object's `sgt` field is
+        //   initialized.
+        // SAFETY:
+        // - `obj` is fully initialized, making this function safe to call.
+        from_err_ptr(unsafe { bindings::drm_gem_shmem_get_pages_sgt(obj.as_raw_shmem()) })?;
+
+        Ok(Self { obj: obj.into() })
+    }
+}
+
+// SAFETY: The NonNull in SGTableMap is guaranteed valid by our type invariants, and the GEM object
+// it points to is guaranteed to be thread-safe.
+unsafe impl<T: DriverObject> Send for SGTableMap<T> {}
+// SAFETY: The NonNull in SGTableMap is guaranteed valid by our type invariants, and the GEM object
+// it points to is guaranteed to be thread-safe.
+unsafe impl<T: DriverObject> Sync for SGTableMap<T> {}
+
+/// An owned reference to a scatter-gather table of DMA address spans for a GEM shmem object.
+///
+/// This object holds an owned reference to the underlying GEM shmem object, ensuring that the
+/// [`scatterlist::SGTable`] referenced by this type remains valid for the lifetime of this object.
+///
+/// # Invariants
+///
+/// - This type is proof that `self.0.sgt_res` is initialized with a `Devres<SGTableMap<T>>`.
+/// - This object is only exposed in situations where we know the underlying `SGTable` will not be
+///   modified for the lifetime of this object. Thus, it is safe to send/access this type across
+///   threads.
+pub struct SGTable<T: DriverObject>(ARef<Object<T>>);
+
+// SAFETY: This object is thread-safe via our type invariants.
+unsafe impl<T: DriverObject> Send for SGTable<T> {}
+// SAFETY: This object is thread-safe via our type invariants.
+unsafe impl<T: DriverObject> Sync for SGTable<T> {}
+
+impl<T: DriverObject> Deref for SGTable<T> {
+    type Target = Devres<SGTableMap<T>>;
+
+    #[inline(always)]
+    fn deref(&self) -> &Self::Target {
+        // TODO: This is Bad, but we'll replace this and do better once we can pass an Init to
+        // SetOnce.
+        // SAFETY:
+        // - We only write to this location in two places:
+        //   - Object::<T>::get_sg_table()
+        //   - Object::<T>::free_callback() (which gets called by gem shmem helpers after the last
+        //     gem object ref drop).
+        //   Our type is proof that get_sg_table() has been called previously, and also proof that
+        //   `free_callback()` has not been called - meaning that we can assume no races will occur
+        //   for the lifetime of this object and we can safely access the Mutex contents without
+        //   actually locking it.
+        // - Since we proved get_sg_table() has been called, we know that sgt_res is already
+        //   populated and thus unwrap_unchecked() is safe to call.
+        unsafe { (*self.0.sgt_res.data.get()).as_ref().unwrap_unchecked() }
+    }
+}
-- 
2.54.0


^ permalink raw reply related

* [PATCH v13 3/5] rust: drm: gem/shmem: Add DmaResvGuard helper
From: Lyude Paul @ 2026-04-28 19:03 UTC (permalink / raw)
  To: nouveau, Gary Guo, Daniel Almeida, rust-for-linux,
	Danilo Krummrich, dri-devel
  Cc: Matthew Maurer, FUJITA Tomonori, Lorenzo Stoakes,
	christian.koenig, Asahi Lina, Miguel Ojeda, Andreas Hindborg,
	Simona Vetter, Alice Ryhl, Boqun Feng, Sumit Semwal,
	Krishna Ketan Rai, linux-media, Shankari Anand, David Airlie,
	Benno Lossin, Viresh Kumar, linaro-mm-sig, Asahi Lina,
	Greg Kroah-Hartman, kernel
In-Reply-To: <20260428190605.3355690-1-lyude@redhat.com>

Just a temporary holdover to make locking/unlocking the dma_resv lock much
easier.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Co-authored-by: Alexandre Courbot <acourbot@nvidia.com>
---
 rust/kernel/drm/gem/shmem.rs | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/rust/kernel/drm/gem/shmem.rs b/rust/kernel/drm/gem/shmem.rs
index 35d7523e164ff..92ec2b67ed023 100644
--- a/rust/kernel/drm/gem/shmem.rs
+++ b/rust/kernel/drm/gem/shmem.rs
@@ -27,7 +27,10 @@
         Deref,
         DerefMut, //
     },
-    ptr::NonNull,
+    ptr::{
+        self,
+        NonNull, //
+    },
 };
 use gem::{
     BaseObjectPrivate,
@@ -224,3 +227,28 @@ impl<T: DriverObject> driver::AllocImpl for Object<T> {
         dumb_map_offset: None,
     };
 }
+
+/// Private helper-type for holding the `dma_resv` object for a GEM shmem object.
+///
+/// When this is dropped, the `dma_resv` lock is dropped as well.
+///
+// TODO: This should be replace with a WwMutex equivalent once we have such bindings in the kernel.
+struct DmaResvGuard<'a, T: DriverObject>(&'a Object<T>);
+
+impl<'a, T: DriverObject> DmaResvGuard<'a, T> {
+    #[inline(always)]
+    fn new(obj: &'a Object<T>) -> Self {
+        // SAFETY: This lock is initialized throughout the lifetime of `object`.
+        unsafe { bindings::dma_resv_lock(obj.raw_dma_resv(), ptr::null_mut()) };
+
+        Self(obj)
+    }
+}
+
+impl<'a, T: DriverObject> Drop for DmaResvGuard<'a, T> {
+    #[inline(always)]
+    fn drop(&mut self) {
+        // SAFETY: We are releasing the lock grabbed during the creation of this object.
+        unsafe { bindings::dma_resv_unlock(self.0.raw_dma_resv()) };
+    }
+}
-- 
2.54.0


^ permalink raw reply related

* [PATCH v13 2/5] drm/gem/shmem: Introduce __drm_gem_shmem_free_sgt_locked()
From: Lyude Paul @ 2026-04-28 19:03 UTC (permalink / raw)
  To: nouveau, Gary Guo, Daniel Almeida, rust-for-linux,
	Danilo Krummrich, dri-devel
  Cc: Matthew Maurer, FUJITA Tomonori, Lorenzo Stoakes,
	christian.koenig, Asahi Lina, Miguel Ojeda, Andreas Hindborg,
	Simona Vetter, Alice Ryhl, Boqun Feng, Sumit Semwal,
	Krishna Ketan Rai, linux-media, Shankari Anand, David Airlie,
	Benno Lossin, Viresh Kumar, linaro-mm-sig, Asahi Lina,
	Greg Kroah-Hartman, kernel
In-Reply-To: <20260428190605.3355690-1-lyude@redhat.com>

One of the complications of trying to use the shmem helpers to create a
scatterlist for shmem objects is that we need to be able to provide a
guarantee that the driver cannot be unbound for the lifetime of the
scatterlist.

The easiest way of handling this seems to be just hooking up an unmap
operation to devres the first time we create a scatterlist, which allows us
to still take advantage of gem shmem facilities without breaking that
guarantee. To allow for this, we extract __drm_gem_shmem_free_sgt_locked()
- which allows a caller (e.g. the rust bindings) to manually unmap the sgt
for a gem object as needed.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

---
V10:
* Fix incorrect function name in documentation for
  __drm_gem_shmem_release_sgt_locked()

 drivers/gpu/drm/drm_gem_shmem_helper.c | 32 +++++++++++++++++++++-----
 include/drm/drm_gem_shmem_helper.h     |  1 +
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 545933c7f7121..c989459eb2159 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -158,6 +158,30 @@ struct drm_gem_shmem_object *drm_gem_shmem_create(struct drm_device *dev, size_t
 }
 EXPORT_SYMBOL_GPL(drm_gem_shmem_create);
 
+/**
+ * __drm_gem_shmem_release_sgt_locked - Unpin and DMA unmap pages, and release the
+ * cached scatter/gather table for an shmem GEM object.
+ * @shmem: shmem GEM object
+ *
+ * If the passed shmem object has an active scatter/gather table for driver
+ * usage, this function will unmap it and release the memory associated with it.
+ * It is the responsibility of the caller to ensure it holds the dma_resv_lock
+ * for this object.
+ *
+ * Drivers should not need to call this function themselves, it is mainly
+ * intended for usage in the Rust shmem bindings.
+ */
+void __drm_gem_shmem_free_sgt_locked(struct drm_gem_shmem_object *shmem)
+{
+	dma_resv_assert_held(shmem->base.resv);
+
+	dma_unmap_sgtable(shmem->base.dev->dev, shmem->sgt, DMA_BIDIRECTIONAL, 0);
+	sg_free_table(shmem->sgt);
+	kfree(shmem->sgt);
+	shmem->sgt = NULL;
+}
+EXPORT_SYMBOL_GPL(__drm_gem_shmem_free_sgt_locked);
+
 /**
  * drm_gem_shmem_release - Release resources associated with a shmem GEM object.
  * @shmem: shmem GEM object
@@ -176,12 +200,8 @@ void drm_gem_shmem_release(struct drm_gem_shmem_object *shmem)
 
 		drm_WARN_ON(obj->dev, refcount_read(&shmem->vmap_use_count));
 
-		if (shmem->sgt) {
-			dma_unmap_sgtable(obj->dev->dev, shmem->sgt,
-					  DMA_BIDIRECTIONAL, 0);
-			sg_free_table(shmem->sgt);
-			kfree(shmem->sgt);
-		}
+		if (shmem->sgt)
+			__drm_gem_shmem_free_sgt_locked(shmem);
 		if (shmem->pages)
 			drm_gem_shmem_put_pages_locked(shmem);
 
diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h
index 5ccdae21b94a9..b2c23af628e1a 100644
--- a/include/drm/drm_gem_shmem_helper.h
+++ b/include/drm/drm_gem_shmem_helper.h
@@ -111,6 +111,7 @@ int drm_gem_shmem_init(struct drm_device *dev, struct drm_gem_shmem_object *shme
 struct drm_gem_shmem_object *drm_gem_shmem_create(struct drm_device *dev, size_t size);
 void drm_gem_shmem_release(struct drm_gem_shmem_object *shmem);
 void drm_gem_shmem_free(struct drm_gem_shmem_object *shmem);
+void __drm_gem_shmem_free_sgt_locked(struct drm_gem_shmem_object *shmem);
 
 void drm_gem_shmem_put_pages_locked(struct drm_gem_shmem_object *shmem);
 int drm_gem_shmem_pin(struct drm_gem_shmem_object *shmem);
-- 
2.54.0


^ permalink raw reply related

* [PATCH v13 1/5] rust: drm: gem: s/device::Device/Device/ for shmem.rs
From: Lyude Paul @ 2026-04-28 19:03 UTC (permalink / raw)
  To: nouveau, Gary Guo, Daniel Almeida, rust-for-linux,
	Danilo Krummrich, dri-devel
  Cc: Matthew Maurer, FUJITA Tomonori, Lorenzo Stoakes,
	christian.koenig, Asahi Lina, Miguel Ojeda, Andreas Hindborg,
	Simona Vetter, Alice Ryhl, Boqun Feng, Sumit Semwal,
	Krishna Ketan Rai, linux-media, Shankari Anand, David Airlie,
	Benno Lossin, Viresh Kumar, linaro-mm-sig, Asahi Lina,
	Greg Kroah-Hartman, kernel
In-Reply-To: <20260428190605.3355690-1-lyude@redhat.com>

We're about to start explicitly mentioning kernel devices as well in this
file, so this makes it easier to differentiate the two by allowing us to
import `device` as `kernel::device`.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

---
V11:
* Fix location of //

 rust/kernel/drm/gem/shmem.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rust/kernel/drm/gem/shmem.rs b/rust/kernel/drm/gem/shmem.rs
index e1b648920d2f6..35d7523e164ff 100644
--- a/rust/kernel/drm/gem/shmem.rs
+++ b/rust/kernel/drm/gem/shmem.rs
@@ -12,10 +12,10 @@
 use crate::{
     container_of,
     drm::{
-        device,
         driver,
         gem,
-        private::Sealed, //
+        private::Sealed,
+        Device, //
     },
     error::to_result,
     prelude::*,
@@ -106,7 +106,7 @@ fn as_raw_shmem(&self) -> *mut bindings::drm_gem_shmem_object {
     ///
     /// Additional config options can be specified using `config`.
     pub fn new(
-        dev: &device::Device<T::Driver>,
+        dev: &Device<T::Driver>,
         size: usize,
         config: ObjectConfig<'_, T>,
         args: T::Args,
@@ -148,9 +148,9 @@ pub fn new(
     }
 
     /// Returns the `Device` that owns this GEM object.
-    pub fn dev(&self) -> &device::Device<T::Driver> {
+    pub fn dev(&self) -> &Device<T::Driver> {
         // SAFETY: `dev` will have been initialized in `Self::new()` by `drm_gem_shmem_init()`.
-        unsafe { device::Device::from_raw((*self.as_raw()).dev) }
+        unsafe { Device::from_raw((*self.as_raw()).dev) }
     }
 
     extern "C" fn free_callback(obj: *mut bindings::drm_gem_object) {
-- 
2.54.0


^ permalink raw reply related

* [PATCH v13 0/5] Rust bindings for gem shmem
From: Lyude Paul @ 2026-04-28 19:03 UTC (permalink / raw)
  To: nouveau, Gary Guo, Daniel Almeida, rust-for-linux,
	Danilo Krummrich, dri-devel
  Cc: Matthew Maurer, FUJITA Tomonori, Lorenzo Stoakes,
	christian.koenig, Asahi Lina, Miguel Ojeda, Andreas Hindborg,
	Simona Vetter, Alice Ryhl, Boqun Feng, Sumit Semwal,
	Krishna Ketan Rai, linux-media, Shankari Anand, David Airlie,
	Benno Lossin, Viresh Kumar, linaro-mm-sig, Asahi Lina,
	Greg Kroah-Hartman, kernel

Most of this patch series has already been pushed upstream, this is just
the second half of the patch series that has not been pushed yet + some
additional changes which were required to implement changes requested by
the mailing list. This patch series is originally from Asahi, previously
posted by Daniel Almeida.

The previous version of the patch series can be found here:

	https://patchwork.freedesktop.org/series/164580/

Branch with patches applied available here
sure this builds:

	https://gitlab.freedesktop.org/lyudess/linux/-/commits/rust/gem-shmem

This patch series applies on top of drm-rust-next

Lyude Paul (5):
  rust: drm: gem: s/device::Device/Device/ for shmem.rs
  drm/gem/shmem: Introduce __drm_gem_shmem_free_sgt_locked()
  rust: drm: gem/shmem: Add DmaResvGuard helper
  rust: drm: gem: Introduce shmem::SGTable
  rust: drm: gem: Add vmap functions to shmem bindings

 drivers/gpu/drm/drm_gem_shmem_helper.c |  32 +-
 include/drm/drm_gem_shmem_helper.h     |   1 +
 rust/kernel/drm/gem/shmem.rs           | 602 ++++++++++++++++++++++++-
 3 files changed, 614 insertions(+), 21 deletions(-)


base-commit: d9a6809478f9815b6455a327aa001737ac7b2c09
-- 
2.54.0


^ permalink raw reply

* Re: [PATCH v2] staging: tegra-video: Align wrapped function arguments
From: Dan Carpenter @ 2026-04-28 18:59 UTC (permalink / raw)
  To: Marc Hanna
  Cc: linux-media, linux-staging, linux-tegra, linux-kernel,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli, mchehab,
	gregkh
In-Reply-To: <20260428185024.853-1-marchanna111@gmail.com>

The subject still says the patch is aligning function arguments when
the patch is about long lines.


On Tue, Apr 28, 2026 at 01:50:24PM -0500, Marc Hanna wrote:
> Align wrapped arguments in tegra20.c
> to follow kernel coding style.
> 
> v2:
> - Fix From header
> - Update commit message per review feedback
> 
This goes under the --- cut off line.

> Signed-off-by: Marc Hanna <marchanna111@gmail.com>
> ---
  ^^^
here.

https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

regards,
dan carpenter


^ permalink raw reply

* [PATCH v2] staging: tegra-video: Align wrapped function arguments
From: Marc Hanna @ 2026-04-28 18:50 UTC (permalink / raw)
  To: linux-media
  Cc: linux-staging, linux-tegra, linux-kernel, thierry.reding,
	jonathanh, skomatineni, luca.ceresoli, mchehab, gregkh,
	Marc Hanna

Align wrapped arguments in tegra20.c
to follow kernel coding style.

v2:
- Fix From header
- Update commit message per review feedback

Signed-off-by: Marc Hanna <marchanna111@gmail.com>
---
 drivers/staging/media/tegra-video/tegra20.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/staging/media/tegra-video/tegra20.c
index e513e6ccb776..eb1fc5b7e2cd 100644
--- a/drivers/staging/media/tegra-video/tegra20.c
+++ b/drivers/staging/media/tegra-video/tegra20.c
@@ -552,7 +552,8 @@ static void tegra20_channel_vi_buffer_setup(struct tegra_vi_channel *chan,
 	case V4L2_PIX_FMT_YUYV:
 	case V4L2_PIX_FMT_YVYU:
 		tegra20_vi_write(chan, TEGRA_VI_VB0_BASE_ADDRESS(TEGRA_VI_OUT_1),  base);
-		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_1), base + chan->start_offset);
+		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_1),
+				 base + chan->start_offset);
 		break;
 	/* RAW8 */
 	case V4L2_PIX_FMT_SRGGB8:
@@ -565,7 +566,8 @@ static void tegra20_channel_vi_buffer_setup(struct tegra_vi_channel *chan,
 	case V4L2_PIX_FMT_SGBRG10:
 	case V4L2_PIX_FMT_SBGGR10:
 		tegra20_vi_write(chan, TEGRA_VI_VB0_BASE_ADDRESS(TEGRA_VI_OUT_2),  base);
-		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_2), base + chan->start_offset);
+		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_2),
+				 base + chan->start_offset);
 		break;
 	}
 }
-- 
2.43.0


^ permalink raw reply related

* Re: [ANNv4] Media Summit on May 26th in Nice, France
From: Nicolas Dufresne @ 2026-04-28 17:54 UTC (permalink / raw)
  To: Hans Verkuil, Jacopo Mondi, Laurent Pinchart
  Cc: Loic Poulain, Michael Riesch, Ricardo Ribalda,
	Linux Media Mailing List, Mauro Carvalho Chehab, Sean Young,
	Sakari Ailus, Niklas Söderlund, Tomi Valkeinen, Alain Volmat,
	Bryan O'Donoghue, Dave Stevenson, Daniel Almeida,
	Michael Tretter, Tomasz Figa, Steve Cho, Kieran Bingham,
	Kevin Hilman, Paul Kocialkowski, Benjamin Mugnier, Hans de Goede,
	Maxime Ripard, Brandon Brnich, Marco Felsch, Sven Püschel,
	Devarsh Thakkar, Yemike Abhilash Chandra, Jackson Lee, Jai Luthra,
	Mehdi Djait, Padhi, Beleswar, Donadkar, Rishikesh,
	Rouven Czerwinski, Nayden Kanchev, Konstantin Babin,
	Anthony McGivern
In-Reply-To: <77ea77b9-5503-40b2-882b-e96e30028c43@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 21388 bytes --]

Le mardi 28 avril 2026 à 15:00 +0200, Hans Verkuil a écrit :
> On 4/28/26 14:30, Jacopo Mondi wrote:
> > Hello
> > 
> > On Tue, Apr 14, 2026 at 11:42:59AM +0300, Laurent Pinchart wrote:
> > > On Tue, Apr 14, 2026 at 10:34:13AM +0200, Loic Poulain wrote:
> > > > On Tue, Apr 14, 2026 at 9:42 AM Laurent Pinchart wrote:
> > > > > On Tue, Apr 14, 2026 at 09:20:56AM +0200, Michael Riesch wrote:
> > > > > > On 4/14/26 08:55, Ricardo Ribalda wrote:
> > > > > > > On Tue, 14 Apr 2026 at 08:47, Hans Verkuil <hverkuil+cisco@kernel.org> wrote:
> > > > > > > > On 13/04/2026 23:16, Laurent Pinchart wrote:
> > > > > > > > > On Mon, Apr 13, 2026 at 04:25:54PM -0400, Nicolas Dufresne wrote:
> > > > > > > > > > Le lundi 13 avril 2026 à 23:19 +0300, Laurent Pinchart a écrit :
> > > > > > > > > > > On Mon, Apr 13, 2026 at 10:03:52PM +0200, Loic Poulain wrote:
> > > > > > > > > > > > Hi Hans,
> > > > > > > > > > > > 
> > > > > > > > > > > > I would be happy to discuss this if a slot is available:
> > > > > > > > > > > > 
> > > > > > > > > > > > Title: Generic V4L2 ISP M2M framework
> > > > > > > > > > > > Presenter: Loic Poulain
> > > > > > > > > > > > Time estimate: ~20min
> > > > > > > > > > > > Description: During early development of a Qualcomm Offline Image
> > > > > > > > > > > > Processing Engine (OPE), we relied on the V4L2 memory‑to‑memory
> > > > > > > > > > > > (v4l2‑m2m) framework, which is widely used and provides solid support
> > > > > > > > > > > > for buffer management and scheduling. However, applying it to an ISP
> > > > > > > > > > > > use case exposes limitations: ISP engines often require a richer media
> > > > > > > > > > > > graph, with multiple pads and metadata flows, similar to inline ISP
> > > > > > > > > > > > pipelines (params, stats, outputs). This talk proposes discussing the
> > > > > > > > > > > > need for and design of a common V4L2 ISP M2M framework to factor out
> > > > > > > > > > > > shared functionality across drivers, particularly around buffer/queue
> > > > > > > > > > > > management and job scheduling.
> > > > > > 
> > > > > > It seems that we share some pain points.. :-) :-/
> > > > > > 
> > > > > > Over the last year, some ideas have been brewing in my mind. Not
> > > > > > necessarily *my* ideas, mind you, rather ideas that have been around in
> > > > > > linux-media for quite a while, actually. What I would like to prepare
> > > > > > for the Media Summit goes along the same lines.
> > > > > > 
> > > > > > > > > > > That's well aligned with the v4l2-isp framework that Jacopo started, and
> > > > > > > > > > > to the multi-context and media-jobs APIs that we have proposed. I
> > > > > > > > > > > wonder, however, if a short session at the media summit will be enough,
> > > > > > > > > > > or if we should try to organize a half day brainstorming workshop at
> > > > > > > > > > > some point. Depending on when the people interested in this topic plan
> > > > > > > > > > > to arrive, Monday could be an option.
> > > > > > > > > > 
> > > > > > > > > > I'm also/still interested in the multi-context for m2m decoders that have inline
> > > > > > > > > > post-processing capabilities (current model forces us to waste a lot of RAM). We
> > > > > > > > > > just restarted some design discussion with the team, with an increased
> > > > > > > > > > confidence that multi-context is the way. The scheduler could come handy in the
> > > > > > > > > > future if we get to deal with more multi-stage codecs in the future. I'll be in
> > > > > > > > > > Nice all day Monday.
> > > > > > > > > 
> > > > > > > > > I will unfortunately be available only until 15:00 on Monday, but Jacopo
> > > > > > > > > should be available through the day. Let's see who would be interested
> > > > > > > > > and available, and try to organize something.
> > > > > > > > 
> > > > > > > > I'm available on Monday as well. I think this is a topic that is well suited
> > > > > > > > to a brainstorm session.
> > > > > > > 
> > > > > > > I am also available on Monday and would like to attend the session.
> > > > > > 
> > > > > > I'd be interested too. Right now the plan is to arrive on Monday
> > > > > > afternoon. Depending on what time you agree on it may work out anyway.
> > > > > > It would be great to know the exact time this session will start (as I
> > > > > > might need to adjust my travel arrangements).
> > > > 
> > > > I can arrive on Monday, with a preference for the afternoon.
> > > > 
> > > > > We need a volunteer to organize this, as in finding and booking a
> > > > > meeting space. Note that Monday is a public holiday in France (Monday
> > > > > the 25th of May in particular, not all Mondays).
> > > > > 
> > > > > If the number of attendees was small I was thinking of hosting the event
> > > > > in the place where the Ideas on Board team will be staying, but it looks
> > > > > like we're already reaching a fair number of people.
> > > > > 
> > 
> > Are we still considering this BoF session ?
> > 
> > We would someone to volunteer organizing this, at @IoB we're quite
> > full for the week and we might have an hard time organizing this one
> > on top of the libcamera workshop.
> > 
> > As Laurent said, that Monday is a public holiday in France, and
> > getting a room somewhere might be complicated.
> > 
> > We can host some people in the location where we're having the yearly IoB
> > get-together, but you should arrange your travel there (35 minutes
> > from Nice by car).
> > 
> > If we get a volunteer we can should maybe a dedicated mail thread as this one
> > was about the Media Summit ?
> 
> If the number of people can be kept low (say <= 6), then it shouldn't be a
> problem to just find a hotel restaurant or similar, close to the place of
> the media summit, and just sit together.
> 
> Who would be the key people for this? And who are 'nice to have'? :-)
> I think I probably fit more in the latter category than the first.

I was hoping a small number of people and a simple café/lobby too. The mass of
people interested in the reply arrive much later, but I'm there all day, and
would be more then happy to be able to brainstorm the subject a bit, which is
easier in small group.

Nicolas

p.s. once we know how many, if its too big, I can always abuse Mark again and
ask him to figure-out something for us.

> 
> Regards,
> 
> 	Hans
> 
> > 
> > 
> > > > > > > Regards!
> > > > > > > 
> > > > > > > > The agenda for the media summit is getting quite full, and I agree with Laurent
> > > > > > > > that 20 minutes is likely not enough. If we can so a session on Monday instead,
> > > > > > > > then that would be a good solution.
> > > > > > 
> > > > > > Apart from the time and date the scope of this session would be interesting.
> > > > > > 
> > > > > > Will this be a birds of a feather session in which the next generation
> > > > > > kernel ISP framework will be discussed? Or even the next generation
> > > > > > kernel video processing framework, where video processing is image
> > > > > > signal processing, encoding/decoding, 2D graphics processing (fisheye
> > > > > > correction units, 2D GPU such as the Rockchip RGA3, ...)?
> > > > > 
> > > > > I would focus on Loic's original scope. If the solution can be used for
> > > > > other devices that's great too. I believe that the current multi-context
> > > > > patch series is a good fit for codecs. If we broaden the scope too much
> > > > > right away we'll achieve nothing.
> > > > > 
> > > > > > > > I have never been very enthusiastic about the m2m framework: it's fine for e.g.
> > > > > > > > simple scalers, but it's awkward to use for codecs let alone ISPs.
> > > > > > > > 
> > > > > > > > I always felt that we really need variants of the m2m framework that are customized
> > > > > > > > to specific use-cases: i.e. a codec m2m framework, and (perhaps) an ISP m2m framework.
> > > > > > > > 
> > > > > > > > The big problem with that is of course who will do the work. Making new frameworks
> > > > > > > > is difficult and takes a long time.
> > > > 
> > > > A couple of weeks ago, I submitted an initial driver for a Qualcomm
> > > > Offline ISP based on the standard v4l2-m2m framework. Following
> > > > discussions around which parts could be generalized, I started
> > > > migrating this work to a new v4l2-isp-m2m framework:
> > > > (https://github.com/loicpoulain/linux/commit/5d575d7eff8f2371e91d8237148ffdb44b0af5b0).
> > > 
> > > I definitely want to discuss this, but I will be available on Monday
> > > until 15:00 only.
> > > 
> > > > The API and overall logic closely mirror v4l2-m2m.c, but are extended
> > > > to address ISP‑specific requirements such as multi‑device support and
> > > > multiple queue handling.
> > > 
> > > That part I don't like. The V4L2 M2M framework is a big mid-layer that
> > > prevents drivers from having control of how operations are handled. It
> > > does too much, and doesn't give enough flexibility to drivers. It may
> > > have been fine when the framework was designed, for the devices we had
> > > back then, but today it's just painful. I want to turn this around and
> > > give control to the drivers, with helpers they can use to implement
> > > parts that are not driver-specific. This needs to be opt-in, not a layer
> > > that takes completely control between the uAPI and driver operations.
> > > 
> > > Let's not reproduce the design mistakes made in the V4L2 M2M framework.
> > > 
> > > I also think you need to decouple the context handling and scheduling in
> > > two separate components. They need to work together, but shouldn't be
> > > bundled into a monolithic system. Very importantly, a driver should be
> > > able to implement contexts with the multi-context helpers, and implement
> > > custom scheduling itself.
> > > 
> > > > I am planning to submit this work as an RFC
> > > > before the Media Summit. At this stage, the framework is still fairly
> > > > basic and primarily tailored to the Qualcomm use case. There is
> > > > definitely room for improvement, for example, integrating Jacopo’s
> > > > multi‑context support, since for now, the Qualcomm driver simply
> > > > instantiates a single ISP‑M2M context.
> > > > 
> > > > As I am still getting familiar with the media subsystem, this work may
> > > > overlap with or conflict with ongoing efforts. Synchronizing seems
> > > > indeed important. Based on my current understanding, there are several
> > > > related areas of work that appear either complementary or orthogonal:
> > > > - Multi‑context support, to instantiate multiple processing sessions
> > > > on shared hardware/driver.
> > > > - Media jobs, to synchronize work across multiple drivers within the
> > > > same media pipeline.
> > > > - ISP M2M, aiming to provide a v4l2-m2m‑like framework specifically
> > > > for memory‑to‑memory ISP devices.
> > > > 
> > > > > > This may be naive and overly optimistic, but I feel there is quite a
> > > > > > number of people sharing the same pain points (which are similar to
> > > > > > those Loic pointed out). Maybe (hopefully) this birds of a feather
> > > > > > session leads to the formation of some work group?
> > > > > > 
> > > > > > > > > > > > On Sun, Apr 12, 2026 at 12:25 PM Hans Verkuil wrote:
> > > > > > > > > > > > > 
> > > > > > > > > > > > > (Please pass this on to anyone you think might be interested in this!)
> > > > > > > > > > > > > 
> > > > > > > > > > > > > Hi all,
> > > > > > > > > > > > > 
> > > > > > > > > > > > > This is the fourth version of this announcement, updating the list of attendees
> > > > > > > > > > > > > and the tentative agenda at the end: please let me know if you see mistakes.
> > > > > > > > > > > > > Note that there is still time for one or two other topics. Also please check
> > > > > > > > > > > > > the agenda if you need more (or perhaps less) time for your topic.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > This year's Media Summit will be held on Tuesday May 26th the day before the
> > > > > > > > > > > > > Embedded Recipes Conference in Nice, France:
> > > > > > > > > > > > > 
> > > > > > > > > > > > > https://embedded-recipes.org/2026/
> > > > > > > > > > > > > 
> > > > > > > > > > > > > The Media Summit will be held at Hotel Campanile and in the same meeting room
> > > > > > > > > > > > > as last year (Nikaia):
> > > > > > > > > > > > > 
> > > > > > > > > > > > > https://nice-aeroport.campanile.com/en-us/
> > > > > > > > > > > > > 
> > > > > > > > > > > > > It is close to the Airport and to the Embedded Recipes venue.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > The meeting room can hold up to 30 people and I will provide video conferencing support,
> > > > > > > > > > > > > just like last year. The location and the meeting room was quite nice last year, so
> > > > > > > > > > > > > I saw no need to change it.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > That said, in-person participation is very much preferred. This yearly summit is meant
> > > > > > > > > > > > > for active media developers to meet face-to-face and to discuss media subsystem issues.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > And it is also a good opportunity to talk to each other during the Embedded Recipes
> > > > > > > > > > > > > conference to discuss topics in a smaller group. But if you are an active media developer
> > > > > > > > > > > > > and are really not able to attend in person, then remote participation is an option.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > If you want to attend the meeting (either in person or remote), then send an email to me
> > > > > > > > > > > > > directly. The deadline for in-person attendance is May 14 as the hotel needs to know the
> > > > > > > > > > > > > final number of attendees by then.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > There is no registration fee, the meeting room is sponsored by Cisco and Collabora, and
> > > > > > > > > > > > > the lunch is sponsored by Ideas on Board! Many thanks to our sponsors, it's very much
> > > > > > > > > > > > > appreciated.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > If you have a topic that you want to discuss, just 'Reply All' to this announcement
> > > > > > > > > > > > > and give the topic title, a short description and a guesstimate of the time you need
> > > > > > > > > > > > > for your topic.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > See last year's Media Summit Report as an example of what to expect:
> > > > > > > > > > > > > 
> > > > > > > > > > > > > https://lore.kernel.org/linux-media/21769183-ca57-4f8f-818a-6a1ad089298d@jjverkuil.nl/
> > > > > > > > > > > > > 
> > > > > > > > > > > > > Regards,
> > > > > > > > > > > > > 
> > > > > > > > > > > > >         Hans
> > > > > > > > > > > > > 
> > > > > > > > > > > > > PS: Be aware that May 24 and 25 are public holidays in France. So many
> > > > > > > > > > > > > shops may be
> > > > > > > > > > > > > closed those days.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > In-person attendees:
> > > > > > > > > > > > > Sakari Ailus <sakari.ailus@linux.intel.com>
> > > > > > > > > > > > > Kieran Bingham <kieran.bingham@ideasonboard.com>
> > > > > > > > > > > > > Brandon Brnich <b-brnich@ti.com>
> > > > > > > > > > > > > Rouven Czerwinski <rouven.czerwinski@linaro.org>
> > > > > > > > > > > > > Mehdi Djait <mehdi.djait@linux.intel.com>
> > > > > > > > > > > > > Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> > > > > > > > > > > > > Nicolas Dufresne <nicolas.dufresne@collabora.com>
> > > > > > > > > > > > > Marco Felsch <m.felsch@pengutronix.de>
> > > > > > > > > > > > > Paul Kocialkowski <paulk@sys-base.io>
> > > > > > > > > > > > > Jai Luthra <jai.luthra@ideasonboard.com>
> > > > > > > > > > > > > Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > > > > > > > > > Benjamin Mugnier <benjamin.mugnier@foss.st.com>
> > > > > > > > > > > > > Beleswar Padhi <b-padhi@ti.com>
> > > > > > > > > > > > > Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > > > > > > > > > > Loic Poulain <loic.poulain@oss.qualcomm.com>
> > > > > > > > > > > > > Sven Püschel <s.pueschel@pengutronix.de>
> > > > > > > > > > > > > Ricardo Ribalda <ribalda@chromium.org>
> > > > > > > > > > > > > Michael Riesch <michael.riesch@collabora.com>
> > > > > > > > > > > > > Devarsh Thakkar <devarsht@ti.com>
> > > > > > > > > > > > > Michael Tretter <m.tretter@pengutronix.de>
> > > > > > > > > > > > > Hans Verkuil <hverkuil@kernel.org>
> > > > > > > > > > > > > 
> > > > > > > > > > > > > Remote attendees:
> > > > > > > > > > > > > Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
> > > > > > > > > > > > > Rishikesh Donadkar <r-donadkar@ti.com>
> > > > > > > > > > > > > Jackson Lee <jackson.lee@chipsnmedia.com>
> > > > > > > > > > > > > Dave Stevenson <dave.stevenson@raspberrypi.com> (tentative)
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 
> > > > > > > > > > > > > Agenda (tentative):
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 8:45-9:20: Arrive, settle in
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 9:20-9:30: Short intro (Hans Verkuil)
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 9:30-9:45: Status of ISP support in V4L2
> > > > > > > > > > > > >         Presenter: Laurent Pinchart
> > > > > > > > > > > > >         Description: Summary of ISP-related development in V4L2 since the last
> > > > > > > > > > > > >         Linux Media Summit. This includes a brief overview of technical
> > > > > > > > > > > > >         developments, and a summary of the efforts to engage with vendors.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 9:45-10:45: V4L2 Stateless Video Encoding uAPI Progress Update
> > > > > > > > > > > > >         Presenter: Paul Kocialkowski
> > > > > > > > > > > > >         Description: An update on the ongonig work to support stateless codecs in V4L2.
> > > > > > > > > > > > >         Some of the remaining open topics will be presented and discussed.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 10:45-11:00: break
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 11:00-11:30: Vulkan Video Codecs
> > > > > > > > > > > > >         Presenter: Nicolas Dufresne
> > > > > > > > > > > > >         Description: Vulkan video codecs: what are the viable options for Linux Media
> > > > > > > > > > > > >         and what is in preparation outside of our subsystem. The second aspect is
> > > > > > > > > > > > >         informative as these discussions don't seem to lean toward our subsystem as the
> > > > > > > > > > > > >         foundation. But I think it's rather useful for everyone to understand why and
> > > > > > > > > > > > >         what is included.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 11:30-12:00: Protected Video playback on i.MX8MQ
> > > > > > > > > > > > >         Presenter: Rouven Czerwinski
> > > > > > > > > > > > >         Description: Introduction to protected video playback
> > > > > > > > > > > > >         on i.MX8MQ and missing bits for linux-media & protected heap interoperability.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 12:00-13:30: Lunch
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 13:30-14:00: HDCP support for HDMI receivers
> > > > > > > > > > > > >         Presenter: Hans Verkuil
> > > > > > > > > > > > >         Description: I have been working on adding HDCP support for HDMI receivers.
> > > > > > > > > > > > >         Specifically the HDCP negotiation between sources and sinks.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 14:00-14:30: AI patches
> > > > > > > > > > > > >         Presenter: Sakari Ailus
> > > > > > > > > > > > >         Description: What is our policy w.r.t. AI generated patches?
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 14:30-15:00 Overview of Media CI: where do pipelines run?
> > > > > > > > > > > > >         Presenter: Ricardo Ribalda
> > > > > > > > > > > > >         Description: How are jobs in pipelines assigned? How does the infrastructure
> > > > > > > > > > > > >         for Media CI work? Are there things that can be tweaked to make it more
> > > > > > > > > > > > >         reliable?
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 15:00-15:15: Break
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 15:15-16:15: Discussion of the media subsystem development process
> > > > > > > > > > > > >         Presenter: Hans Verkuil
> > > > > > > > > > > > >         Description: Review of the multi-committer model: current status and next steps.
> > > > > > > > > > > > >         Are there any bottlenecks, any ideas for improvements, w.r.t. the development process?
> > > > > > > > > > > > > 
> > > > > > > > > > > > > As you can see, there is still some available time for other topics.
> > > 
> > > --
> > > Regards,
> > > 
> > > Laurent Pinchart
> > 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* [PATCH] media: i2c: isl7998x: inline i2c_check_functionality check
From: Thorsten Blum @ 2026-04-28 16:57 UTC (permalink / raw)
  To: Michael Tretter, Pengutronix Kernel Team, Mauro Carvalho Chehab
  Cc: Thorsten Blum, linux-media, linux-kernel

Inline the i2c_check_functionality() check, since the function returns a
boolean status rather than an error code.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/media/i2c/isl7998x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c
index 5ffd53e005ee..96702c5eaa35 100644
--- a/drivers/media/i2c/isl7998x.c
+++ b/drivers/media/i2c/isl7998x.c
@@ -1460,8 +1460,7 @@ static int isl7998x_probe(struct i2c_client *client)
 	int nr_inputs;
 	int ret;
 
-	ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA);
-	if (!ret) {
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
 		dev_warn(&adapter->dev,
 			 "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
 		return -EIO;

^ permalink raw reply related

* Re: [PATCH v4 12/15] net: ipa: Switch to generic PAS TZ APIs
From: Alex Elder @ 2026-04-28 16:54 UTC (permalink / raw)
  To: Sumit Garg, andersson, konradybcio
  Cc: linux-arm-msm, devicetree, dri-devel, freedreno, linux-media,
	netdev, linux-wireless, ath12k, linux-remoteproc, robh, krzk+dt,
	conor+dt, robin.clark, sean, akhilpo, lumag, abhinav.kumar,
	jesszhan0024, marijn.suijten, airlied, simona, vikash.garodia,
	dikshita.agarwal, bod, mchehab, elder, andrew+netdev, davem,
	edumazet, kuba, pabeni, jjohnson, mathieu.poirier,
	trilokkumar.soni, mukesh.ojha, pavan.kondeti, jorge.ramirez,
	tonyh, vignesh.viswanathan, srinivas.kandagatla, amirreza.zarrabi,
	jens.wiklander, op-tee, apurupa, skare, linux-kernel, Sumit Garg
In-Reply-To: <20260427095603.1157963-13-sumit.garg@kernel.org>

On 4/27/26 4:56 AM, Sumit Garg wrote:
> From: Sumit Garg <sumit.garg@oss.qualcomm.com>
> 
> Switch ipa client driver over to generic PAS TZ APIs. Generic PAS TZ
> service allows to support multiple TZ implementation backends like QTEE
> based SCM PAS service, OP-TEE based PAS service and any further future TZ
> backend service.
> 
> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

Looks good to me.

Reviewed-by: Alex Elder <elder@riscstar.com>

> ---
>   drivers/net/ipa/Kconfig    |  2 +-
>   drivers/net/ipa/ipa_main.c | 13 ++++++++-----
>   2 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ipa/Kconfig b/drivers/net/ipa/Kconfig
> index 01d219d3760c..a9aff1b7977d 100644
> --- a/drivers/net/ipa/Kconfig
> +++ b/drivers/net/ipa/Kconfig
> @@ -6,7 +6,7 @@ config QCOM_IPA
>   	depends on QCOM_RPROC_COMMON || (QCOM_RPROC_COMMON=n && COMPILE_TEST)
>   	depends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n
>   	select QCOM_MDT_LOADER
> -	select QCOM_SCM
> +	select QCOM_PAS
>   	select QCOM_QMI_HELPERS
>   	help
>   	  Choose Y or M here to include support for the Qualcomm
> diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
> index 788dd99af2a4..3cd9e44680e9 100644
> --- a/drivers/net/ipa/ipa_main.c
> +++ b/drivers/net/ipa/ipa_main.c
> @@ -14,7 +14,7 @@
>   #include <linux/pm_runtime.h>
>   #include <linux/types.h>
>   
> -#include <linux/firmware/qcom/qcom_scm.h>
> +#include <linux/firmware/qcom/qcom_pas.h>
>   #include <linux/soc/qcom/mdt_loader.h>
>   
>   #include "ipa.h"
> @@ -624,10 +624,13 @@ static int ipa_firmware_load(struct device *dev)
>   	}
>   
>   	ret = qcom_mdt_load(dev, fw, path, IPA_PAS_ID, virt, phys, size, NULL);
> -	if (ret)
> +	if (ret) {
>   		dev_err(dev, "error %d loading \"%s\"\n", ret, path);
> -	else if ((ret = qcom_scm_pas_auth_and_reset(IPA_PAS_ID)))
> -		dev_err(dev, "error %d authenticating \"%s\"\n", ret, path);
> +	} else {
> +		ret = qcom_pas_auth_and_reset(IPA_PAS_ID);
> +		if (ret)
> +			dev_err(dev, "error %d authenticating \"%s\"\n", ret, path);
> +	}
>   
>   	memunmap(virt);
>   out_release_firmware:
> @@ -758,7 +761,7 @@ static enum ipa_firmware_loader ipa_firmware_loader(struct device *dev)
>   		return IPA_LOADER_INVALID;
>   out_self:
>   	/* We need Trust Zone to load firmware; make sure it's available */
> -	if (qcom_scm_is_available())
> +	if (qcom_pas_is_available())
>   		return IPA_LOADER_SELF;
>   
>   	return IPA_LOADER_DEFER;


^ permalink raw reply

* Re: [PATCH] staging: tegra-video: Fix function argument alignment
From: Dan Carpenter @ 2026-04-28 16:50 UTC (permalink / raw)
  To: Mhanna112-code
  Cc: linux-staging, linux-media, linux-tegra, linux-kernel,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli, mchehab,
	gregkh
In-Reply-To: <20260428154022.6997-1-marchanna111@gmail.com>

On Tue, Apr 28, 2026 at 10:40:22AM -0500, Mhanna112-code wrote:
                                          ^^^^^^^^^^^^^^
Your from header needs to be fixed.

> Separate long function calls into multiple lines to comply with kernel formatting style.
> 
> This fixes the following checkpatch warnings:
> 
> CHECK: Alignment should match open parenthesis
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This isn't what the patch does.

> 
> Signed-off-by: Marc Hanna <marchanna111@gmail.com>

regards,
dan carpenter


^ permalink raw reply

* [PATCH] staging: tegra-video: replace bit shifts with BIT() macro
From: Mhanna112-code @ 2026-04-28 16:33 UTC (permalink / raw)
  To: linux-staging
  Cc: thierry.reding, jonathanh, skomatineni, luca.ceresoli, mchehab,
	gregkh, linux-media, linux-tegra, linux-kernel, Mhanna112-code

Replace manual bit shifts with the BIT() macro to follow kernel
coding style and improve readability.

Fixes the following checkpatch warning:

CHECK: Prefer using the BIT macro

Signed-off-by: Marc Hanna <marchanna111@gmail.com>
---
 drivers/staging/media/tegra-video/tegra20.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/staging/media/tegra-video/tegra20.c
index eb1fc5b7e2cd..f3edca909684 100644
--- a/drivers/staging/media/tegra-video/tegra20.c
+++ b/drivers/staging/media/tegra-video/tegra20.c
@@ -177,15 +177,15 @@ enum tegra_vi_out {
 #define       CSI_SKIP_PACKET_THRESHOLD(n)		(((n) & 0xff) << 16)
 #define TEGRA_CSI_PIXEL_STREAM_CONTROL0(n)		(0x0018 + (n) * 0x2c)
 #define       CSI_PP_PAD_FRAME_PAD0S			(0 << 28)
-#define       CSI_PP_PAD_FRAME_PAD1S			(1 << 28)
+#define       CSI_PP_PAD_FRAME_PAD1S			BIT(28)
 #define       CSI_PP_PAD_FRAME_NOPAD			(2 << 28)
 #define       CSI_PP_HEADER_EC_ENABLE			BIT(27)
 #define       CSI_PP_PAD_SHORT_LINE_PAD0S		(0 << 24)
-#define       CSI_PP_PAD_SHORT_LINE_PAD1S		(1 << 24)
+#define       CSI_PP_PAD_SHORT_LINE_PAD1S		BIT(24)
 #define       CSI_PP_PAD_SHORT_LINE_NOPAD		(2 << 24)
 #define       CSI_PP_EMBEDDED_DATA_EMBEDDED		BIT(20)
 #define       CSI_PP_OUTPUT_FORMAT_ARBITRARY		(0 << 16)
-#define       CSI_PP_OUTPUT_FORMAT_PIXEL		(1 << 16)
+#define       CSI_PP_OUTPUT_FORMAT_PIXEL		BIT(16)
 #define       CSI_PP_OUTPUT_FORMAT_PIXEL_REP		(2 << 16)
 #define       CSI_PP_OUTPUT_FORMAT_STORE		(3 << 16)
 #define       CSI_PP_VIRTUAL_CHANNEL_ID(n)		(((n) - 1) << 14)
-- 
2.43.0


^ permalink raw reply related

* [PATCH] dept: update documentation function names to match implementation
From: Yunseong Kim @ 2026-04-28 16:26 UTC (permalink / raw)
  To: bagasdotme
  Cc: 2407018371, Dai.Ngo, Liam.Howlett, a.hindborg, ada.coupriediaz,
	adilger.kernel, akpm, alex.gaynor, alexander.shishkin, aliceryhl,
	amir73il, andi.shyti, andrii, anna, arnd, ast, baolin.wang,
	bigeasy, bjorn3_gh, boqun.feng, bp, brauner, broonie, bsegall,
	byungchul, catalin.marinas, chenhuacai, chris.p.wilson,
	christian.koenig, chuck.lever, cl, clrkwllms, corbet, da.gomez,
	dakr, damien.lemoal, dan.j.williams, daniel.vetter, dave.hansen,
	david, dennis, dietmar.eggemann, djwong, dri-devel, duyuyang,
	dwmw, francesco, frederic, gary, geert+renesas, geert, gregkh,
	guoweikang.kernel, gustavo, gwan-gyeong.mun, hamohammed.sa,
	hannes, harry.yoo, hch, her0gyugyu, hpa, jack, jglisse,
	jiangshanlai, jlayton, joel.granados, joel, joelagnelf,
	johannes.berg, josef, josh, jpoimboe, juri.lelli, kees,
	kernel-team, kernel_team, kevin.brodsky, kristina.martsenko,
	lillian, linaro-mm-sig, link, linux-arch, linux-arm-kernel,
	linux-block, linux-doc, linux-ext4, linux-fsdevel, linux-i2c,
	linux-ide, linux-kernel, linux-media, linux-mm, linux-modules,
	linux-nfs, linux-rt-devel, linux, longman, lorenzo.stoakes,
	lossin, luto, mark.rutland, masahiroy, mathieu.desnoyers,
	matthew.brost, max.byungchul.park, mcgrof, melissa.srw, mgorman,
	mhocko, miguel.ojeda.sandonis, minchan, mingo, mjguzik,
	neeraj.upadhyay, neil, neilb, netdev, ngupta, ojeda, okorniev,
	oleg, paulmck, penberg, peterz, petr.pavlu, qiang.zhang, rcu,
	richard.weiyang, rientjes, rodrigosiqueiramelo, rostedt, rppt,
	rust-for-linux, samitolvanen, sashal, shakeel.butt, sj,
	sumit.semwal, surenb, tglx, thomas.weissschuh, tim.c.chen, tj,
	tmgross, tom, torvalds, trondmy, tytso, urezki, usamaarif642,
	vbabka, vdavydov.dev, vincent.guittot, vschneid, wangfushuai,
	wangkefeng.wang, will, willy, wsa+renesas, x86, yeoreum.yun, ysk,
	yunseong.kim, yuzhao, ziy, Yunseong Kim
In-Reply-To: <aTN38kJjBftxnjm9@archie.me>

Synchronize function names in the documentation with the actual
implementation to fix naming inconsistencies.

Signed-off-by: Yunseong Kim <yunseong.kim@est.tech>
---
 Documentation/dev-tools/dept.rst     | 2 +-
 Documentation/dev-tools/dept_api.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/dev-tools/dept.rst b/Documentation/dev-tools/dept.rst
index 333166464543..31b2fe629fab 100644
--- a/Documentation/dev-tools/dept.rst
+++ b/Documentation/dev-tools/dept.rst
@@ -97,7 +97,7 @@ No.  What about the following?
 
 			   mutex_lock A
    mutex_lock A <- DEADLOCK
-			   wait_for_complete B <- DEADLOCK
+			   wait_for_completion B <- DEADLOCK
    complete B
 			   mutex_unlock A
    mutex_unlock A
diff --git a/Documentation/dev-tools/dept_api.rst b/Documentation/dev-tools/dept_api.rst
index 409116a62849..74e7b1424ad5 100644
--- a/Documentation/dev-tools/dept_api.rst
+++ b/Documentation/dev-tools/dept_api.rst
@@ -113,7 +113,7 @@ Do not use these APIs directly.  The raw APIs of dept are:
    dept_stage_wait(map, key, ip, wait_func, time);
    dept_request_event_wait_commit();
    dept_clean_stage();
-   dept_stage_event(task, ip);
+   dept_ttwu_stage_wait(task, ip);
    dept_ecxt_enter(map, evt_flags, ip, ecxt_func, evt_func, sub_local);
    dept_ecxt_holding(map, evt_flags);
    dept_request_event(map, ext_wgen);
-- 
2.53.0


^ permalink raw reply related

* [PATCH] staging: tegra-video: Fix function argument alignment
From: Mhanna112-code @ 2026-04-28 15:40 UTC (permalink / raw)
  To: linux-staging
  Cc: linux-media, linux-tegra, linux-kernel, thierry.reding, jonathanh,
	skomatineni, luca.ceresoli, mchehab, gregkh, Mhanna112-code

Separate long function calls into multiple lines to comply with kernel formatting style.

This fixes the following checkpatch warnings:

CHECK: Alignment should match open parenthesis

Signed-off-by: Marc Hanna <marchanna111@gmail.com>
---
 drivers/staging/media/tegra-video/tegra20.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/staging/media/tegra-video/tegra20.c
index e513e6ccb776..eb1fc5b7e2cd 100644
--- a/drivers/staging/media/tegra-video/tegra20.c
+++ b/drivers/staging/media/tegra-video/tegra20.c
@@ -552,7 +552,8 @@ static void tegra20_channel_vi_buffer_setup(struct tegra_vi_channel *chan,
 	case V4L2_PIX_FMT_YUYV:
 	case V4L2_PIX_FMT_YVYU:
 		tegra20_vi_write(chan, TEGRA_VI_VB0_BASE_ADDRESS(TEGRA_VI_OUT_1),  base);
-		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_1), base + chan->start_offset);
+		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_1),
+				 base + chan->start_offset);
 		break;
 	/* RAW8 */
 	case V4L2_PIX_FMT_SRGGB8:
@@ -565,7 +566,8 @@ static void tegra20_channel_vi_buffer_setup(struct tegra_vi_channel *chan,
 	case V4L2_PIX_FMT_SGBRG10:
 	case V4L2_PIX_FMT_SBGGR10:
 		tegra20_vi_write(chan, TEGRA_VI_VB0_BASE_ADDRESS(TEGRA_VI_OUT_2),  base);
-		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_2), base + chan->start_offset);
+		tegra20_vi_write(chan, TEGRA_VI_VB0_START_ADDRESS(TEGRA_VI_OUT_2),
+				 base + chan->start_offset);
 		break;
 	}
 }
-- 
2.43.0


^ permalink raw reply related

* [PATCH RESEND] media: pci: dm1105: Free allocated workqueue
From: Krzysztof Kozlowski @ 2026-04-28 14:50 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Igor M. Liplianin, linux-media,
	linux-kernel
  Cc: Krzysztof Kozlowski, stable

Destroy allocated workqueue in remove() callback to free its resources,
thus fixing memory leak.

Fixes: 519a4bdcf822 ("V4L/DVB (11984): Add support for yet another SDMC DM1105 based DVB-S card.")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/media/pci/dm1105/dm1105.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c
index bbd24769ae56..e915d9a3f785 100644
--- a/drivers/media/pci/dm1105/dm1105.c
+++ b/drivers/media/pci/dm1105/dm1105.c
@@ -1194,6 +1194,7 @@ static void dm1105_remove(struct pci_dev *pdev)
 
 	dm1105_hw_exit(dev);
 	free_irq(pdev->irq, dev);
+	destroy_workqueue(dev->wq);
 	pci_iounmap(pdev, dev->io_mem);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-- 
2.51.0


^ permalink raw reply related

* Re: [PATCH] media: verisilicon: Fix format enumeration when post-processor is mandatory
From: Nicolas Dufresne @ 2026-04-28 14:30 UTC (permalink / raw)
  To: Benjamin Gaignard, p.zabel, mchehab, hverkuil
  Cc: linux-media, linux-rockchip, linux-kernel, kernel
In-Reply-To: <20260428083723.54314-1-benjamin.gaignard@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

Le mardi 28 avril 2026 à 10:37 +0200, Benjamin Gaignard a écrit :
> When a post-processor pixel format is mandatory (i.e. when an AV1
> bitstream use film grain feature) the driver must only enumerate
> post-processed format.
> Use the context format to know what is suppose to be enumerated.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> Fixes: 80c7373a456e ("media: verisilicon: Conditionally ignore native formats")

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  drivers/media/platform/verisilicon/hantro_v4l2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> index fcf3bd9bcda2..f538d4562744 100644
> --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> @@ -242,7 +242,7 @@ static int vidioc_enum_fmt(struct file *file, void *priv,
>  	 */
>  	skip_mode_none = capture == ctx->is_encoder;
>  
> -	formats = hantro_get_formats(ctx, &num_fmts, HANTRO_AUTO_POSTPROC);
> +	formats = hantro_get_formats(ctx, &num_fmts, ctx->need_postproc);
>  	for (i = 0; i < num_fmts; i++) {
>  		bool mode_none = formats[i].codec_mode == HANTRO_MODE_NONE;
>  		fmt = &formats[i];

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* Re: [PATCH 0/6] media: Fix new smatch warnings
From: Ricardo Ribalda @ 2026-04-28 13:58 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mauro Carvalho Chehab, Laurent Pinchart, Sakari Ailus,
	Hans Verkuil, Nas Chung, Jackson Lee, Bingbu Cao, Tianshu Qiu,
	Greg Kroah-Hartman, Keke Li, linux-media, linux-kernel,
	linux-staging
In-Reply-To: <afC7qXCCkTTOS7jr@stanley.mountain>

Hi Dan

On Tue, 28 Apr 2026 at 15:52, Dan Carpenter <error27@gmail.com> wrote:
>
> On Tue, Apr 28, 2026 at 12:41:06PM +0000, Ricardo Ribalda wrote:
> > Current version of smatch triggers some warnings for the media tree.
> > Most of them are inoffensive, but we would like to have zero smatch
> > warnings.
> >
> > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> > drivers/media/v4l2-core/v4l2-dev.c:1036 __video_register_device() error: buffer overflow 'video_devices' 256 <= 288
> > drivers/media/v4l2-core/v4l2-dev.c:1043 __video_register_device() error: buffer overflow 'video_devices' 256 <= 288
> > drivers/media/v4l2-core/v4l2-dev.c:1101 __video_register_device() error: buffer overflow 'video_devices' 256 <= 288
> > drivers/media/platform/chips-media/wave5/wave5-vpuapi.c:588 wave5_vpu_dec_get_output_info() error: buffer overflow 'inst->frame_buf' 64 <= 127
> > drivers/staging/media/ipu3/ipu3-css-params.c:1792 imgu_css_cfg_acc_stripe() warn: 'acc->stripe.bds_out_stripes[0]->width - 2 * f' 4294967168 can't fit into 65535 'acc->stripe.bds_out_stripes[1]->offset'
> > drivers/media/i2c/adv7604.c:3672 adv76xx_probe() error: buffer overflow 'state->pads' 7 <= 4294967294
> > drivers/media/i2c/adv7604.c:3673 adv76xx_probe() error: buffer overflow 'state->pads' 7 <= u32max
> > drivers/media/i2c/mt9p031.c:799 mt9p031_s_ctrl() warn: assigning (-1952) to unsigned variable 'data'
> >
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
>
> I'm re-writing a bunch of core stuff right now...  Feel free to
> complain about false positives.  I'm going to re-write the buffer
> overflow warning in the next couple weeks.

The only one that deserves a complain is this one:
https://lore.kernel.org/linux-media/CANiDSCtm4Nh4Ub4rbEBvpjV8GXT9VQ5eFXZTHn=Wy=0RpR=3JA@mail.gmail.com/T/#m650723c33ec0318d8f32f1a6cc74c74a952ae11a

There are other false positives like this one:
https://lore.kernel.org/linux-media/CANiDSCtm4Nh4Ub4rbEBvpjV8GXT9VQ5eFXZTHn=Wy=0RpR=3JA@mail.gmail.com/T/#md58851baa54c511f57b05a4dcf3aecf0ffb1b1fa
But I think the extra check makes the code more robust.

Thanks for your tool :)

>
> regards,
> dan carpenter



-- 
Ricardo Ribalda

^ permalink raw reply

* Re: [PATCH 0/6] media: Fix new smatch warnings
From: Dan Carpenter @ 2026-04-28 13:52 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Mauro Carvalho Chehab, Laurent Pinchart, Sakari Ailus,
	Hans Verkuil, Nas Chung, Jackson Lee, Bingbu Cao, Tianshu Qiu,
	Greg Kroah-Hartman, Keke Li, linux-media, linux-kernel,
	linux-staging
In-Reply-To: <20260428-smatch-7-1-v1-0-46890dffb611@chromium.org>

On Tue, Apr 28, 2026 at 12:41:06PM +0000, Ricardo Ribalda wrote:
> Current version of smatch triggers some warnings for the media tree.
> Most of them are inoffensive, but we would like to have zero smatch
> warnings.
> 
> drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> drivers/media/v4l2-core/v4l2-dev.c:1036 __video_register_device() error: buffer overflow 'video_devices' 256 <= 288
> drivers/media/v4l2-core/v4l2-dev.c:1043 __video_register_device() error: buffer overflow 'video_devices' 256 <= 288
> drivers/media/v4l2-core/v4l2-dev.c:1101 __video_register_device() error: buffer overflow 'video_devices' 256 <= 288
> drivers/media/platform/chips-media/wave5/wave5-vpuapi.c:588 wave5_vpu_dec_get_output_info() error: buffer overflow 'inst->frame_buf' 64 <= 127
> drivers/staging/media/ipu3/ipu3-css-params.c:1792 imgu_css_cfg_acc_stripe() warn: 'acc->stripe.bds_out_stripes[0]->width - 2 * f' 4294967168 can't fit into 65535 'acc->stripe.bds_out_stripes[1]->offset'
> drivers/media/i2c/adv7604.c:3672 adv76xx_probe() error: buffer overflow 'state->pads' 7 <= 4294967294
> drivers/media/i2c/adv7604.c:3673 adv76xx_probe() error: buffer overflow 'state->pads' 7 <= u32max
> drivers/media/i2c/mt9p031.c:799 mt9p031_s_ctrl() warn: assigning (-1952) to unsigned variable 'data'
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

I'm re-writing a bunch of core stuff right now...  Feel free to
complain about false positives.  I'm going to re-write the buffer
overflow warning in the next couple weeks.

regards,
dan carpenter

^ permalink raw reply

* Re: [PATCH 6/6] media: amlogic-c3: Add validations for ae and awb config
From: Ricardo Ribalda @ 2026-04-28 13:49 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil, Nas Chung,
	Jackson Lee, Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman, Keke Li,
	linux-media, linux-kernel, linux-staging, Jacopo Mondi
In-Reply-To: <20260428132649.GD120836@killaraus.ideasonboard.com>

On Tue, 28 Apr 2026 at 15:26, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> On Tue, Apr 28, 2026 at 03:14:21PM +0200, Ricardo Ribalda wrote:
> > On Tue, 28 Apr 2026 at 15:10, Laurent Pinchart wrote:
> > > On Tue, Apr 28, 2026 at 12:41:12PM +0000, Ricardo Ribalda wrote:
> > > > Avoid invalid memory access if the zones_num is bigger than
> > > > zone_weight.
> > > >
> > > > This patch fixes the following smatch errors:
> > > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> > > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> > > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> > > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> > > >
> > > > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > > > ---
> > > >  drivers/media/platform/amlogic/c3/isp/c3-isp-params.c | 4 ++++
> > > >  1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c
> > > > index 6f9ca7a7dd88..42d780f684d1 100644
> > > > --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c
> > > > +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c
> > > > @@ -104,6 +104,8 @@ static void c3_isp_params_awb_wt(struct c3_isp_device *isp,
> > > >       c3_isp_write(isp, ISP_AWB_BLK_WT_ADDR, 0);
> > > >
> > > >       zones_num = cfg->horiz_zones_num * cfg->vert_zones_num;
> > > > +     if (WARN_ON(zones_num > C3_ISP_AWB_MAX_ZONES))
> > >
> > > This is triggerable by userspace, it shouldn't result in a WARN_ON().
> > > Ideally the horiz_zones_num and vert_zones_num should be validated at
> > > buf prepare time, and an error should be returned to userspace. That
> > > will likely not fix your smatch issue though, I don't think it will be
> > > able to understand that the values have been validated.
> >
> > Based on the warnings from the other drivers I also suspect that if
> > you have validated the data somewhere else smatch will understand it.
> >
> > Even if you add a validate function I would suggest to keep the
> > WARN_ON(), ideally it should never trigger, and if it triggers it will
> > get a lot more attention to get it fixed.
>
> We could keep the WARN_ON() if we first validate the data, but the
> driver doesn't currently :-/ I expect there could be more similar
> issues.

Yep, I got that. I will let you or Jacopo figure out the best way to
implement the validation in buf_prepare. If you do not have time to
implement it now I will just remove the WARN_ON in the interim... but
from my experience we only fix stuff if we get an oops.

Regards!

>
> > > Jacopo, do we need to add a validate function pointer to
> > > v4l2_isp_params_block_type_info ?
> > >
> > > > +             zones_num = C3_ISP_AWB_MAX_ZONES;
> > > >
> > > >       /* Need to write 8 weights at once */
> > > >       for (i = 0; i < zones_num / 8; i++) {
> > > > @@ -220,6 +222,8 @@ static void c3_isp_params_ae_wt(struct c3_isp_device *isp,
> > > >       c3_isp_write(isp, ISP_AE_BLK_WT_ADDR, 0);
> > > >
> > > >       zones_num = cfg->horiz_zones_num * cfg->vert_zones_num;
> > > > +     if (WARN_ON(zones_num > C3_ISP_AE_MAX_ZONES))
> > > > +             zones_num = C3_ISP_AE_MAX_ZONES;
> > > >
> > > >       /* Need to write 8 weights at once */
> > > >       for (i = 0; i < zones_num / 8; i++) {
>
> --
> Regards,
>
> Laurent Pinchart



-- 
Ricardo Ribalda

^ permalink raw reply

* Re: [PATCH 2/6] media: i2c: mt9p031: Rewrite a bitwise mask
From: Ricardo Ribalda @ 2026-04-28 13:37 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil, Nas Chung,
	Jackson Lee, Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman, Keke Li,
	linux-media, linux-kernel, linux-staging
In-Reply-To: <20260428132524.GC120836@killaraus.ideasonboard.com>

Hi Laurent

On Tue, 28 Apr 2026 at 15:25, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> On Tue, Apr 28, 2026 at 12:41:08PM +0000, Ricardo Ribalda wrote:
> > The current code makes smatch a bit uncomfortable:
> > drivers/media/i2c/mt9p031.c:799 mt9p031_s_ctrl() warn: assigning (-1952) to unsigned variable 'data'
> >
> > Probably because smatch is not clever enough (yet). Do a simple rewrite
> > to make sure that smatch understands what we are doing here.
> >
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> >  drivers/media/i2c/mt9p031.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> > index ea5d43d925ff..5c9dff030b4d 100644
> > --- a/drivers/media/i2c/mt9p031.c
> > +++ b/drivers/media/i2c/mt9p031.c
> > @@ -795,7 +795,7 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl)
> >                       ctrl->val &= ~1;
> >                       data = (1 << 6) | (ctrl->val >> 1);
> >               } else {
> > -                     ctrl->val &= ~7;
> > +                     ctrl->val -= ctrl->val % 8;
>
> This is less readable than it was :-/ Is there a way to avoid the
> warning while keeping the ~7 ? Maybe by assigning

I guess it is a matter of taste. I find my version more readable.
Also yours do not seem to convince smatch :P


drivers/media/i2c/mt9p031.c:800 mt9p031_s_ctrl() warn: '(data << 8) |
(1 << 6) | 32' 16775264 can't fit into 65535 'data'

ribalda@ribalda:~/work/linux$ git diff
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 5c9dff030b4d..f9f51d5060f6 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -795,8 +795,9 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl)
                        ctrl->val &= ~1;
                        data = (1 << 6) | (ctrl->val >> 1);
                } else {
-                       ctrl->val -= ctrl->val % 8;
-                       data = ((ctrl->val - 64) << 5) | (1 << 6) | 32;
+                       ctrl->val &= ~7;
+                       data = (ctrl->val - 64) >> 3;
+                       data = (data << 8) | (1 << 6) | 32;

>
>                         data = (ctrl->val - 64) >> 3;
>                         data = (data << 8) | (1 << 6) | 32;
>
> >                       data = ((ctrl->val - 64) << 5) | (1 << 6) | 32;
> >               }
> >
>
> --
> Regards,
>
> Laurent Pinchart



-- 
Ricardo Ribalda

^ permalink raw reply related

* Re: [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node
From: Bryan O'Donoghue @ 2026-04-28 13:36 UTC (permalink / raw)
  To: Erikas Bitovtas, Vikash Garodia, Dikshita Agarwal,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
	Michael Turquette, Stephen Boyd
  Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
	~postmarketos/upstreaming, phone-devel
In-Reply-To: <34627be5-75cc-469b-af23-f1f08ce29820@gmail.com>

On 28/04/2026 10:47, Erikas Bitovtas wrote:
> 
> 
> On 4/28/26 10:10 AM, Bryan O'Donoghue wrote:
>> On 27/04/2026 18:58, Erikas Bitovtas wrote:
>>> +            video-decoder {
>>> +                compatible = "venus-decoder";
>>> +                clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
>>> +                     <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
>>> +                clock-names = "core0", "core1";
>>> +                power-domains = <&gcc VENUS_CORE0_GDSC>,
>>> +                        <&gcc VENUS_CORE1_GDSC>;
>>> +                power-domain-names = "core0", "core1";
>>> +            };
>>> +
>>> +            video-encoder {
>>> +                compatible = "venus-encoder";
>>> +                clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
>>> +                     <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
>>> +                clock-names = "core0", "core1";
>>> +                power-domains = <&gcc VENUS_CORE0_GDSC>,
>>> +                        <&gcc VENUS_CORE1_GDSC>;
>>> +                power-domain-names = "core0", "core1";
>>> +            };
>>
>> So to be fair in this case you do have a reason to have an encoder and
>> decoder compatible here _but_ it should be the case that one one of the
>> sub-devices contains CORE0 related stuff and the other CORE1 related stuff.
>>
>> Because in that case the sub-devices actually represent individual
>> hardware settings.
>>
>> So listing power-domains and clocks for both cores in each node like
>> this militates against that.
>>
>> The other thing is to double check of the encoder and decoder are inter-
>> changable here i.e. can either core be encoder or decoder or is it fixed ?
>>
>> I believe on older generations - perhaps not on 8939 it is not
>> interchangable.
>>
> I found this in LA.BR.1.2.9.1_rb1.5:
> https://github.com/msm8916-mainline/linux-downstream/blob/b20608408caff817ec874f325127b07609fbaeb8/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L1589
> Only decoder bits are being set in bus configs. This suggests that the
> cores are not interchangeable.
> Then again, I never managed to get encoding working on MSM8939. Testing
> it with
> gst-launch-1.0 videotestsrc ! videoconvert ! v4l2vp8enc ! queue !
> v4l2vp8dec ! xvimagesink
> Fails with the following log: https://pastebin.com/nmZcLgPV
> And in dmesg it reports a firmware error:
> [  784.461031] qcom-venus 1d00000.video-codec: no valid instance(pkt
> session_id:dead, pkt:21001)
> [  784.461126] qcom-venus-decoder 1d00000.video-codec:video-decoder:
> dec: event session error 0
> [  784.461200] qcom-venus-encoder 1d00000.video-codec:video-encoder:
> enc: event session error 0
> [  784.468799] qcom-venus 1d00000.video-codec: SFR message from FW:
> QC_IMAGE_VERSION_STRING=VIDEO.VE.1.8-00099, Err_Fatal -
> Z:\b\venus\utils\src\vbuffer.c:1319:
> [  785.791641] qcom-venus 1d00000.video-codec: System error has
> occurred, recovery failed to init HFI
> [  787.018339] qcom-venus 1d00000.video-codec: System error has
> occurred, recovery failed to init HFI
> [  787.097253] qcom-venus 1d00000.video-codec: system error has occurred
> (recovered)
> This happens regardless of whether I enable the cores for encoding too
> or not. The same errors were happening on MSM8916 as well. So I can't
> tell if these cores are interchangeable just by testing.

Right so if you swap around the definition of which core is encoder and 
which decoder do you get the same or different result ?

i.e. is it because you are trying to get encoder running generally or 
because of the core you are doing it on ?

How about declaring both cores a decoder ?

---
bod

^ permalink raw reply

* Re: [PATCH 6/6] media: amlogic-c3: Add validations for ae and awb config
From: Laurent Pinchart @ 2026-04-28 13:26 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil, Nas Chung,
	Jackson Lee, Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman, Keke Li,
	linux-media, linux-kernel, linux-staging, Jacopo Mondi
In-Reply-To: <CANiDSCvaS-Jz9m5H2OHo2akD-o-sffsZyEw6_CrfUhD1BN+m2g@mail.gmail.com>

On Tue, Apr 28, 2026 at 03:14:21PM +0200, Ricardo Ribalda wrote:
> On Tue, 28 Apr 2026 at 15:10, Laurent Pinchart wrote:
> > On Tue, Apr 28, 2026 at 12:41:12PM +0000, Ricardo Ribalda wrote:
> > > Avoid invalid memory access if the zones_num is bigger than
> > > zone_weight.
> > >
> > > This patch fixes the following smatch errors:
> > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:111 c3_isp_params_awb_wt() error: buffer overflow 'cfg->zone_weight' 768 <= u32max
> > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> > > drivers/media/platform/amlogic/c3/isp/c3-isp-params.c:227 c3_isp_params_ae_wt() error: buffer overflow 'cfg->zone_weight' 255 <= u32max
> > >
> > > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > > ---
> > >  drivers/media/platform/amlogic/c3/isp/c3-isp-params.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c
> > > index 6f9ca7a7dd88..42d780f684d1 100644
> > > --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c
> > > +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c
> > > @@ -104,6 +104,8 @@ static void c3_isp_params_awb_wt(struct c3_isp_device *isp,
> > >       c3_isp_write(isp, ISP_AWB_BLK_WT_ADDR, 0);
> > >
> > >       zones_num = cfg->horiz_zones_num * cfg->vert_zones_num;
> > > +     if (WARN_ON(zones_num > C3_ISP_AWB_MAX_ZONES))
> >
> > This is triggerable by userspace, it shouldn't result in a WARN_ON().
> > Ideally the horiz_zones_num and vert_zones_num should be validated at
> > buf prepare time, and an error should be returned to userspace. That
> > will likely not fix your smatch issue though, I don't think it will be
> > able to understand that the values have been validated.
> 
> Based on the warnings from the other drivers I also suspect that if
> you have validated the data somewhere else smatch will understand it.
> 
> Even if you add a validate function I would suggest to keep the
> WARN_ON(), ideally it should never trigger, and if it triggers it will
> get a lot more attention to get it fixed.

We could keep the WARN_ON() if we first validate the data, but the
driver doesn't currently :-/ I expect there could be more similar
issues.

> > Jacopo, do we need to add a validate function pointer to
> > v4l2_isp_params_block_type_info ?
> >
> > > +             zones_num = C3_ISP_AWB_MAX_ZONES;
> > >
> > >       /* Need to write 8 weights at once */
> > >       for (i = 0; i < zones_num / 8; i++) {
> > > @@ -220,6 +222,8 @@ static void c3_isp_params_ae_wt(struct c3_isp_device *isp,
> > >       c3_isp_write(isp, ISP_AE_BLK_WT_ADDR, 0);
> > >
> > >       zones_num = cfg->horiz_zones_num * cfg->vert_zones_num;
> > > +     if (WARN_ON(zones_num > C3_ISP_AE_MAX_ZONES))
> > > +             zones_num = C3_ISP_AE_MAX_ZONES;
> > >
> > >       /* Need to write 8 weights at once */
> > >       for (i = 0; i < zones_num / 8; i++) {

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH 2/6] media: i2c: mt9p031: Rewrite a bitwise mask
From: Laurent Pinchart @ 2026-04-28 13:25 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil, Nas Chung,
	Jackson Lee, Bingbu Cao, Tianshu Qiu, Greg Kroah-Hartman, Keke Li,
	linux-media, linux-kernel, linux-staging
In-Reply-To: <20260428-smatch-7-1-v1-2-46890dffb611@chromium.org>

On Tue, Apr 28, 2026 at 12:41:08PM +0000, Ricardo Ribalda wrote:
> The current code makes smatch a bit uncomfortable:
> drivers/media/i2c/mt9p031.c:799 mt9p031_s_ctrl() warn: assigning (-1952) to unsigned variable 'data'
> 
> Probably because smatch is not clever enough (yet). Do a simple rewrite
> to make sure that smatch understands what we are doing here.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/i2c/mt9p031.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index ea5d43d925ff..5c9dff030b4d 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -795,7 +795,7 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl)
>  			ctrl->val &= ~1;
>  			data = (1 << 6) | (ctrl->val >> 1);
>  		} else {
> -			ctrl->val &= ~7;
> +			ctrl->val -= ctrl->val % 8;

This is less readable than it was :-/ Is there a way to avoid the
warning while keeping the ~7 ? Maybe by assigning

			data = (ctrl->val - 64) >> 3;
 			data = (data << 8) | (1 << 6) | 32;

>  			data = ((ctrl->val - 64) << 5) | (1 << 6) | 32;
>  		}
>  

-- 
Regards,

Laurent Pinchart

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox