treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / media / platform / mtk-vcodec / vdec_vpu_if.h
blobf779b0676fbd15e617655696fb09fd571c36fe93
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (c) 2016 MediaTek Inc.
4 * Author: PC Chen <pc.chen@mediatek.com>
5 */
7 #ifndef _VDEC_VPU_IF_H_
8 #define _VDEC_VPU_IF_H_
10 #include "mtk_vpu.h"
12 /**
13 * struct vdec_vpu_inst - VPU instance for video codec
14 * @ipi_id : ipi id for each decoder
15 * @vsi : driver structure allocated by VPU side and shared to AP side
16 * for control and info share
17 * @failure : VPU execution result status, 0: success, others: fail
18 * @inst_addr : VPU decoder instance address
19 * @signaled : 1 - Host has received ack message from VPU, 0 - not received
20 * @ctx : context for v4l2 layer integration
21 * @dev : platform device of VPU
22 * @wq : wait queue to wait VPU message ack
23 * @handler : ipi handler for each decoder
25 struct vdec_vpu_inst {
26 enum ipi_id id;
27 void *vsi;
28 int32_t failure;
29 uint32_t inst_addr;
30 unsigned int signaled;
31 struct mtk_vcodec_ctx *ctx;
32 struct platform_device *dev;
33 wait_queue_head_t wq;
34 ipi_handler_t handler;
37 /**
38 * vpu_dec_init - init decoder instance and allocate required resource in VPU.
40 * @vpu: instance for vdec_vpu_inst
42 int vpu_dec_init(struct vdec_vpu_inst *vpu);
44 /**
45 * vpu_dec_start - start decoding, basically the function will be invoked once
46 * every frame.
48 * @vpu : instance for vdec_vpu_inst
49 * @data: meta data to pass bitstream info to VPU decoder
50 * @len : meta data length
52 int vpu_dec_start(struct vdec_vpu_inst *vpu, uint32_t *data, unsigned int len);
54 /**
55 * vpu_dec_end - end decoding, basically the function will be invoked once
56 * when HW decoding done interrupt received successfully. The
57 * decoder in VPU will continue to do reference frame management
58 * and check if there is a new decoded frame available to display.
60 * @vpu : instance for vdec_vpu_inst
62 int vpu_dec_end(struct vdec_vpu_inst *vpu);
64 /**
65 * vpu_dec_deinit - deinit decoder instance and resource freed in VPU.
67 * @vpu: instance for vdec_vpu_inst
69 int vpu_dec_deinit(struct vdec_vpu_inst *vpu);
71 /**
72 * vpu_dec_reset - reset decoder, use for flush decoder when end of stream or
73 * seek. Remainig non displayed frame will be pushed to display.
75 * @vpu: instance for vdec_vpu_inst
77 int vpu_dec_reset(struct vdec_vpu_inst *vpu);
79 #endif