55 files changed, 11471 insertions, 2282 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.h b/drivers/amvdec_ports/aml_vcodec_dec.h index f6a9db0..19923c0 100644 --- a/drivers/amvdec_ports/aml_vcodec_dec.h +++ b/drivers/amvdec_ports/aml_vcodec_dec.h @@ -34,21 +34,34 @@ #define AML_VDEC_IRQ_STATUS_DEC_SUCCESS 0x10000 #define V4L2_BUF_FLAG_LAST 0x00100000 +#define VDEC_GATHER_MEMORY_TYPE 0 +#define VDEC_SCATTER_MEMORY_TYPE 1 + #define AML_V4L2_SET_DECMODE (V4L2_CID_USER_AMLOGIC_BASE + 0) /** * struct vdec_fb - decoder frame buffer - * @base_y : Y plane memory info - * @base_c : C plane memory info + * @mem_type : gather or scatter memory. + * @num_planes : used number of the plane + * @mem[4] : array mem for used planes, + * mem[0]: Y, mem[1]: C/U, mem[2]: V + * @vf_fd : the file handle of video frame + * @vf_handle : video frame handle * @status : frame buffer status (vdec_fb_status) */ -struct vdec_fb { - unsigned long vf_handle; - struct aml_vcodec_mem base_y; - struct aml_vcodec_mem base_c; - unsigned int status; + +struct vdec_v4l2_buffer { + int mem_type; + int num_planes; + union { + struct aml_vcodec_mem mem[4]; + u32 vf_fd; + } m; + ulong vf_handle; + u32 status; }; + /** * struct aml_video_dec_buf - Private data related to each VB2 buffer. * @b: VB2 buffer @@ -69,10 +82,9 @@ struct aml_video_dec_buf { struct vb2_v4l2_buffer vb; struct list_head list; - struct vdec_fb frame_buffer; + struct vdec_v4l2_buffer frame_buffer; struct codec_mm_s *mem[2]; char mem_onwer[32]; - struct list_head node; bool used; bool ready_to_display; bool que_in_m2m; @@ -82,6 +94,14 @@ struct aml_video_dec_buf { bool error; }; +struct aml_vdec_pic_infos { + u32 visible_width; + u32 visible_height; + u32 coded_width; + u32 coded_height; + int dpb_size; +}; + extern const struct v4l2_ioctl_ops aml_vdec_ioctl_ops; extern const struct v4l2_m2m_ops aml_vdec_m2m_ops; @@ -108,5 +128,6 @@ void aml_thread_notify(struct aml_vcodec_ctx *ctx, int aml_thread_start(struct aml_vcodec_ctx *ctx, aml_thread_func func, enum aml_thread_type type, const char *thread_name); void aml_thread_stop(struct aml_vcodec_ctx *ctx); +void wait_vcodec_ending(struct aml_vcodec_ctx *ctx); #endif /* _AML_VCODEC_DEC_H_ */ |