public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] media: jpeg: refactor multi-hw judgement
@ 2022-12-15  9:30 Irui Wang
  2022-12-15  9:45 ` AngeloGioacchino Del Regno
  2022-12-15 10:50 ` Johnson Wang (王聖鑫)
  0 siblings, 2 replies; 6+ messages in thread
From: Irui Wang @ 2022-12-15  9:30 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, Matthias Brugger,
	angelogioacchino.delregno, nicolas.dufresne, kyrie wu
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, Tomasz Figa, xia.jiang,
	maoguang.meng, Irui Wang

From: kyrie wu <kyrie.wu@mediatek.com>

some chips have multi-hw, but others have only one,
modify the condition of multi-hw judgement

Signed-off-by: kyrie wu <kyrie.wu@mediatek.com>
Signed-off-by: irui wang <irui.wang@mediatek.com>
---
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c |  5 +++--
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index 4a5c6415ad08..37db8b81a935 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -1695,8 +1695,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
 		return -EINVAL;
  	}
 
-
-	if (list_empty(&pdev->dev.devres_head)) {
+	if (!jpeg->variant->hw_arch) {
 		INIT_DELAYED_WORK(&jpeg->job_timeout_work,
 				  mtk_jpeg_job_timeout_work);
 
@@ -1890,6 +1889,7 @@ static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
 	.ioctl_ops = &mtk_jpeg_enc_ioctl_ops,
 	.out_q_default_fourcc = V4L2_PIX_FMT_YUYV,
 	.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
+	.hw_arch = MTK_JPEG_HW_MULTI_CORE,
 };
 
 static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
@@ -1901,6 +1901,7 @@ static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
 	.ioctl_ops = &mtk_jpeg_dec_ioctl_ops,
 	.out_q_default_fourcc = V4L2_PIX_FMT_JPEG,
 	.cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M,
+	.hw_arch = MTK_JPEG_HW_MULTI_CORE,
 };
 
 #if defined(CONFIG_OF)
diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h
index b9126476be8f..ec04a8ce73cf 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h
@@ -46,6 +46,16 @@ enum mtk_jpeg_ctx_state {
 	MTK_JPEG_SOURCE_CHANGE,
 };
 
+/**
+ * enum mtk_jpeg_hw_arch - arch of the jpeg hw
+ * @MTK_JPEG_HW_SINGLE_CORE:	jpeg hw is single core
+ * @MTK_JPEG_HW_MULTI_CORE:		jpeg hw is mluti-core
+ */
+enum mtk_jpeg_hw_arch {
+	MTK_JPEG_HW_SINGLE_CORE = 0,
+	MTK_JPEG_HW_MULTI_CORE = 1,
+};
+
 /**
  * struct mtk_jpeg_variant - mtk jpeg driver variant
  * @clks:			clock names
@@ -60,6 +70,7 @@ enum mtk_jpeg_ctx_state {
  * @ioctl_ops:			the callback of jpeg v4l2_ioctl_ops
  * @out_q_default_fourcc:	output queue default fourcc
  * @cap_q_default_fourcc:	capture queue default fourcc
+ * @hw_arch:            mark jpeg hw arch
  */
 struct mtk_jpeg_variant {
 	struct clk_bulk_data *clks;
@@ -74,6 +85,7 @@ struct mtk_jpeg_variant {
 	const struct v4l2_ioctl_ops *ioctl_ops;
 	u32 out_q_default_fourcc;
 	u32 cap_q_default_fourcc;
+	enum mtk_jpeg_hw_arch hw_arch;
 };
 
 struct mtk_jpeg_src_buf {
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: jpeg: refactor multi-hw judgement
  2022-12-15  9:30 [PATCH] media: jpeg: refactor multi-hw judgement Irui Wang
@ 2022-12-15  9:45 ` AngeloGioacchino Del Regno
  2022-12-16  2:59   ` Kyrie Wu (吴晗)
  2022-12-15 10:50 ` Johnson Wang (王聖鑫)
  1 sibling, 1 reply; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-15  9:45 UTC (permalink / raw)
  To: Irui Wang, Hans Verkuil, Mauro Carvalho Chehab, Matthias Brugger,
	nicolas.dufresne, kyrie wu
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, Tomasz Figa, xia.jiang,
	maoguang.meng

Il 15/12/22 10:30, Irui Wang ha scritto:
> From: kyrie wu <kyrie.wu@mediatek.com>
> 
> some chips have multi-hw, but others have only one,
> modify the condition of multi-hw judgement
> 
> Signed-off-by: kyrie wu <kyrie.wu@mediatek.com>
> Signed-off-by: irui wang <irui.wang@mediatek.com>

Agreed. But this needs a Fixes tag, please add the right one.

Regards,
Angelo



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: jpeg: refactor multi-hw judgement
  2022-12-15  9:30 [PATCH] media: jpeg: refactor multi-hw judgement Irui Wang
  2022-12-15  9:45 ` AngeloGioacchino Del Regno
@ 2022-12-15 10:50 ` Johnson Wang (王聖鑫)
  2022-12-15 11:09   ` AngeloGioacchino Del Regno
  1 sibling, 1 reply; 6+ messages in thread
From: Johnson Wang (王聖鑫) @ 2022-12-15 10:50 UTC (permalink / raw)
  To: nicolas.dufresne@collabora.com, matthias.bgg@gmail.com,
	mchehab@kernel.org, Kyrie Wu (吴晗),
	angelogioacchino.delregno@collabora.com,
	Irui Wang (王瑞), hverkuil-cisco@xs4all.nl
  Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	tfiga@chromium.org, linux-media@vger.kernel.org,
	Maoguang Meng (孟毛广),
	Project_Global_Chrome_Upstream_Group,
	linux-arm-kernel@lists.infradead.org,
	Xia Jiang (江霞)

On Thu, 2022-12-15 at 17:30 +0800, Irui Wang wrote:
> From: kyrie wu <kyrie.wu@mediatek.com>
> 
> some chips have multi-hw, but others have only one,
> modify the condition of multi-hw judgement
> 
> Signed-off-by: kyrie wu <kyrie.wu@mediatek.com>
> Signed-off-by: irui wang <irui.wang@mediatek.com>
> ---
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c |  5 +++--
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 

This may conflict with kernel mainline since mtk-jpeg folder doesn't
exist.
Please fix it.

BRs,
Johnson Wang
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: jpeg: refactor multi-hw judgement
  2022-12-15 10:50 ` Johnson Wang (王聖鑫)
@ 2022-12-15 11:09   ` AngeloGioacchino Del Regno
  2022-12-16  3:01     ` Kyrie Wu (吴晗)
  0 siblings, 1 reply; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-15 11:09 UTC (permalink / raw)
  To: Johnson Wang (王聖鑫),
	nicolas.dufresne@collabora.com, matthias.bgg@gmail.com,
	mchehab@kernel.org, Kyrie Wu (吴晗),
	Irui Wang (王瑞), hverkuil-cisco@xs4all.nl
  Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	tfiga@chromium.org, linux-media@vger.kernel.org,
	Maoguang Meng (孟毛广),
	Project_Global_Chrome_Upstream_Group,
	linux-arm-kernel@lists.infradead.org,
	Xia Jiang (江霞)

Il 15/12/22 11:50, Johnson Wang (王聖鑫) ha scritto:
> On Thu, 2022-12-15 at 17:30 +0800, Irui Wang wrote:
>> From: kyrie wu <kyrie.wu@mediatek.com>
>>
>> some chips have multi-hw, but others have only one,
>> modify the condition of multi-hw judgement
>>
>> Signed-off-by: kyrie wu <kyrie.wu@mediatek.com>
>> Signed-off-by: irui wang <irui.wang@mediatek.com>
>> ---
>>   drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c |  5 +++--
>>   drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++
>>   2 files changed, 15 insertions(+), 2 deletions(-)
>>
> 
> This may conflict with kernel mainline since mtk-jpeg folder doesn't
> exist.
> Please fix it.
> 
> BRs,
> Johnson Wang

Ouch. I just noticed that the folder is mismatching; this didn't deserve
a R-b tag. I'll be more careful next time.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: jpeg: refactor multi-hw judgement
  2022-12-15  9:45 ` AngeloGioacchino Del Regno
@ 2022-12-16  2:59   ` Kyrie Wu (吴晗)
  0 siblings, 0 replies; 6+ messages in thread
From: Kyrie Wu (吴晗) @ 2022-12-16  2:59 UTC (permalink / raw)
  To: nicolas.dufresne@collabora.com, matthias.bgg@gmail.com,
	mchehab@kernel.org, angelogioacchino.delregno@collabora.com,
	Irui Wang (王瑞), hverkuil-cisco@xs4all.nl
  Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	tfiga@chromium.org, linux-media@vger.kernel.org,
	Maoguang Meng (孟毛广),
	Project_Global_Chrome_Upstream_Group,
	linux-arm-kernel@lists.infradead.org,
	Xia Jiang (江霞)

On Thu, 2022-12-15 at 10:45 +0100, AngeloGioacchino Del Regno wrote:
> Il 15/12/22 10:30, Irui Wang ha scritto:
> > From: kyrie wu <kyrie.wu@mediatek.com>
> > 
> > some chips have multi-hw, but others have only one,
> > modify the condition of multi-hw judgement
> > 
> > Signed-off-by: kyrie wu <kyrie.wu@mediatek.com>
> > Signed-off-by: irui wang <irui.wang@mediatek.com>
> 
> Agreed. But this needs a Fixes tag, please add the right one.
> 
> Regards,
> Angelo

Hello Angelo,

Thanks for your kind reply, I would add it in the next version.

Regards,
Kyrie.
> 
> 
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: jpeg: refactor multi-hw judgement
  2022-12-15 11:09   ` AngeloGioacchino Del Regno
@ 2022-12-16  3:01     ` Kyrie Wu (吴晗)
  0 siblings, 0 replies; 6+ messages in thread
From: Kyrie Wu (吴晗) @ 2022-12-16  3:01 UTC (permalink / raw)
  To: Irui Wang (王瑞), matthias.bgg@gmail.com,
	mchehab@kernel.org, angelogioacchino.delregno@collabora.com,
	Johnson Wang (王聖鑫),
	nicolas.dufresne@collabora.com, hverkuil-cisco@xs4all.nl
  Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	tfiga@chromium.org, linux-media@vger.kernel.org,
	Maoguang Meng (孟毛广),
	Project_Global_Chrome_Upstream_Group,
	linux-arm-kernel@lists.infradead.org,
	Xia Jiang (江霞)

On Thu, 2022-12-15 at 12:09 +0100, AngeloGioacchino Del Regno wrote:
> Il 15/12/22 11:50, Johnson Wang (王聖鑫) ha scritto:
> > On Thu, 2022-12-15 at 17:30 +0800, Irui Wang wrote:
> > > From: kyrie wu <kyrie.wu@mediatek.com>
> > > 
> > > some chips have multi-hw, but others have only one,
> > > modify the condition of multi-hw judgement
> > > 
> > > Signed-off-by: kyrie wu <kyrie.wu@mediatek.com>
> > > Signed-off-by: irui wang <irui.wang@mediatek.com>
> > > ---
> > >   drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c |  5 +++--
> > >   drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12
> > > ++++++++++++
> > >   2 files changed, 15 insertions(+), 2 deletions(-)
> > > 
> > 
> > This may conflict with kernel mainline since mtk-jpeg folder
> > doesn't
> > exist.
> > Please fix it.
> > 
> > BRs,
> > Johnson Wang
> 
> Ouch. I just noticed that the folder is mismatching; this didn't
> deserve
> a R-b tag. I'll be more careful next time.

I'm terriable sorry for this mistake, and it would be fixed in the
coming version.

Thanks.
> 
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-16  3:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-15  9:30 [PATCH] media: jpeg: refactor multi-hw judgement Irui Wang
2022-12-15  9:45 ` AngeloGioacchino Del Regno
2022-12-16  2:59   ` Kyrie Wu (吴晗)
2022-12-15 10:50 ` Johnson Wang (王聖鑫)
2022-12-15 11:09   ` AngeloGioacchino Del Regno
2022-12-16  3:01     ` Kyrie Wu (吴晗)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox