mtk_vcodec_enc.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2016 MediaTek Inc.
  3. * Author: PC Chen <pc.chen@mediatek.com>
  4. * Tiffany Lin <tiffany.lin@mediatek.com>
  5. *
  6. * This program is free software; you can redistribute it and/or 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 _MTK_VCODEC_ENC_H_
  16. #define _MTK_VCODEC_ENC_H_
  17. #include <media/videobuf2-core.h>
  18. #include <media/videobuf2-v4l2.h>
  19. #define MTK_VENC_IRQ_STATUS_SPS 0x1
  20. #define MTK_VENC_IRQ_STATUS_PPS 0x2
  21. #define MTK_VENC_IRQ_STATUS_FRM 0x4
  22. #define MTK_VENC_IRQ_STATUS_DRAM 0x8
  23. #define MTK_VENC_IRQ_STATUS_PAUSE 0x10
  24. #define MTK_VENC_IRQ_STATUS_SWITCH 0x20
  25. #define MTK_VENC_IRQ_STATUS_OFFSET 0x05C
  26. #define MTK_VENC_IRQ_ACK_OFFSET 0x060
  27. /**
  28. * struct mtk_video_enc_buf - Private data related to each VB2 buffer.
  29. * @vb: Pointer to related VB2 buffer.
  30. * @list: list that buffer link to
  31. * @param_change: Types of encode parameter change before encoding this
  32. * buffer
  33. * @enc_params: Encode parameters changed before encode this buffer
  34. */
  35. struct mtk_video_enc_buf {
  36. struct vb2_v4l2_buffer vb;
  37. struct list_head list;
  38. u32 param_change;
  39. struct mtk_enc_params enc_params;
  40. };
  41. extern const struct v4l2_ioctl_ops mtk_venc_ioctl_ops;
  42. extern const struct v4l2_m2m_ops mtk_venc_m2m_ops;
  43. int mtk_venc_unlock(struct mtk_vcodec_ctx *ctx);
  44. int mtk_venc_lock(struct mtk_vcodec_ctx *ctx);
  45. int mtk_vcodec_enc_queue_init(void *priv, struct vb2_queue *src_vq,
  46. struct vb2_queue *dst_vq);
  47. void mtk_vcodec_enc_release(struct mtk_vcodec_ctx *ctx);
  48. int mtk_vcodec_enc_ctrls_setup(struct mtk_vcodec_ctx *ctx);
  49. void mtk_vcodec_enc_set_default_params(struct mtk_vcodec_ctx *ctx);
  50. #endif /* _MTK_VCODEC_ENC_H_ */