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