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_run {
49 	struct vb2_v4l2_buffer	*src;
50 	struct vb2_v4l2_buffer	*dst;
51 
52 	union {
53 		struct visl_fwht_run	fwht;
54 		struct visl_mpeg2_run	mpeg2;
55 		struct visl_vp8_run	vp8;
56 		struct visl_vp9_run	vp9;
57 		struct visl_h264_run	h264;
58 		struct visl_hevc_run	hevc;
59 	};
60 };
61 
62 int visl_dec_start(struct visl_ctx *ctx);
63 int visl_dec_stop(struct visl_ctx *ctx);
64 int visl_job_ready(void *priv);
65 void visl_device_run(void *priv);
66 
67 #endif /* _VISL_DEC_H_ */
68