1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Contains the virtual decoder logic. The functions here control the
4  * tracing/TPG on a per-frame basis
5  */
6 
7 #ifndef _VISL_DEC_H_
8 #define _VISL_DEC_H_
9 
10 #include "visl.h"
11 
12 struct visl_fwht_run {
13 	const struct v4l2_ctrl_fwht_params *params;
14 };
15 
16 struct visl_mpeg2_run {
17 	const struct v4l2_ctrl_mpeg2_sequence *seq;
18 	const struct v4l2_ctrl_mpeg2_picture *pic;
19 	const struct v4l2_ctrl_mpeg2_quantisation *quant;
20 };
21 
22 struct visl_vp8_run {
23 	const struct v4l2_ctrl_vp8_frame *frame;
24 };
25 
26 struct visl_vp9_run {
27 	const struct v4l2_ctrl_vp9_frame *frame;
28 	const struct v4l2_ctrl_vp9_compressed_hdr *probs;
29 };
30 
31 struct visl_h264_run {
32 	const struct v4l2_ctrl_h264_sps *sps;
33 	const struct v4l2_ctrl_h264_pps *pps;
34 	const struct v4l2_ctrl_h264_scaling_matrix *sm;
35 	const struct v4l2_ctrl_h264_slice_params *spram;
36 	const struct v4l2_ctrl_h264_decode_params *dpram;
37 	const struct v4l2_ctrl_h264_pred_weights *pwht;
38 };
39 
40 struct visl_hevc_run {
41 	const struct v4l2_ctrl_hevc_sps *sps;
42 	const struct v4l2_ctrl_hevc_pps *pps;
43 	const struct v4l2_ctrl_hevc_slice_params *spram;
44 	const struct v4l2_ctrl_hevc_scaling_matrix *sm;
45 	const struct v4l2_ctrl_hevc_decode_params *dpram;
46 };
47 
48 struct visl_av1_run {
49 	const struct v4l2_ctrl_av1_sequence *seq;
50 	const struct v4l2_ctrl_av1_frame *frame;
51 	const struct v4l2_ctrl_av1_tile_group_entry *tge;
52 	const struct v4l2_ctrl_av1_film_grain *grain;
53 };
54 
55 struct visl_run {
56 	struct vb2_v4l2_buffer	*src;
57 	struct vb2_v4l2_buffer	*dst;
58 
59 	union {
60 		struct visl_fwht_run	fwht;
61 		struct visl_mpeg2_run	mpeg2;
62 		struct visl_vp8_run	vp8;
63 		struct visl_vp9_run	vp9;
64 		struct visl_h264_run	h264;
65 		struct visl_hevc_run	hevc;
66 		struct visl_av1_run	av1;
67 	};
68 };
69 
70 int visl_dec_start(struct visl_ctx *ctx);
71 int visl_dec_stop(struct visl_ctx *ctx);
72 int visl_job_ready(void *priv);
73 void visl_device_run(void *priv);
74 
75 #endif /* _VISL_DEC_H_ */
76