1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2016 MediaTek Inc.
4 * Author: PoChun Lin <pochun.lin@mediatek.com>
7 #ifndef _VENC_VPU_IF_H_
8 #define _VENC_VPU_IF_H_
10 #include "venc_drv_if.h"
13 * struct venc_vpu_inst - encoder VPU driver instance
14 * @wq_hd: wait queue used for vpu cmd trigger then wait vpu interrupt done
15 * @signaled: flag used for checking vpu interrupt done
16 * @failure: flag to show vpu cmd succeeds or not
17 * @state: enum venc_ipi_msg_enc_state
18 * @bs_size: bitstream size for skip frame case usage
19 * @is_key_frm: key frame flag
20 * @inst_addr: VPU instance addr
21 * @vsi: driver structure allocated by VPU side and shared to AP side for
22 * control and info share
23 * @id: the id of inter-processor interrupt
24 * @ctx: context for v4l2 layer integration
25 * @dev: device for v4l2 layer integration
27 struct venc_vpu_inst {
28 wait_queue_head_t wq_hd;
34 unsigned int inst_addr;
37 struct mtk_vcodec_enc_ctx *ctx;
40 int vpu_enc_init(struct venc_vpu_inst *vpu);
41 int vpu_enc_set_param(struct venc_vpu_inst *vpu,
42 enum venc_set_param_type id,
43 struct venc_enc_param *param);
44 int vpu_enc_encode(struct venc_vpu_inst *vpu, unsigned int bs_mode,
45 struct venc_frm_buf *frm_buf,
46 struct mtk_vcodec_mem *bs_buf,
47 struct venc_frame_info *frame_info);
48 int vpu_enc_deinit(struct venc_vpu_inst *vpu);