venc_vpu_if.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2016 MediaTek Inc.
  3. * Author: PoChun Lin <pochun.lin@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  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.
  14. */
  15. #ifndef _VENC_VPU_IF_H_
  16. #define _VENC_VPU_IF_H_
  17. #include "mtk_vpu.h"
  18. #include "venc_drv_if.h"
  19. /*
  20. * struct venc_vpu_inst - encoder VPU driver instance
  21. * @wq_hd: wait queue used for vpu cmd trigger then wait vpu interrupt done
  22. * @signaled: flag used for checking vpu interrupt done
  23. * @failure: flag to show vpu cmd succeeds or not
  24. * @state: enum venc_ipi_msg_enc_state
  25. * @bs_size: bitstream size for skip frame case usage
  26. * @is_key_frm: key frame flag
  27. * @inst_addr: VPU instance addr
  28. * @vsi: driver structure allocated by VPU side and shared to AP side for
  29. * control and info share
  30. * @id: the id of inter-processor interrupt
  31. * @ctx: context for v4l2 layer integration
  32. * @dev: device for v4l2 layer integration
  33. */
  34. struct venc_vpu_inst {
  35. wait_queue_head_t wq_hd;
  36. int signaled;
  37. int failure;
  38. int state;
  39. int bs_size;
  40. int is_key_frm;
  41. unsigned int inst_addr;
  42. void *vsi;
  43. enum ipi_id id;
  44. struct mtk_vcodec_ctx *ctx;
  45. struct platform_device *dev;
  46. };
  47. int vpu_enc_init(struct venc_vpu_inst *vpu);
  48. int vpu_enc_set_param(struct venc_vpu_inst *vpu,
  49. enum venc_set_param_type id,
  50. struct venc_enc_param *param);
  51. int vpu_enc_encode(struct venc_vpu_inst *vpu, unsigned int bs_mode,
  52. struct venc_frm_buf *frm_buf,
  53. struct mtk_vcodec_mem *bs_buf,
  54. unsigned int *bs_size);
  55. int vpu_enc_deinit(struct venc_vpu_inst *vpu);
  56. #endif