diff options
Diffstat (limited to 'drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h')
-rw-r--r-- | drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index 9fd56dee7fd1..3dd010cba23e 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -300,6 +300,40 @@ struct mtk_vcodec_ctx { }; +enum mtk_chip { + MTK_MT8173, + MTK_MT8183, +}; + +/** + * struct mtk_vcodec_enc_pdata - compatible data for each IC + * + * @chip: chip this encoder is compatible with + * + * @uses_ext: whether the encoder uses the extended firmware messaging format + * @has_lt_irq: whether the encoder uses the LT irq + * @min_birate: minimum supported encoding bitrate + * @max_bitrate: maximum supported encoding bitrate + * @capture_formats: array of supported capture formats + * @num_capture_formats: number of entries in capture_formats + * @output_formats: array of supported output formats + * @num_output_formats: number of entries in output_formats + */ +struct mtk_vcodec_enc_pdata { + enum mtk_chip chip; + + bool uses_ext; + bool has_lt_irq; + unsigned long min_bitrate; + unsigned long max_bitrate; + const struct mtk_video_fmt *capture_formats; + size_t num_capture_formats; + const struct mtk_video_fmt *output_formats; + size_t num_output_formats; +}; + +#define MTK_ENC_CTX_IS_EXT(ctx) ((ctx)->dev->venc_pdata->uses_ext) + /** * struct mtk_vcodec_dev - driver data * @v4l2_dev: V4L2 device to register video devices for. @@ -309,13 +343,13 @@ struct mtk_vcodec_ctx { * @m2m_dev_dec: m2m device for decoder * @m2m_dev_enc: m2m device for encoder. * @plat_dev: platform device - * @vpu_plat_dev: mtk vpu platform device * @ctx_list: list of struct mtk_vcodec_ctx * @irqlock: protect data access by irq handler and work thread * @curr_ctx: The context that is waiting for codec hardware * * @reg_base: Mapped address of MTK Vcodec registers. * + * @fw_handler: used to communicate with the firmware. * @id_counter: used to identify current opened instance * * @encode_workqueue: encode work queue @@ -344,11 +378,13 @@ struct mtk_vcodec_dev { struct v4l2_m2m_dev *m2m_dev_dec; struct v4l2_m2m_dev *m2m_dev_enc; struct platform_device *plat_dev; - struct platform_device *vpu_plat_dev; struct list_head ctx_list; spinlock_t irqlock; struct mtk_vcodec_ctx *curr_ctx; void __iomem *reg_base[NUM_MAX_VCODEC_REG_BASE]; + const struct mtk_vcodec_enc_pdata *venc_pdata; + + struct mtk_vcodec_fw *fw_handler; unsigned long id_counter; |