1
2
3
4
5
6
7
8 #ifndef _MTK_VCODEC_DEC_H_
9 #define _MTK_VCODEC_DEC_H_
10
11 #include <media/videobuf2-core.h>
12 #include <media/videobuf2-v4l2.h>
13
14 #define VCODEC_CAPABILITY_4K_DISABLED 0x10
15 #define VCODEC_DEC_4K_CODED_WIDTH 4096U
16 #define VCODEC_DEC_4K_CODED_HEIGHT 2304U
17 #define MTK_VDEC_MAX_W 2048U
18 #define MTK_VDEC_MAX_H 1088U
19
20 #define MTK_VDEC_IRQ_STATUS_DEC_SUCCESS 0x10000
21
22
23
24
25
26
27
28 struct vdec_fb {
29 struct mtk_vcodec_mem base_y;
30 struct mtk_vcodec_mem base_c;
31 unsigned int status;
32 };
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 struct mtk_video_dec_buf {
50 struct vb2_v4l2_buffer vb;
51 struct list_head list;
52
53 bool used;
54 bool queued_in_vb2;
55 bool queued_in_v4l2;
56 bool lastframe;
57 bool error;
58 struct vdec_fb frame_buffer;
59 };
60
61 extern const struct v4l2_ioctl_ops mtk_vdec_ioctl_ops;
62 extern const struct v4l2_m2m_ops mtk_vdec_m2m_ops;
63
64
65
66
67
68
69
70
71 void mtk_vdec_unlock(struct mtk_vcodec_ctx *ctx);
72 void mtk_vdec_lock(struct mtk_vcodec_ctx *ctx);
73 int mtk_vcodec_dec_queue_init(void *priv, struct vb2_queue *src_vq,
74 struct vb2_queue *dst_vq);
75 void mtk_vcodec_dec_set_default_params(struct mtk_vcodec_ctx *ctx);
76 void mtk_vcodec_dec_release(struct mtk_vcodec_ctx *ctx);
77 int mtk_vcodec_dec_ctrls_setup(struct mtk_vcodec_ctx *ctx);
78
79
80 #endif