x86/build: Don't add -maccumulate-outgoing-args w/o compiler support
[linux/fpc-iii.git] / drivers / media / platform / mtk-vcodec / mtk_vcodec_dec.h
blob362f5a85762eab88935907720e9913dceb16c0ad
1 /*
2 * Copyright (c) 2016 MediaTek Inc.
3 * Author: PC Chen <pc.chen@mediatek.com>
4 * Tiffany Lin <tiffany.lin@mediatek.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef _MTK_VCODEC_DEC_H_
17 #define _MTK_VCODEC_DEC_H_
19 #include <media/videobuf2-core.h>
20 #include <media/videobuf2-v4l2.h>
22 #define VCODEC_CAPABILITY_4K_DISABLED 0x10
23 #define VCODEC_DEC_4K_CODED_WIDTH 4096U
24 #define VCODEC_DEC_4K_CODED_HEIGHT 2304U
25 #define MTK_VDEC_MAX_W 2048U
26 #define MTK_VDEC_MAX_H 1088U
28 #define MTK_VDEC_IRQ_STATUS_DEC_SUCCESS 0x10000
30 /**
31 * struct vdec_fb - decoder frame buffer
32 * @base_y : Y plane memory info
33 * @base_c : C plane memory info
34 * @status : frame buffer status (vdec_fb_status)
36 struct vdec_fb {
37 struct mtk_vcodec_mem base_y;
38 struct mtk_vcodec_mem base_c;
39 unsigned int status;
42 /**
43 * struct mtk_video_dec_buf - Private data related to each VB2 buffer.
44 * @b: VB2 buffer
45 * @list: link list
46 * @used: Capture buffer contain decoded frame data and keep in
47 * codec data structure
48 * @ready_to_display: Capture buffer not display yet
49 * @queued_in_vb2: Capture buffer is queue in vb2
50 * @queued_in_v4l2: Capture buffer is in v4l2 driver, but not in vb2
51 * queue yet
52 * @lastframe: Intput buffer is last buffer - EOS
53 * @frame_buffer: Decode status, and buffer information of Capture buffer
55 * Note : These status information help us track and debug buffer state
57 struct mtk_video_dec_buf {
58 struct vb2_v4l2_buffer vb;
59 struct list_head list;
61 bool used;
62 bool ready_to_display;
63 bool queued_in_vb2;
64 bool queued_in_v4l2;
65 bool lastframe;
66 struct vdec_fb frame_buffer;
69 extern const struct v4l2_ioctl_ops mtk_vdec_ioctl_ops;
70 extern const struct v4l2_m2m_ops mtk_vdec_m2m_ops;
74 * mtk_vdec_lock/mtk_vdec_unlock are for ctx instance to
75 * get/release lock before/after access decoder hw.
76 * mtk_vdec_lock get decoder hw lock and set curr_ctx
77 * to ctx instance that get lock
79 void mtk_vdec_unlock(struct mtk_vcodec_ctx *ctx);
80 void mtk_vdec_lock(struct mtk_vcodec_ctx *ctx);
81 int mtk_vcodec_dec_queue_init(void *priv, struct vb2_queue *src_vq,
82 struct vb2_queue *dst_vq);
83 void mtk_vcodec_dec_set_default_params(struct mtk_vcodec_ctx *ctx);
84 void mtk_vcodec_dec_release(struct mtk_vcodec_ctx *ctx);
85 int mtk_vcodec_dec_ctrls_setup(struct mtk_vcodec_ctx *ctx);
88 #endif /* _MTK_VCODEC_DEC_H_ */