Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Mediatek MT8189 JPEG support
@ 2025-12-24  3:17 Jianhua Lin
  2025-12-24  3:17 ` [PATCH v2 1/4] arm64: dts: mt8188: update JPEG encoder/decoder compatible Jianhua Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jianhua Lin @ 2025-12-24  3:17 UTC (permalink / raw)
  To: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group, sirius.wang,
	vince-wl.liu, jh.hsu, Jianhua Lin

This series is based on tag: next-20251219, linux-next/master

Changes compared with v1:
- Patches 1/4:
  - Updating commit message
- Patches 2/4, 3/4: 
  - Updating commit message
  - Adjusted property descriptions acorrding to hardware requirements
  - Improved formatting for better readability and consistency
- Patches 4/4:
  - Updating commit message

Jianhua Lin (4):
  arm64: dts: mt8188: update JPEG encoder/decoder compatible
  dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible
    string
  dt-bindings: media: mediatek-jpeg-encoder: add MT8189 compatible
    string
  media: mediatek: jpeg: add compatible for MT8189 SoC

 .../bindings/media/mediatek-jpeg-decoder.yaml | 50 ++++++++++++++++---
 .../bindings/media/mediatek-jpeg-encoder.yaml | 29 ++++++++---
 arch/arm64/boot/dts/mediatek/mt8188.dtsi      |  9 ++--
 .../platform/mediatek/jpeg/mtk_jpeg_core.c    | 44 ++++++++++++++++
 4 files changed, 114 insertions(+), 18 deletions(-)

-- 
2.45.2



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

* [PATCH v2 1/4] arm64: dts: mt8188: update JPEG encoder/decoder compatible
  2025-12-24  3:17 [PATCH v2 0/4] Mediatek MT8189 JPEG support Jianhua Lin
@ 2025-12-24  3:17 ` Jianhua Lin
  2025-12-27 12:34   ` Krzysztof Kozlowski
  2025-12-24  3:17 ` [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string Jianhua Lin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Jianhua Lin @ 2025-12-24  3:17 UTC (permalink / raw)
  To: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group, sirius.wang,
	vince-wl.liu, jh.hsu, Jianhua Lin

The JPEG encoder and decoder of MT8188 share the same architecture
and features as those of MT8189, both use a 34-bit iova
address-space (16GB) and a single clock configuration.

Previously, MT8188 was incorrectly defined alongside SoCs with 32-bit
iova address-space (4GB), such as "mediatek,mt2701-jpgdec" and
"mediatek,mtk-jpgenc". This mismatch results in an ABI break,
as MT8188 cannot function correctly under the 32-bit iova
address-space (4GB) configuration.

Therefore, MT8188 needs to inherit from MT8189.
Update "mediatek,mtk-jpgenc" to "mediatek,mt8189-jpgenc",
update "mediatek,mt2701-jpgdec" to "mediatek,mt8189-jpgdec".

Signed-off-by: Jianhua Lin <jianhua.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8188.dtsi | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8188.dtsi b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
index 90c388f1890f..ff9a774f5911 100644
--- a/arch/arm64/boot/dts/mediatek/mt8188.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
@@ -2846,7 +2846,7 @@ video_encoder: video-encoder@1a020000 {
 		};
 
 		jpeg_encoder: jpeg-encoder@1a030000 {
-			compatible = "mediatek,mt8188-jpgenc", "mediatek,mtk-jpgenc";
+			compatible = "mediatek,mt8188-jpgenc", "mediatek,mt8189-jpgenc";
 			reg = <0 0x1a030000 0 0x10000>;
 			clocks = <&vencsys CLK_VENC1_JPGENC>;
 			clock-names = "jpgenc";
@@ -2859,11 +2859,10 @@ jpeg_encoder: jpeg-encoder@1a030000 {
 		};
 
 		jpeg_decoder: jpeg-decoder@1a040000 {
-			compatible = "mediatek,mt8188-jpgdec", "mediatek,mt2701-jpgdec";
+			compatible = "mediatek,mt8188-jpgdec", "mediatek,mt8189-jpgdec";
 			reg = <0 0x1a040000 0 0x10000>;
-			clocks = <&vencsys CLK_VENC1_LARB>,
-				 <&vencsys CLK_VENC1_JPGDEC>;
-			clock-names = "jpgdec-smi", "jpgdec";
+			clocks = <&vencsys CLK_VENC1_JPGDEC>;
+			clock-names = "jpgdec";
 			interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH 0>;
 			iommus = <&vdo_iommu M4U_PORT_L19_JPGDEC_WDMA_0>,
 				 <&vdo_iommu M4U_PORT_L19_JPGDEC_BSDMA_0>,
-- 
2.45.2



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

* [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string
  2025-12-24  3:17 [PATCH v2 0/4] Mediatek MT8189 JPEG support Jianhua Lin
  2025-12-24  3:17 ` [PATCH v2 1/4] arm64: dts: mt8188: update JPEG encoder/decoder compatible Jianhua Lin
@ 2025-12-24  3:17 ` Jianhua Lin
  2025-12-27 12:33   ` Krzysztof Kozlowski
  2026-01-06 21:11   ` Nicolas Dufresne
  2025-12-24  3:17 ` [PATCH v2 3/4] dt-bindings: media: mediatek-jpeg-encoder: " Jianhua Lin
  2025-12-24  3:17 ` [PATCH v2 4/4] media: mediatek: jpeg: add compatible for MT8189 SoC Jianhua Lin
  3 siblings, 2 replies; 10+ messages in thread
From: Jianhua Lin @ 2025-12-24  3:17 UTC (permalink / raw)
  To: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group, sirius.wang,
	vince-wl.liu, jh.hsu, Jianhua Lin

Compared to the previous generation IC, the MT8189 uses 34-bit iova
address-space (16GB) and requires a single clock configuration.
Therefore, add "mediatek,mt8189-jpgdec" compatible to the binding document.
Additionally, it corrects the inheritance for MT8188, aligning it
with MT8189 due to their shared architecture and 34-bit iova address
space (16GB) and singlesingle clock requirement.
Previously, MT8188 was incorrectly defined alongside SoCs with 32-bit
iova address-space (4GB), such as "mediatek,mt2701-jpgdec". This mismatch
results in an ABI break, as MT8188 cannot function correctly under
the 32-bit iova address-space (4GB) configuration.

Key changes include:
- Introducing "mediatek,mt8189-jpgdec" as a new compatible string to
  represent the correct architecture.
- Updating MT8188 to inherit from MT8189, ensuring proper support for
  34-bit iova address-space (16GB) and simplifying clock configuration.
- Add property "mediatek,larb" for MT8189 requirements.
- Improved formatting for better readability and consistency.

These changes ensure that both MT8188 and MT8189 are correctly supported
with the necessary 34-bit iova address-space (16GB), while maintaining
compatibility with their shared architecture.

Extensive internal review and testing have been conducted to validate
these changes and ensure compliance with DT binding standards.

Signed-off-by: Jianhua Lin <jianhua.lin@mediatek.com>
---
 .../bindings/media/mediatek-jpeg-decoder.yaml | 50 ++++++++++++++++---
 1 file changed, 44 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
index a4aacd3eb189..814b53ef46e7 100644
--- a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
@@ -17,13 +17,19 @@ properties:
     oneOf:
       - items:
           - enum:
-              - mediatek,mt8173-jpgdec
               - mediatek,mt2701-jpgdec
+              - mediatek,mt8173-jpgdec
+      - items:
+          - enum:
+              - mediatek,mt8189-jpgdec
       - items:
           - enum:
               - mediatek,mt7623-jpgdec
-              - mediatek,mt8188-jpgdec
           - const: mediatek,mt2701-jpgdec
+      - items:
+          - enum:
+              - mediatek,mt8188-jpgdec
+          - const: mediatek,mt8189-jpgdec
 
   reg:
     maxItems: 1
@@ -32,13 +38,16 @@ properties:
     maxItems: 1
 
   clocks:
+    minItems: 1
     maxItems: 2
-    minItems: 2
 
   clock-names:
-    items:
-      - const: jpgdec-smi
-      - const: jpgdec
+    minItems: 1
+    maxItems: 2
+
+  mediatek,larb:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: a phandle to the smi_larb node.
 
   power-domains:
     maxItems: 1
@@ -51,6 +60,35 @@ properties:
       Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details.
       Ports are according to the HW.
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt2701-jpgdec
+              - mediatek,mt8173-jpgdec
+
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: jpgdec-smi
+            - const: jpgdec
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8189-jpgdec
+
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: jpgdec
+
 required:
   - compatible
   - reg
-- 
2.45.2



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

* [PATCH v2 3/4] dt-bindings: media: mediatek-jpeg-encoder: add MT8189 compatible string
  2025-12-24  3:17 [PATCH v2 0/4] Mediatek MT8189 JPEG support Jianhua Lin
  2025-12-24  3:17 ` [PATCH v2 1/4] arm64: dts: mt8188: update JPEG encoder/decoder compatible Jianhua Lin
  2025-12-24  3:17 ` [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string Jianhua Lin
@ 2025-12-24  3:17 ` Jianhua Lin
  2025-12-27 12:32   ` Krzysztof Kozlowski
  2025-12-24  3:17 ` [PATCH v2 4/4] media: mediatek: jpeg: add compatible for MT8189 SoC Jianhua Lin
  3 siblings, 1 reply; 10+ messages in thread
From: Jianhua Lin @ 2025-12-24  3:17 UTC (permalink / raw)
  To: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group, sirius.wang,
	vince-wl.liu, jh.hsu, Jianhua Lin

Compared to the previous generation IC, the MT8189 uses 34-bit iova
address-space (16GB)  and requires a single clock configuration.
Therefore, add "mediatek,mt8189-jpgenc" compatible to the binding document.
Additionally, it corrects the inheritance for MT8188, aligning it
with MT8189 due to their shared architecture and 34-bit iova address
space (16GB) requirements.
Previously, MT8188 was incorrectly defined alongside SoCs with 32-bit
iova address-space (4GB), such as "mediatek,mtk-jpgenc". This mismatch
results in an ABI break, as MT8188 cannot function correctly under
the 32-bit iova address-space (4GB) configuration.

Key changes include:
- Introducing "mediatek,mt8189-jpgenc" as a new compatible string to
  represent the correct architecture.
- Updating MT8188 to inherit from MT8189, ensuring proper support for
  34-bit iova address-space (16GB).
- Add property "mediatek,larb" for MT8189 requirements.
- Improved formatting for better readability and consistency.

These changes ensure that both MT8188 and MT8189 are correctly supported
with the necessary 34-bit iova address-space (16GB), while maintaining
compatibility with their shared architecture.

Extensive internal review and testing have been conducted to validate
these changes and ensure compliance with DT binding standards.

Signed-off-by: Jianhua Lin <jianhua.lin@mediatek.com>
---
 .../bindings/media/mediatek-jpeg-encoder.yaml | 29 ++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml
index 5b15f8977f67..3205ecbaa6c5 100644
--- a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml
@@ -14,13 +14,24 @@ description: |-
 
 properties:
   compatible:
-    items:
-      - enum:
-          - mediatek,mt2701-jpgenc
-          - mediatek,mt8183-jpgenc
-          - mediatek,mt8186-jpgenc
-          - mediatek,mt8188-jpgenc
-      - const: mediatek,mtk-jpgenc
+    oneOf:
+      - items:
+          - enum:
+              - mediatek,mtk-jpgenc
+      - items:
+          - enum:
+              - mediatek,mt8189-jpgenc
+      - items:
+          - enum:
+              - mediatek,mt2701-jpgenc
+              - mediatek,mt8183-jpgenc
+              - mediatek,mt8186-jpgenc
+          - const: mediatek,mtk-jpgenc
+      - items:
+          - enum:
+              - mediatek,mt8188-jpgenc
+          - const: mediatek,mt8189-jpgenc
+
   reg:
     maxItems: 1
 
@@ -34,6 +45,10 @@ properties:
     items:
       - const: jpgenc
 
+  mediatek,larb:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: a phandle to the smi_larb node.
+
   power-domains:
     maxItems: 1
 
-- 
2.45.2



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

* [PATCH v2 4/4] media: mediatek: jpeg: add compatible for MT8189 SoC
  2025-12-24  3:17 [PATCH v2 0/4] Mediatek MT8189 JPEG support Jianhua Lin
                   ` (2 preceding siblings ...)
  2025-12-24  3:17 ` [PATCH v2 3/4] dt-bindings: media: mediatek-jpeg-encoder: " Jianhua Lin
@ 2025-12-24  3:17 ` Jianhua Lin
  2025-12-24 19:34   ` Nicolas Dufresne
  3 siblings, 1 reply; 10+ messages in thread
From: Jianhua Lin @ 2025-12-24  3:17 UTC (permalink / raw)
  To: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group, sirius.wang,
	vince-wl.liu, jh.hsu, Jianhua Lin

Compared to the previous generation IC, the MT8189 uses 34-bit iova
address-space (16GB) and requires a single clock configuration.
Therefore, add new compatible to support the JPEG encoder and decoder
of MT8189 SoC.

Signed-off-by: Jianhua Lin <jianhua.lin@mediatek.com>
---
 .../platform/mediatek/jpeg/mtk_jpeg_core.c    | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index d08fe365cbb2..9ea8d8f56e9b 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1866,6 +1866,10 @@ static struct clk_bulk_data mt8173_jpeg_dec_clocks[] = {
 	{ .id = "jpgdec" },
 };
 
+static struct clk_bulk_data mtk_jpeg_dec_clocks[] = {
+	{ .id = "jpgdec" },
+};
+
 static const struct mtk_jpeg_variant mt8173_jpeg_drvdata = {
 	.clks = mt8173_jpeg_dec_clocks,
 	.num_clks = ARRAY_SIZE(mt8173_jpeg_dec_clocks),
@@ -1897,6 +1901,38 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = {
 	.multi_core = false,
 };
 
+static const struct mtk_jpeg_variant mtk8189_jpegenc_drvdata = {
+	.clks = mtk_jpeg_clocks,
+	.num_clks = ARRAY_SIZE(mtk_jpeg_clocks),
+	.formats = mtk_jpeg_enc_formats,
+	.num_formats = MTK_JPEG_ENC_NUM_FORMATS,
+	.qops = &mtk_jpeg_enc_qops,
+	.irq_handler = mtk_jpeg_enc_irq,
+	.hw_reset = mtk_jpeg_enc_reset,
+	.m2m_ops = &mtk_jpeg_enc_m2m_ops,
+	.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,
+	.support_34bit = true,
+};
+
+static const struct mtk_jpeg_variant mtk8189_jpegdec_drvdata = {
+	.clks = mtk_jpeg_dec_clocks,
+	.num_clks = ARRAY_SIZE(mtk_jpeg_dec_clocks),
+	.formats = mtk_jpeg_dec_formats,
+	.num_formats = MTK_JPEG_DEC_NUM_FORMATS,
+	.qops = &mtk_jpeg_dec_qops,
+	.irq_handler = mtk_jpeg_dec_irq,
+	.hw_reset = mtk_jpeg_dec_reset,
+	.m2m_ops = &mtk_jpeg_dec_m2m_ops,
+	.dev_name = "mtk-jpeg-dec",
+	.ioctl_ops = &mtk_jpeg_dec_ioctl_ops,
+	.out_q_default_fourcc = V4L2_PIX_FMT_JPEG,
+	.cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M,
+	.support_34bit = true,
+};
+
 static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
 	.formats = mtk_jpeg_enc_formats,
 	.num_formats = MTK_JPEG_ENC_NUM_FORMATS,
@@ -1936,6 +1972,14 @@ static const struct of_device_id mtk_jpeg_match[] = {
 		.compatible = "mediatek,mtk-jpgenc",
 		.data = &mtk_jpeg_drvdata,
 	},
+	{
+		.compatible = "mediatek,mt8189-jpgenc",
+		.data = &mtk8189_jpegenc_drvdata,
+	},
+	{
+		.compatible = "mediatek,mt8189-jpgdec",
+		.data = &mtk8189_jpegdec_drvdata,
+	},
 	{
 		.compatible = "mediatek,mt8195-jpgenc",
 		.data = &mtk8195_jpegenc_drvdata,
-- 
2.45.2



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

* Re: [PATCH v2 4/4] media: mediatek: jpeg: add compatible for MT8189 SoC
  2025-12-24  3:17 ` [PATCH v2 4/4] media: mediatek: jpeg: add compatible for MT8189 SoC Jianhua Lin
@ 2025-12-24 19:34   ` Nicolas Dufresne
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dufresne @ 2025-12-24 19:34 UTC (permalink / raw)
  To: Jianhua Lin, mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group, sirius.wang,
	vince-wl.liu, jh.hsu

[-- Attachment #1: Type: text/plain, Size: 3322 bytes --]

Le mercredi 24 décembre 2025 à 11:17 +0800, Jianhua Lin a écrit :
> Compared to the previous generation IC, the MT8189 uses 34-bit iova
> address-space (16GB) and requires a single clock configuration.
> Therefore, add new compatible to support the JPEG encoder and decoder
> of MT8189 SoC.
> 
> Signed-off-by: Jianhua Lin <jianhua.lin@mediatek.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

I'll have to wait for some ack on the bindings, which looks otherwise fine to
me. But due to holiday, that might be delayed a little bit.

cheers,
Nicolas

> ---
>  .../platform/mediatek/jpeg/mtk_jpeg_core.c    | 44 +++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> index d08fe365cbb2..9ea8d8f56e9b 100644
> --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> @@ -1866,6 +1866,10 @@ static struct clk_bulk_data mt8173_jpeg_dec_clocks[] =
> {
>  	{ .id = "jpgdec" },
>  };
>  
> +static struct clk_bulk_data mtk_jpeg_dec_clocks[] = {
> +	{ .id = "jpgdec" },
> +};
> +
>  static const struct mtk_jpeg_variant mt8173_jpeg_drvdata = {
>  	.clks = mt8173_jpeg_dec_clocks,
>  	.num_clks = ARRAY_SIZE(mt8173_jpeg_dec_clocks),
> @@ -1897,6 +1901,38 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata =
> {
>  	.multi_core = false,
>  };
>  
> +static const struct mtk_jpeg_variant mtk8189_jpegenc_drvdata = {
> +	.clks = mtk_jpeg_clocks,
> +	.num_clks = ARRAY_SIZE(mtk_jpeg_clocks),
> +	.formats = mtk_jpeg_enc_formats,
> +	.num_formats = MTK_JPEG_ENC_NUM_FORMATS,
> +	.qops = &mtk_jpeg_enc_qops,
> +	.irq_handler = mtk_jpeg_enc_irq,
> +	.hw_reset = mtk_jpeg_enc_reset,
> +	.m2m_ops = &mtk_jpeg_enc_m2m_ops,
> +	.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,
> +	.support_34bit = true,
> +};
> +
> +static const struct mtk_jpeg_variant mtk8189_jpegdec_drvdata = {
> +	.clks = mtk_jpeg_dec_clocks,
> +	.num_clks = ARRAY_SIZE(mtk_jpeg_dec_clocks),
> +	.formats = mtk_jpeg_dec_formats,
> +	.num_formats = MTK_JPEG_DEC_NUM_FORMATS,
> +	.qops = &mtk_jpeg_dec_qops,
> +	.irq_handler = mtk_jpeg_dec_irq,
> +	.hw_reset = mtk_jpeg_dec_reset,
> +	.m2m_ops = &mtk_jpeg_dec_m2m_ops,
> +	.dev_name = "mtk-jpeg-dec",
> +	.ioctl_ops = &mtk_jpeg_dec_ioctl_ops,
> +	.out_q_default_fourcc = V4L2_PIX_FMT_JPEG,
> +	.cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M,
> +	.support_34bit = true,
> +};
> +
>  static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
>  	.formats = mtk_jpeg_enc_formats,
>  	.num_formats = MTK_JPEG_ENC_NUM_FORMATS,
> @@ -1936,6 +1972,14 @@ static const struct of_device_id mtk_jpeg_match[] = {
>  		.compatible = "mediatek,mtk-jpgenc",
>  		.data = &mtk_jpeg_drvdata,
>  	},
> +	{
> +		.compatible = "mediatek,mt8189-jpgenc",
> +		.data = &mtk8189_jpegenc_drvdata,
> +	},
> +	{
> +		.compatible = "mediatek,mt8189-jpgdec",
> +		.data = &mtk8189_jpegdec_drvdata,
> +	},
>  	{
>  		.compatible = "mediatek,mt8195-jpgenc",
>  		.data = &mtk8195_jpegenc_drvdata,

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v2 3/4] dt-bindings: media: mediatek-jpeg-encoder: add MT8189 compatible string
  2025-12-24  3:17 ` [PATCH v2 3/4] dt-bindings: media: mediatek-jpeg-encoder: " Jianhua Lin
@ 2025-12-27 12:32   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-27 12:32 UTC (permalink / raw)
  To: Jianhua Lin
  Cc: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, devicetree, linux-kernel, linux-media,
	linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, sirius.wang, vince-wl.liu,
	jh.hsu

On Wed, Dec 24, 2025 at 11:17:20AM +0800, Jianhua Lin wrote:
> Compared to the previous generation IC, the MT8189 uses 34-bit iova
> address-space (16GB)  and requires a single clock configuration.
> Therefore, add "mediatek,mt8189-jpgenc" compatible to the binding document.
> Additionally, it corrects the inheritance for MT8188, aligning it

Two different issues. Don't mix them up. See submitting patches.

> with MT8189 due to their shared architecture and 34-bit iova address
> space (16GB) requirements.
> Previously, MT8188 was incorrectly defined alongside SoCs with 32-bit
> iova address-space (4GB), such as "mediatek,mtk-jpgenc". This mismatch
> results in an ABI break, as MT8188 cannot function correctly under
> the 32-bit iova address-space (4GB) configuration.
> 
> Key changes include:

How is this related to above?
> - Introducing "mediatek,mt8189-jpgenc" as a new compatible string to
>   represent the correct architecture.

Why are you repeating the same?

> - Updating MT8188 to inherit from MT8189, ensuring proper support for
>   34-bit iova address-space (16GB).
> - Add property "mediatek,larb" for MT8189 requirements.
> - Improved formatting for better readability and consistency.
> 
> These changes ensure that both MT8188 and MT8189 are correctly supported
> with the necessary 34-bit iova address-space (16GB), while maintaining
> compatibility with their shared architecture.

This is not a contest who writes the longest commit msg by repeating
obvious things.

> 
> Extensive internal review and testing have been conducted to validate
> these changes and ensure compliance with DT binding standards.

Really, no.

Best regards,
Krzysztof



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

* Re: [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string
  2025-12-24  3:17 ` [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string Jianhua Lin
@ 2025-12-27 12:33   ` Krzysztof Kozlowski
  2026-01-06 21:11   ` Nicolas Dufresne
  1 sibling, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-27 12:33 UTC (permalink / raw)
  To: Jianhua Lin
  Cc: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, devicetree, linux-kernel, linux-media,
	linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, sirius.wang, vince-wl.liu,
	jh.hsu

On Wed, Dec 24, 2025 at 11:17:19AM +0800, Jianhua Lin wrote:
> Compared to the previous generation IC, the MT8189 uses 34-bit iova
> address-space (16GB) and requires a single clock configuration.
> Therefore, add "mediatek,mt8189-jpgdec" compatible to the binding document.
> Additionally, it corrects the inheritance for MT8188, aligning it
> with MT8189 due to their shared architecture and 34-bit iova address
> space (16GB) and singlesingle clock requirement.
> Previously, MT8188 was incorrectly defined alongside SoCs with 32-bit
> iova address-space (4GB), such as "mediatek,mt2701-jpgdec". This mismatch
> results in an ABI break, as MT8188 cannot function correctly under
> the 32-bit iova address-space (4GB) configuration.
> 
> Key changes include:
> - Introducing "mediatek,mt8189-jpgdec" as a new compatible string to
>   represent the correct architecture.
> - Updating MT8188 to inherit from MT8189, ensuring proper support for
>   34-bit iova address-space (16GB) and simplifying clock configuration.
> - Add property "mediatek,larb" for MT8189 requirements.
> - Improved formatting for better readability and consistency.
> 
> These changes ensure that both MT8188 and MT8189 are correctly supported
> with the necessary 34-bit iova address-space (16GB), while maintaining
> compatibility with their shared architecture.
> 
> Extensive internal review and testing have been conducted to validate
> these changes and ensure compliance with DT binding standards.

That's not even true. If you did extensive internal review, then people
would have tell you that you never mix fixes with new features in one
commit. Never, that's like basic rule.

Best regards,
Krzysztof



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

* Re: [PATCH v2 1/4] arm64: dts: mt8188: update JPEG encoder/decoder compatible
  2025-12-24  3:17 ` [PATCH v2 1/4] arm64: dts: mt8188: update JPEG encoder/decoder compatible Jianhua Lin
@ 2025-12-27 12:34   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-27 12:34 UTC (permalink / raw)
  To: Jianhua Lin
  Cc: mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, devicetree, linux-kernel, linux-media,
	linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, sirius.wang, vince-wl.liu,
	jh.hsu

On Wed, Dec 24, 2025 at 11:17:18AM +0800, Jianhua Lin wrote:
> The JPEG encoder and decoder of MT8188 share the same architecture
> and features as those of MT8189, both use a 34-bit iova
> address-space (16GB) and a single clock configuration.
> 
> Previously, MT8188 was incorrectly defined alongside SoCs with 32-bit
> iova address-space (4GB), such as "mediatek,mt2701-jpgdec" and
> "mediatek,mtk-jpgenc". This mismatch results in an ABI break,

How this mismatch can result in ABI break?

> as MT8188 cannot function correctly under the 32-bit iova
> address-space (4GB) configuration.

Do you understand what is an ABI break? This commit is the ABI break.

Best regards,
Krzysztof



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

* Re: [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string
  2025-12-24  3:17 ` [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string Jianhua Lin
  2025-12-27 12:33   ` Krzysztof Kozlowski
@ 2026-01-06 21:11   ` Nicolas Dufresne
  1 sibling, 0 replies; 10+ messages in thread
From: Nicolas Dufresne @ 2026-01-06 21:11 UTC (permalink / raw)
  To: Jianhua Lin, mchehab, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, Project_Global_Chrome_Upstream_Group, sirius.wang,
	vince-wl.liu, jh.hsu

[-- Attachment #1: Type: text/plain, Size: 7149 bytes --]

Hi,

Le mercredi 24 décembre 2025 à 11:17 +0800, Jianhua Lin a écrit :
> Compared to the previous generation IC, the MT8189 uses 34-bit iova
> address-space (16GB) and requires a single clock configuration.
> Therefore, add "mediatek,mt8189-jpgdec" compatible to the binding document.
> Additionally, it corrects the inheritance for MT8188, aligning it
> with MT8189 due to their shared architecture and 34-bit iova address
> space (16GB) and singlesingle clock requirement.

singlesingle -> single

> Previously, MT8188 was incorrectly defined alongside SoCs with 32-bit
> iova address-space (4GB), such as "mediatek,mt2701-jpgdec". This mismatch
> results in an ABI break, as MT8188 cannot function correctly under
> the 32-bit iova address-space (4GB) configuration.

Was already mentioned earlier, badly introduce DT code create an ABI, and fixing
it is the ABI break, not the other way around. The MT8188 issue should be fixed
on its own, with proper Fixes: tag.

> 
> Key changes include:
> - Introducing "mediatek,mt8189-jpgdec" as a new compatible string to
>   represent the correct architecture.
> - Updating MT8188 to inherit from MT8189, ensuring proper support for

It is odd to have older chips inherit from newer one, should be reversed
assuming you can fix MT8188. See more comment below.

>   34-bit iova address-space (16GB) and simplifying clock configuration.
> - Add property "mediatek,larb" for MT8189 requirements.
> - Improved formatting for better readability and consistency.

Do style change in it own commit, I don't mixing reformating, with fixed and new
feature in one patch will create much interest in your set from the DT
maintainers. So please break this into at least 3 patches.

> These changes ensure that both MT8188 and MT8189 are correctly supported
> with the necessary 34-bit iova address-space (16GB), while maintaining
> compatibility with their shared architecture.
> 
> Extensive internal review and testing have been conducted to validate
> these changes and ensure compliance with DT binding standards.

This last paragraph does not seem relevant as a commit message. Consider reading
this message in 5 years, would it be useful, and answer is not, since we can't
see the review and testing process.

> 
> Signed-off-by: Jianhua Lin <jianhua.lin@mediatek.com>
> ---
>  .../bindings/media/mediatek-jpeg-decoder.yaml | 50 ++++++++++++++++---
>  1 file changed, 44 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
> index a4aacd3eb189..814b53ef46e7 100644
> --- a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
> +++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
> @@ -17,13 +17,19 @@ properties:
>      oneOf:
>        - items:
>            - enum:
> -              - mediatek,mt8173-jpgdec
>                - mediatek,mt2701-jpgdec
> +              - mediatek,mt8173-jpgdec

I guess you sorted these, this is the type of style change that makes reviewer
unhappy, do this cleanup on it own.

One thing the driver implementation tells me is that mediatek,mt8173-jpgdec is
not different from mediatek,mt2701-jpgdec, so in theory, the DTS should have
aimed for the second item and an implementation of:

  compatible = "mediatek,mt8173-jpgdec", "mediatek,mt2701-jpgdec";

That just shows the screw-up started a while ago, I'm not saying to change that
now.

> +      - items:
> +          - enum:
> +              - mediatek,mt8189-jpgdec

That one make no sense, if you want to allow this compatible alone, put it the
very first item, its meant for that. Though, considering the chronology, it
would be logical to say that MT8189 is based on MT8188. If we go that way,
MT8188 should get added into the single item choice and the enum/const pair
shoudl be reversed.

>        - items:
>            - enum:
>                - mediatek,mt7623-jpgdec
> -              - mediatek,mt8188-jpgdec

This must be kept, its unfortunate, but its in the ABI.

>            - const: mediatek,mt2701-jpgdec
> +      - items:
> +          - enum:
> +              - mediatek,mt8188-jpgdec
> +          - const: mediatek,mt8189-jpgdec

This would be reversed.

On the implementation side, in code, you'd introduce a variants that matches
mediatek,mt8188-jpgdec, this will ensure the driver now works properly with past
DTS.

Then in DTS, which is not my domain here at all, what is appropriate will depend
on what happens if you assume MT8188 is same as MT2701. In my personal opinion,
if that is unusable or worse crash or hang the systems, I'd drop the broken
"mediatek,mt2701-jpgdec" so it won't probe anymore on older drivers. If its
usable / used in some ways, e.g. if it work on 4GB systems, you'll have to leave
it this way, since you'd regress some users.

The rest is a bit over my head, I've a simple users of DT like you, but
hopefully these hints are good enough to un-lock the situation. Notice the
chronology logic needs to be applied down below too.

>  
>    reg:
>      maxItems: 1
> @@ -32,13 +38,16 @@ properties:
>      maxItems: 1
>  
>    clocks:
> +    minItems: 1
>      maxItems: 2
> -    minItems: 2
>  
>    clock-names:
> -    items:
> -      - const: jpgdec-smi
> -      - const: jpgdec

So what happened once the driver on MT8188 tried to enable jpgdec-smi clock ?
This is relevant to what can and cannot be changed, was it completely unusable ?

regards,
Nicolas

> +    minItems: 1
> +    maxItems: 2
> +
> +  mediatek,larb:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: a phandle to the smi_larb node.
>  
>    power-domains:
>      maxItems: 1
> @@ -51,6 +60,35 @@ properties:
>        Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details.
>        Ports are according to the HW.
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - mediatek,mt2701-jpgdec
> +              - mediatek,mt8173-jpgdec
> +
> +    then:
> +      properties:
> +        clock-names:
> +          items:
> +            - const: jpgdec-smi
> +            - const: jpgdec
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - mediatek,mt8189-jpgdec
> +
> +    then:
> +      properties:
> +        clock-names:
> +          items:
> +            - const: jpgdec
> +
>  required:
>    - compatible
>    - reg

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2026-01-06 21:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-24  3:17 [PATCH v2 0/4] Mediatek MT8189 JPEG support Jianhua Lin
2025-12-24  3:17 ` [PATCH v2 1/4] arm64: dts: mt8188: update JPEG encoder/decoder compatible Jianhua Lin
2025-12-27 12:34   ` Krzysztof Kozlowski
2025-12-24  3:17 ` [PATCH v2 2/4] dt-bindings: media: mediatek-jpeg-decoder: add MT8189 compatible string Jianhua Lin
2025-12-27 12:33   ` Krzysztof Kozlowski
2026-01-06 21:11   ` Nicolas Dufresne
2025-12-24  3:17 ` [PATCH v2 3/4] dt-bindings: media: mediatek-jpeg-encoder: " Jianhua Lin
2025-12-27 12:32   ` Krzysztof Kozlowski
2025-12-24  3:17 ` [PATCH v2 4/4] media: mediatek: jpeg: add compatible for MT8189 SoC Jianhua Lin
2025-12-24 19:34   ` Nicolas Dufresne

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