linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192
@ 2022-11-28 14:38 Allen-KH Cheng
  2022-11-28 14:38 ` [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder Allen-KH Cheng
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Allen-KH Cheng @ 2022-11-28 14:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, yunfei.dong,
	Allen-KH Cheng

This series is based on linux-next.

Change from v4:
 - Add patch for removing dma-ranges
 - Update child names to video-codec
 - Update patch title and message

Change from v3:
 - Drop `vcodec_lat:` and `vcodec_core:`

Change from v2:
 - Add a dt-bindings patch for changing "vcodec" to "video-codec"
 - Rename child names for vcodec lat and core nodes

Change from v1:
 - Replace node names with video-codec
  [Allen-KH Cheng <allen-kh.cheng@mediatek.com>]

Allen-KH Cheng (3):
  media: dt-bindings: media: mediatek: Rename child node names for
    decoder
  media: dt-bindings: media: mediatek: Remove "dma-ranges" property for
    decoder
  arm64: dts: mt8192: Add video-codec nodes

 .../media/mediatek,vcodec-subdev-decoder.yaml | 67 ++-----------------
 arch/arm64/boot/dts/mediatek/mt8192.dtsi      | 59 ++++++++++++++++
 2 files changed, 63 insertions(+), 63 deletions(-)

-- 
2.18.0


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

* [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder
  2022-11-28 14:38 [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Allen-KH Cheng
@ 2022-11-28 14:38 ` Allen-KH Cheng
  2022-12-01 14:57   ` Krzysztof Kozlowski
  2022-12-05 21:32   ` Nícolas F. R. A. Prado
  2022-11-28 14:38 ` [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property " Allen-KH Cheng
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Allen-KH Cheng @ 2022-11-28 14:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, yunfei.dong,
	Allen-KH Cheng

In order to make the names of the child nodes more generic, we rename
"vcodec-lat" and "vcodec-core" to "video-codec" for decoder in
patternProperties and example.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
 .../media/mediatek,vcodec-subdev-decoder.yaml | 60 ++-----------------
 1 file changed, 4 insertions(+), 56 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
index c4f20acdc1f8..695402041e04 100644
--- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
@@ -91,12 +91,13 @@ properties:
 
 # Required child node:
 patternProperties:
-  '^vcodec-lat@[0-9a-f]+$':
+  '^video-codec@[0-9a-f]+$':
     type: object
 
     properties:
       compatible:
         enum:
+          - mediatek,mtk-vcodec-core
           - mediatek,mtk-vcodec-lat
           - mediatek,mtk-vcodec-lat-soc
 
@@ -145,59 +146,6 @@ patternProperties:
 
     additionalProperties: false
 
-  '^vcodec-core@[0-9a-f]+$':
-    type: object
-
-    properties:
-      compatible:
-        const: mediatek,mtk-vcodec-core
-
-      reg:
-        maxItems: 1
-
-      interrupts:
-        maxItems: 1
-
-      iommus:
-        minItems: 1
-        maxItems: 32
-        description: |
-          List of the hardware port in respective IOMMU block for current Socs.
-          Refer to bindings/iommu/mediatek,iommu.yaml.
-
-      clocks:
-        maxItems: 5
-
-      clock-names:
-        items:
-          - const: sel
-          - const: soc-vdec
-          - const: soc-lat
-          - const: vdec
-          - const: top
-
-      assigned-clocks:
-        maxItems: 1
-
-      assigned-clock-parents:
-        maxItems: 1
-
-      power-domains:
-        maxItems: 1
-
-    required:
-      - compatible
-      - reg
-      - interrupts
-      - iommus
-      - clocks
-      - clock-names
-      - assigned-clocks
-      - assigned-clock-parents
-      - power-domains
-
-    additionalProperties: false
-
 required:
   - compatible
   - reg
@@ -241,7 +189,7 @@ examples:
             #size-cells = <2>;
             ranges = <0 0 0 0x16000000 0 0x40000>;
             reg = <0 0x16000000 0 0x1000>;		/* VDEC_SYS */
-            vcodec-lat@10000 {
+            video-codec@10000 {
                 compatible = "mediatek,mtk-vcodec-lat";
                 reg = <0 0x10000 0 0x800>;
                 interrupts = <GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -264,7 +212,7 @@ examples:
                 power-domains = <&spm MT8192_POWER_DOMAIN_VDEC>;
             };
 
-            vcodec-core@25000 {
+            video-codec@25000 {
                 compatible = "mediatek,mtk-vcodec-core";
                 reg = <0 0x25000 0 0x1000>;
                 interrupts = <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH 0>;
-- 
2.18.0


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

* [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property for decoder
  2022-11-28 14:38 [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Allen-KH Cheng
  2022-11-28 14:38 ` [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder Allen-KH Cheng
@ 2022-11-28 14:38 ` Allen-KH Cheng
  2022-11-30 11:27   ` AngeloGioacchino Del Regno
                     ` (2 more replies)
  2022-11-28 14:38 ` [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes Allen-KH Cheng
  2022-12-01  9:12 ` [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Chen-Yu Tsai
  3 siblings, 3 replies; 12+ messages in thread
From: Allen-KH Cheng @ 2022-11-28 14:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, yunfei.dong,
	Allen-KH Cheng

Since commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus
controllers") was merge, we don't need a dma-ranges property for IOMMU
in mediatek video codec.

We remove the dma-ranges property and fix the example in
mediatek,vcodec-subdev-decoder.yaml

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
 .../bindings/media/mediatek,vcodec-subdev-decoder.yaml     | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
index 695402041e04..7c5b4a91c59b 100644
--- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
@@ -76,11 +76,6 @@ properties:
       The node of system control processor (SCP), using
       the remoteproc & rpmsg framework.
 
-  dma-ranges:
-    maxItems: 1
-    description: |
-      Describes the physical address space of IOMMU maps to memory.
-
   "#address-cells":
     const: 2
 
@@ -151,7 +146,6 @@ required:
   - reg
   - iommus
   - mediatek,scp
-  - dma-ranges
   - ranges
 
 if:
@@ -184,7 +178,6 @@ examples:
             compatible = "mediatek,mt8192-vcodec-dec";
             mediatek,scp = <&scp>;
             iommus = <&iommu0 M4U_PORT_L4_VDEC_MC_EXT>;
-            dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>;
             #address-cells = <2>;
             #size-cells = <2>;
             ranges = <0 0 0 0x16000000 0 0x40000>;
-- 
2.18.0


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

* [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes
  2022-11-28 14:38 [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Allen-KH Cheng
  2022-11-28 14:38 ` [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder Allen-KH Cheng
  2022-11-28 14:38 ` [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property " Allen-KH Cheng
@ 2022-11-28 14:38 ` Allen-KH Cheng
  2022-11-30 11:27   ` AngeloGioacchino Del Regno
  2022-12-05 21:04   ` Nícolas F. R. A. Prado
  2022-12-01  9:12 ` [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Chen-Yu Tsai
  3 siblings, 2 replies; 12+ messages in thread
From: Allen-KH Cheng @ 2022-11-28 14:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, yunfei.dong,
	Allen-KH Cheng

Add video-codec lat and core nodes for mt8192 SoC.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8192.dtsi | 59 ++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8192.dtsi b/arch/arm64/boot/dts/mediatek/mt8192.dtsi
index 424fc89cc6f7..eb5606204f22 100644
--- a/arch/arm64/boot/dts/mediatek/mt8192.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8192.dtsi
@@ -1452,6 +1452,65 @@
 			power-domains = <&spm MT8192_POWER_DOMAIN_ISP2>;
 		};
 
+		vcodec_dec: video-codec@16000000 {
+			compatible = "mediatek,mt8192-vcodec-dec";
+			reg = <0 0x16000000 0 0x1000>;
+			mediatek,scp = <&scp>;
+			iommus = <&iommu0 M4U_PORT_L4_VDEC_MC_EXT>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges = <0 0 0 0x16000000 0 0x26000>;
+
+			video-codec@10000 {
+				compatible = "mediatek,mtk-vcodec-lat";
+				reg = <0x0 0x10000 0 0x800>;
+				interrupts = <GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH 0>;
+				iommus = <&iommu0 M4U_PORT_L5_VDEC_LAT0_VLD_EXT>,
+					 <&iommu0 M4U_PORT_L5_VDEC_LAT0_VLD2_EXT>,
+					 <&iommu0 M4U_PORT_L5_VDEC_LAT0_AVC_MV_EXT>,
+					 <&iommu0 M4U_PORT_L5_VDEC_LAT0_PRED_RD_EXT>,
+					 <&iommu0 M4U_PORT_L5_VDEC_LAT0_TILE_EXT>,
+					 <&iommu0 M4U_PORT_L5_VDEC_LAT0_WDMA_EXT>,
+					 <&iommu0 M4U_PORT_L5_VDEC_LAT0_RG_CTRL_DMA_EXT>,
+					 <&iommu0 M4U_PORT_L5_VDEC_UFO_ENC_EXT>;
+				clocks = <&topckgen CLK_TOP_VDEC_SEL>,
+					 <&vdecsys_soc CLK_VDEC_SOC_VDEC>,
+					 <&vdecsys_soc CLK_VDEC_SOC_LAT>,
+					 <&vdecsys_soc CLK_VDEC_SOC_LARB1>,
+					 <&topckgen CLK_TOP_MAINPLL_D4>;
+				clock-names = "sel", "soc-vdec", "soc-lat", "vdec", "top";
+				assigned-clocks = <&topckgen CLK_TOP_VDEC_SEL>;
+				assigned-clock-parents = <&topckgen CLK_TOP_MAINPLL_D4>;
+				power-domains = <&spm MT8192_POWER_DOMAIN_VDEC>;
+			};
+
+			video-codec@25000 {
+				compatible = "mediatek,mtk-vcodec-core";
+				reg = <0 0x25000 0 0x1000>;
+				interrupts = <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH 0>;
+				iommus = <&iommu0 M4U_PORT_L4_VDEC_MC_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_UFO_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_PP_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_PRED_RD_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_PRED_WR_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_PPWRAP_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_TILE_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_VLD_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_VLD2_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_AVC_MV_EXT>,
+					 <&iommu0 M4U_PORT_L4_VDEC_RG_CTRL_DMA_EXT>;
+				clocks = <&topckgen CLK_TOP_VDEC_SEL>,
+					 <&vdecsys CLK_VDEC_VDEC>,
+					 <&vdecsys CLK_VDEC_LAT>,
+					 <&vdecsys CLK_VDEC_LARB1>,
+					 <&topckgen CLK_TOP_MAINPLL_D4>;
+				clock-names = "sel", "soc-vdec", "soc-lat", "vdec", "top";
+				assigned-clocks = <&topckgen CLK_TOP_VDEC_SEL>;
+				assigned-clock-parents = <&topckgen CLK_TOP_MAINPLL_D4>;
+				power-domains = <&spm MT8192_POWER_DOMAIN_VDEC2>;
+			};
+		};
+
 		larb5: larb@1600d000 {
 			compatible = "mediatek,mt8192-smi-larb";
 			reg = <0 0x1600d000 0 0x1000>;
-- 
2.18.0


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

* Re: [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property for decoder
  2022-11-28 14:38 ` [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property " Allen-KH Cheng
@ 2022-11-30 11:27   ` AngeloGioacchino Del Regno
  2022-12-01 23:14   ` Rob Herring
  2022-12-05 20:32   ` Nícolas F. R. A. Prado
  2 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-11-30 11:27 UTC (permalink / raw)
  To: Allen-KH Cheng, Mauro Carvalho Chehab, Matthias Brugger,
	Rob Herring, Krzysztof Kozlowski
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, yunfei.dong

Il 28/11/22 15:38, Allen-KH Cheng ha scritto:
> Since commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus
> controllers") was merge, we don't need a dma-ranges property for IOMMU
> in mediatek video codec.
> 
> We remove the dma-ranges property and fix the example in
> mediatek,vcodec-subdev-decoder.yaml
> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


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

* Re: [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes
  2022-11-28 14:38 ` [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes Allen-KH Cheng
@ 2022-11-30 11:27   ` AngeloGioacchino Del Regno
  2022-12-05 21:04   ` Nícolas F. R. A. Prado
  1 sibling, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-11-30 11:27 UTC (permalink / raw)
  To: Allen-KH Cheng, Mauro Carvalho Chehab, Matthias Brugger,
	Rob Herring, Krzysztof Kozlowski
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, yunfei.dong

Il 28/11/22 15:38, Allen-KH Cheng ha scritto:
> Add video-codec lat and core nodes for mt8192 SoC.
> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


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

* Re: [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192
  2022-11-28 14:38 [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Allen-KH Cheng
                   ` (2 preceding siblings ...)
  2022-11-28 14:38 ` [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes Allen-KH Cheng
@ 2022-12-01  9:12 ` Chen-Yu Tsai
  3 siblings, 0 replies; 12+ messages in thread
From: Chen-Yu Tsai @ 2022-12-01  9:12 UTC (permalink / raw)
  To: Allen-KH Cheng
  Cc: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski, Project_Global_Chrome_Upstream_Group,
	linux-media, devicetree, linux-arm-kernel, linux-kernel,
	linux-mediatek, yunfei.dong

On Mon, Nov 28, 2022 at 10:38 PM Allen-KH Cheng
<allen-kh.cheng@mediatek.com> wrote:
>
> This series is based on linux-next.
>
> Change from v4:
>  - Add patch for removing dma-ranges
>  - Update child names to video-codec
>  - Update patch title and message
>
> Change from v3:
>  - Drop `vcodec_lat:` and `vcodec_core:`
>
> Change from v2:
>  - Add a dt-bindings patch for changing "vcodec" to "video-codec"
>  - Rename child names for vcodec lat and core nodes
>
> Change from v1:
>  - Replace node names with video-codec
>   [Allen-KH Cheng <allen-kh.cheng@mediatek.com>]
>
> Allen-KH Cheng (3):
>   media: dt-bindings: media: mediatek: Rename child node names for
>     decoder
>   media: dt-bindings: media: mediatek: Remove "dma-ranges" property for
>     decoder
>   arm64: dts: mt8192: Add video-codec nodes

Whole series is:

Tested-by: Chen-Yu Tsai <wenst@chromium.org>

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

* Re: [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder
  2022-11-28 14:38 ` [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder Allen-KH Cheng
@ 2022-12-01 14:57   ` Krzysztof Kozlowski
  2022-12-05 21:32   ` Nícolas F. R. A. Prado
  1 sibling, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-01 14:57 UTC (permalink / raw)
  To: Allen-KH Cheng, Mauro Carvalho Chehab, Matthias Brugger,
	Rob Herring, Krzysztof Kozlowski
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, yunfei.dong

On 28/11/2022 15:38, Allen-KH Cheng wrote:
> In order to make the names of the child nodes more generic, we rename
> "vcodec-lat" and "vcodec-core" to "video-codec" for decoder in
> patternProperties and example.
> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> ---
>  .../media/mediatek,vcodec-subdev-decoder.yaml | 60 ++-----------------
>  1 file changed, 4 insertions(+), 56 deletions(-)
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property for decoder
  2022-11-28 14:38 ` [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property " Allen-KH Cheng
  2022-11-30 11:27   ` AngeloGioacchino Del Regno
@ 2022-12-01 23:14   ` Rob Herring
  2022-12-05 20:32   ` Nícolas F. R. A. Prado
  2 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2022-12-01 23:14 UTC (permalink / raw)
  To: Allen-KH Cheng
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-media,
	Krzysztof Kozlowski, Mauro Carvalho Chehab, linux-mediatek,
	Matthias Brugger, yunfei.dong, Rob Herring,
	Project_Global_Chrome_Upstream_Group


On Mon, 28 Nov 2022 22:38:31 +0800, Allen-KH Cheng wrote:
> Since commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus
> controllers") was merge, we don't need a dma-ranges property for IOMMU
> in mediatek video codec.
> 
> We remove the dma-ranges property and fix the example in
> mediatek,vcodec-subdev-decoder.yaml
> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> ---
>  .../bindings/media/mediatek,vcodec-subdev-decoder.yaml     | 7 -------
>  1 file changed, 7 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property for decoder
  2022-11-28 14:38 ` [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property " Allen-KH Cheng
  2022-11-30 11:27   ` AngeloGioacchino Del Regno
  2022-12-01 23:14   ` Rob Herring
@ 2022-12-05 20:32   ` Nícolas F. R. A. Prado
  2 siblings, 0 replies; 12+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-12-05 20:32 UTC (permalink / raw)
  To: Allen-KH Cheng
  Cc: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski, Project_Global_Chrome_Upstream_Group,
	linux-media, devicetree, linux-arm-kernel, linux-kernel,
	linux-mediatek, yunfei.dong

On Mon, Nov 28, 2022 at 10:38:31PM +0800, Allen-KH Cheng wrote:
> Since commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus
> controllers") was merge, we don't need a dma-ranges property for IOMMU
> in mediatek video codec.

This description isn't right, as it gives the impression that the mentioned
commit removed the need for having a dma-ranges property, but that isn't the
case, the property wasn't needed even before that commit. That commit did
however expose the fact that having this property didn't make sense in the first
place.

Here's a suggestion:

	The decoder nodes already make use of the iommus property to configure the IOMMU
	for address translations, so also having a dma-ranges property doesn't make
	sense.

	In fact, after commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus
	controllers"), having a dma-ranges property causes IOMMU faults.

	Remove the dma-ranges property and update the example.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes
  2022-11-28 14:38 ` [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes Allen-KH Cheng
  2022-11-30 11:27   ` AngeloGioacchino Del Regno
@ 2022-12-05 21:04   ` Nícolas F. R. A. Prado
  1 sibling, 0 replies; 12+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-12-05 21:04 UTC (permalink / raw)
  To: Allen-KH Cheng
  Cc: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski, Project_Global_Chrome_Upstream_Group,
	linux-media, devicetree, linux-arm-kernel, linux-kernel,
	linux-mediatek, yunfei.dong

On Mon, Nov 28, 2022 at 10:38:32PM +0800, Allen-KH Cheng wrote:
> Add video-codec lat and core nodes for mt8192 SoC.

Even though the rule is to use generic names in the DT, here in the commit
message and title I would have called them "video decoder nodes", to be more
specific and differentiate from the encoder nodes. But the way you wrote is not
wrong, so feel free to ignore this comment and leave it as it is.

> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder
  2022-11-28 14:38 ` [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder Allen-KH Cheng
  2022-12-01 14:57   ` Krzysztof Kozlowski
@ 2022-12-05 21:32   ` Nícolas F. R. A. Prado
  1 sibling, 0 replies; 12+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-12-05 21:32 UTC (permalink / raw)
  To: Allen-KH Cheng
  Cc: Mauro Carvalho Chehab, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski, Project_Global_Chrome_Upstream_Group,
	linux-media, devicetree, linux-arm-kernel, linux-kernel,
	linux-mediatek, yunfei.dong

On Mon, Nov 28, 2022 at 10:38:30PM +0800, Allen-KH Cheng wrote:
> In order to make the names of the child nodes more generic, we rename
> "vcodec-lat" and "vcodec-core" to "video-codec" for decoder in
> patternProperties and example.
> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> ---
>  .../media/mediatek,vcodec-subdev-decoder.yaml | 60 ++-----------------
>  1 file changed, 4 insertions(+), 56 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> index c4f20acdc1f8..695402041e04 100644
> --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> @@ -91,12 +91,13 @@ properties:
>  
>  # Required child node:
>  patternProperties:
> -  '^vcodec-lat@[0-9a-f]+$':
> +  '^video-codec@[0-9a-f]+$':
>      type: object
>  
>      properties:
>        compatible:
>          enum:
> +          - mediatek,mtk-vcodec-core
>            - mediatek,mtk-vcodec-lat
>            - mediatek,mtk-vcodec-lat-soc
>  
> @@ -145,59 +146,6 @@ patternProperties:
>  
>      additionalProperties: false
>  
> -  '^vcodec-core@[0-9a-f]+$':
> -    type: object
> -
> -    properties:
> -      compatible:
> -        const: mediatek,mtk-vcodec-core
> -
> -      reg:
> -        maxItems: 1
> -
> -      interrupts:
> -        maxItems: 1
> -
> -      iommus:
> -        minItems: 1
> -        maxItems: 32
> -        description: |
> -          List of the hardware port in respective IOMMU block for current Socs.
> -          Refer to bindings/iommu/mediatek,iommu.yaml.
> -
> -      clocks:
> -        maxItems: 5
> -
> -      clock-names:
> -        items:
> -          - const: sel
> -          - const: soc-vdec
> -          - const: soc-lat
> -          - const: vdec
> -          - const: top
> -
> -      assigned-clocks:
> -        maxItems: 1
> -
> -      assigned-clock-parents:
> -        maxItems: 1
> -
> -      power-domains:
> -        maxItems: 1
> -
> -    required:
> -      - compatible
> -      - reg
> -      - interrupts

Looks like interrupts was required for vcodec-core, but it isn't for the generic
video-codec node. Which seems correct, given that the vcodec-lat-soc doesn't
have an interrupt [1]. So I guess this is just the generic video-codec node in
the binding being too generic for some cases. Ideally we would override
interrupts to be required based on which subnode we're dealing with (for lat and
core, but not lat-soc), but given these are subnodes matched through
patternProperties, I'm not sure that would be possible.

[1] https://lore.kernel.org/all/20221202034450.3808-3-yunfei.dong@mediatek.com/

Thanks,
Nícolas

> -      - iommus
> -      - clocks
> -      - clock-names
> -      - assigned-clocks
> -      - assigned-clock-parents
> -      - power-domains
> -
> -    additionalProperties: false
> -

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

end of thread, other threads:[~2022-12-05 21:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 14:38 [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Allen-KH Cheng
2022-11-28 14:38 ` [PATCH v5 1/3] media: dt-bindings: media: mediatek: Rename child node names for decoder Allen-KH Cheng
2022-12-01 14:57   ` Krzysztof Kozlowski
2022-12-05 21:32   ` Nícolas F. R. A. Prado
2022-11-28 14:38 ` [PATCH v5 2/3] media: dt-bindings: media: mediatek: Remove "dma-ranges" property " Allen-KH Cheng
2022-11-30 11:27   ` AngeloGioacchino Del Regno
2022-12-01 23:14   ` Rob Herring
2022-12-05 20:32   ` Nícolas F. R. A. Prado
2022-11-28 14:38 ` [PATCH v5 3/3] arm64: dts: mt8192: Add video-codec nodes Allen-KH Cheng
2022-11-30 11:27   ` AngeloGioacchino Del Regno
2022-12-05 21:04   ` Nícolas F. R. A. Prado
2022-12-01  9:12 ` [PATCH v5 0/3] Add vcodec lat and core nodes for mt8192 Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).