linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Rockchip RK3328 VDEC support
@ 2022-04-25 12:32 Christopher Obbard
  2022-04-25 12:32 ` [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible Christopher Obbard
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christopher Obbard @ 2022-04-25 12:32 UTC (permalink / raw)
  To: Ezequiel Garcia, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Heiko Stuebner, Johan Jonker, Elaine Zhang
  Cc: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel, kernel, Christopher Obbard

This series adds VDEC support for the Rockchip RK3328 SoC which
uses the staging rkvdec driver.

Testing was performed using both v4l-compliance and (mainline) gstreamer
using the fluster framework:

    $ v4l2-compliance -m0
    v4l2-compliance 1.22.1, 64 bits, 64-bit time_t
    ...
    Grand Total for rkvdec device /dev/media0: 54, Succeeded: 54, Failed: 0, Warnings: 0


    $ python3 fluster.py run -j1 -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0
    ...
    Ran 111/135 tests successfully               in 392.885 secs


    $ python3 fluster.py run -j1 -ts VP9-TEST-VECTORS -d GStreamer-VP9-V4L2SL-Gst1.0
    ...
    Ran 206/303 tests successfully               in 1170.120 secs


Changes in v2:
 - Fix mistake in dt-binding compatible documentation
 - Remove unused reset nodes from devicetree
 - Improve some commit messages
 - Check all dts files against dtbs_check
 - Collect review tags on unchanged patches

Christopher Obbard (3):
  media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible
  arm64: dts: rockchip: Rename vdec_mmu node for RK3328
  arm64: dts: rockchip: Add vdec support for RK3328

 .../bindings/media/rockchip,vdec.yaml         |  3 +++
 arch/arm64/boot/dts/rockchip/rk3328.dtsi      | 22 +++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

-- 
2.34.1


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

* [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible
  2022-04-25 12:32 [PATCH v2 0/3] Rockchip RK3328 VDEC support Christopher Obbard
@ 2022-04-25 12:32 ` Christopher Obbard
  2022-04-25 18:07   ` Krzysztof Kozlowski
  2022-04-25 12:32 ` [PATCH v2 2/3] arm64: dts: rockchip: Rename vdec_mmu node for RK3328 Christopher Obbard
  2022-04-25 12:32 ` [PATCH v2 3/3] arm64: dts: rockchip: Add vdec support " Christopher Obbard
  2 siblings, 1 reply; 6+ messages in thread
From: Christopher Obbard @ 2022-04-25 12:32 UTC (permalink / raw)
  To: Ezequiel Garcia, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Heiko Stuebner, Johan Jonker, Elaine Zhang
  Cc: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel, kernel, Christopher Obbard

Document the RK3328 compatible for rockchip-vdec.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
---
 Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
index 089f11d21b25..ce06835e8d61 100644
--- a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
@@ -20,6 +20,9 @@ properties:
       - items:
           - const: rockchip,rk3228-vdec
           - const: rockchip,rk3399-vdec
+      - items:
+          - const: rockchip,rk3328-vdec
+          - const: rockchip,rk3399-vdec
 
   reg:
     maxItems: 1
-- 
2.34.1


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

* [PATCH v2 2/3] arm64: dts: rockchip: Rename vdec_mmu node for RK3328
  2022-04-25 12:32 [PATCH v2 0/3] Rockchip RK3328 VDEC support Christopher Obbard
  2022-04-25 12:32 ` [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible Christopher Obbard
@ 2022-04-25 12:32 ` Christopher Obbard
  2022-04-25 12:32 ` [PATCH v2 3/3] arm64: dts: rockchip: Add vdec support " Christopher Obbard
  2 siblings, 0 replies; 6+ messages in thread
From: Christopher Obbard @ 2022-04-25 12:32 UTC (permalink / raw)
  To: Ezequiel Garcia, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Heiko Stuebner, Johan Jonker, Elaine Zhang
  Cc: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel, kernel, Christopher Obbard

All other rockchip devices which have vdec nodes do not
have an rk prefix. Remove the prefix from the (currently
unused) rkvdec_mmu node for consistency with other
devices.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index b822533dc7f1..f8ef149fedad 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -660,7 +660,7 @@ vpu_mmu: iommu@ff350800 {
 		power-domains = <&power RK3328_PD_VPU>;
 	};
 
-	rkvdec_mmu: iommu@ff360480 {
+	vdec_mmu: iommu@ff360480 {
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff360480 0x0 0x40>, <0x0 0xff3604c0 0x0 0x40>;
 		interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
-- 
2.34.1


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

* [PATCH v2 3/3] arm64: dts: rockchip: Add vdec support for RK3328
  2022-04-25 12:32 [PATCH v2 0/3] Rockchip RK3328 VDEC support Christopher Obbard
  2022-04-25 12:32 ` [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible Christopher Obbard
  2022-04-25 12:32 ` [PATCH v2 2/3] arm64: dts: rockchip: Rename vdec_mmu node for RK3328 Christopher Obbard
@ 2022-04-25 12:32 ` Christopher Obbard
  2 siblings, 0 replies; 6+ messages in thread
From: Christopher Obbard @ 2022-04-25 12:32 UTC (permalink / raw)
  To: Ezequiel Garcia, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Heiko Stuebner, Johan Jonker, Elaine Zhang
  Cc: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel, kernel, Christopher Obbard

The RK3328 has an vdec device with dedicated iommu.
Describe the vdec device, the required power-domains
and enable the iommu in the devicetree.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index f8ef149fedad..49ae15708a0b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -306,6 +306,10 @@ power-domain@RK3328_PD_HEVC {
 			};
 			power-domain@RK3328_PD_VIDEO {
 				reg = <RK3328_PD_VIDEO>;
+				clocks = <&cru ACLK_RKVDEC>,
+					 <&cru HCLK_RKVDEC>,
+					 <&cru SCLK_VDEC_CABAC>,
+					 <&cru SCLK_VDEC_CORE>;
 				#power-domain-cells = <0>;
 			};
 			power-domain@RK3328_PD_VPU {
@@ -660,6 +664,20 @@ vpu_mmu: iommu@ff350800 {
 		power-domains = <&power RK3328_PD_VPU>;
 	};
 
+	vdec: video-codec@ff360000 {
+		compatible = "rockchip,rk3328-vdec", "rockchip,rk3399-vdec";
+		reg = <0x0 0xff360000 0x0 0x400>;
+		interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>,
+			 <&cru SCLK_VDEC_CABAC>, <&cru SCLK_VDEC_CORE>;
+		clock-names = "axi", "ahb", "cabac", "core";
+		assigned-clocks = <&cru ACLK_RKVDEC>, <&cru SCLK_VDEC_CABAC>,
+				  <&cru SCLK_VDEC_CORE>;
+		assigned-clock-rates = <400000000>, <400000000>, <300000000>;
+		iommus = <&vdec_mmu>;
+		power-domains = <&power RK3328_PD_VIDEO>;
+	};
+
 	vdec_mmu: iommu@ff360480 {
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff360480 0x0 0x40>, <0x0 0xff3604c0 0x0 0x40>;
@@ -667,7 +685,7 @@ vdec_mmu: iommu@ff360480 {
 		clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>;
 		clock-names = "aclk", "iface";
 		#iommu-cells = <0>;
-		status = "disabled";
+		power-domains = <&power RK3328_PD_VIDEO>;
 	};
 
 	vop: vop@ff370000 {
-- 
2.34.1


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

* Re: [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible
  2022-04-25 12:32 ` [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible Christopher Obbard
@ 2022-04-25 18:07   ` Krzysztof Kozlowski
  2022-04-25 18:47     ` Christopher Obbard
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-25 18:07 UTC (permalink / raw)
  To: Christopher Obbard, Ezequiel Garcia, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Heiko Stuebner, Johan Jonker,
	Elaine Zhang
  Cc: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel, kernel

On 25/04/2022 14:32, Christopher Obbard wrote:
> Document the RK3328 compatible for rockchip-vdec.
> 
> Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
> ---
>  Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
> index 089f11d21b25..ce06835e8d61 100644
> --- a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
> +++ b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
> @@ -20,6 +20,9 @@ properties:
>        - items:
>            - const: rockchip,rk3228-vdec
>            - const: rockchip,rk3399-vdec
> +      - items:
> +          - const: rockchip,rk3328-vdec
> +          - const: rockchip,rk3399-vdec


This should be rather an enum with rk3228, so:
- enum
   - rockchip,rk3228-vdec
   - rockchip,rk3328-vdec
- const: rockchip,rk3399-vdec

Best regards,
Krzysztof

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

* Re: [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible
  2022-04-25 18:07   ` Krzysztof Kozlowski
@ 2022-04-25 18:47     ` Christopher Obbard
  0 siblings, 0 replies; 6+ messages in thread
From: Christopher Obbard @ 2022-04-25 18:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Ezequiel Garcia, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Heiko Stuebner, Johan Jonker,
	Elaine Zhang
  Cc: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel, kernel


On 25/04/2022 19:07, Krzysztof Kozlowski wrote:
> On 25/04/2022 14:32, Christopher Obbard wrote:
>> Document the RK3328 compatible for rockchip-vdec.
>>
>> Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
>> ---
>>   Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
>> index 089f11d21b25..ce06835e8d61 100644
>> --- a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
>> +++ b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
>> @@ -20,6 +20,9 @@ properties:
>>         - items:
>>             - const: rockchip,rk3228-vdec
>>             - const: rockchip,rk3399-vdec
>> +      - items:
>> +          - const: rockchip,rk3328-vdec
>> +          - const: rockchip,rk3399-vdec
> 
> 
> This should be rather an enum with rk3228, so:
> - enum
>     - rockchip,rk3228-vdec
>     - rockchip,rk3328-vdec
> - const: rockchip,rk3399-vdec


Thanks for your patience with reviewing the series. I sent v3 which 
should finally solve this now.

Cheers!

Chris

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

end of thread, other threads:[~2022-04-25 18:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 12:32 [PATCH v2 0/3] Rockchip RK3328 VDEC support Christopher Obbard
2022-04-25 12:32 ` [PATCH v2 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible Christopher Obbard
2022-04-25 18:07   ` Krzysztof Kozlowski
2022-04-25 18:47     ` Christopher Obbard
2022-04-25 12:32 ` [PATCH v2 2/3] arm64: dts: rockchip: Rename vdec_mmu node for RK3328 Christopher Obbard
2022-04-25 12:32 ` [PATCH v2 3/3] arm64: dts: rockchip: Add vdec support " Christopher Obbard

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).