[V11,3/7] mtk-jpegenc: manage jpegenc multi-hardware

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Mon Jul 18 03:40:19 PDT 2022


Il 16/07/22 11:34, Irui Wang ha scritto:
> From: kyrie wu <kyrie.wu at mediatek.com>
> 
> manage each hardware information, including irq/clk/power.
> the hardware includes HW0 and HW1.
> 
> Signed-off-by: kyrie wu <kyrie.wu at mediatek.com>
> Signed-off-by: irui wang <irui.wang at mediatek.com>
> 
> ---
>   drivers/media/platform/mediatek/jpeg/Makefile |  11 +-
>   .../platform/mediatek/jpeg/mtk_jpeg_core.c    |  94 ++++++----
>   .../platform/mediatek/jpeg/mtk_jpeg_core.h    |  37 ++++
>   .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c  | 163 ++++++++++++++++++
>   4 files changed, 272 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/media/platform/mediatek/jpeg/Makefile b/drivers/media/platform/mediatek/jpeg/Makefile
> index 76c33aad0f3f..69703db4b0a5 100644
> --- a/drivers/media/platform/mediatek/jpeg/Makefile
> +++ b/drivers/media/platform/mediatek/jpeg/Makefile
> @@ -1,6 +1,9 @@
>   # SPDX-License-Identifier: GPL-2.0-only
> -mtk_jpeg-objs := mtk_jpeg_core.o \
> +obj-$(CONFIG_VIDEO_MEDIATEK_JPEG) += mtk_jpeg.o \
> +	mtk-jpeg-enc-hw.o
> +
> +mtk_jpeg-y := mtk_jpeg_core.o \
>   		 mtk_jpeg_dec_hw.o \
> -		 mtk_jpeg_dec_parse.o \
> -		 mtk_jpeg_enc_hw.o
> -obj-$(CONFIG_VIDEO_MEDIATEK_JPEG) += mtk_jpeg.o
> +		 mtk_jpeg_dec_parse.o
> +
> +mtk-jpeg-enc-hw-y := mtk_jpeg_enc_hw.o
> diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> index 724fb7aeb0ee..3286e9606505 100644
> --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c

..snip..

> @@ -1497,6 +1516,18 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = {
>   	.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
>   };
>   
> +static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {

mt8195_jpegenc_drvdata, or mtk_jpegenc_multicore_drvdata

(same applies for jpegdec)

> +	.formats = mtk_jpeg_enc_formats,
> +	.num_formats = MTK_JPEG_ENC_NUM_FORMATS,
> +	.qops = &mtk_jpeg_enc_qops,
> +	.m2m_ops = &mtk_jpeg_multicore_enc_m2m_ops,

Same comment for jpgenc as well: add support for this device after adding support
for multicore encoder.

> +	.dev_name = "mtk-jpeg-enc",
> +	.ioctl_ops = &mtk_jpeg_enc_ioctl_ops,
> +	.out_q_default_fourcc = V4L2_PIX_FMT_YUYV,
> +	.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
> +};
> +
> +#if defined(CONFIG_OF)
>   static const struct of_device_id mtk_jpeg_match[] = {
>   	{
>   		.compatible = "mediatek,mt8173-jpgdec",
> @@ -1510,10 +1541,15 @@ static const struct of_device_id mtk_jpeg_match[] = {
>   		.compatible = "mediatek,mtk-jpgenc",
>   		.data = &mtk_jpeg_drvdata,
>   	},
> +	{
> +		.compatible = "mediatek,mt8195-jpgenc",
> +		.data = &mtk8195_jpegenc_drvdata,
> +	},
>   	{},
>   };
>   
>   MODULE_DEVICE_TABLE(of, mtk_jpeg_match);
> +#endif
>   
>   static struct platform_driver mtk_jpeg_driver = {
>   	.probe = mtk_jpeg_probe,







More information about the Linux-mediatek mailing list