Linux-ARM-Kernel Archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/2] Add hantro g1 video decoder support for RK3588
@ 2024-04-30  2:40 Jianfeng Liu
  2024-04-30  2:40 ` [PATCH v7 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string Jianfeng Liu
  2024-04-30  2:40 ` [PATCH v7 2/2] arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588 Jianfeng Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Jianfeng Liu @ 2024-04-30  2:40 UTC (permalink / raw
  To: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: ezequiel, p.zabel, mchehab, robh, krzk+dt, conor+dt, heiko,
	sebastian.reichel, liujianfeng1994, sfr, sigmaris, nicolas,
	linkmauve

This is the v7 version of this series adding hantro g1 video decoder
support for RK3588.

RK3588 has Hantro G1 video decoder known as VDPU121 in TRM of RK3588 which
is capable to decode MPEG2/H.264/VP8 up to 1920x1088. This vpu ip is also
found in RK3568.

Test results from fluster can be found from thread of v3[1].

Changes in v7:
 - Change compatible string from vdpu121 to vpu121 to match the real
   hardware
 - Change the devicetree node vdpu_mmu to vpu_mmu because this mmu is
   also used by vepu121 jpeg encoder
 - Link to v6: https://lore.kernel.org/all/20240418111002.83015-1-liujianfeng1994@gmail.com/

Changes in v6:
 - Apply dt-bindings first
 - Collect missing commit tags of old versions
 - Specify the base commit suggested by Diederik
 - Link to v5: https://lore.kernel.org/all/20240413064608.788561-1-liujianfeng1994@gmail.com/

Changes in v5:
 - Add missing interrupt-names to devicetree node
 - Rebase devicetree patch based on next-20240412
 - Link to v4: https://lore.kernel.org/all/20240316071100.2419369-1-liujianfeng1994@gmail.com/

Changes in v4:
 - Change compatible string to rockchip,rk3588-vdpu121
 - Link to v3: https://lore.kernel.org/all/20231231151112.3994194-1-liujianfeng1994@gmail.com/

Changes in v3:
 - Drop code in hantro_drv.c because hantro g1 vpu in rk3588 is compatible
with the one in rk3568, only adding devicetree node should work.
 - Change devicetree node name to video-codec@fdb50000 to match the reg
address.
 - Add dt-bindings rockchip,rk3588-vpu compatible with rockchip,rk3568-vpu
 - Link to v2: https://lore.kernel.org/all/20231228131617.3411561-1-liujianfeng1994@gmail.com

Changes in v2:
- Fix alphabetical order in patch1 and patch3
- Sort device tree node by bus-address
- Drop rk3588_vpu_variant fron v1 because that is exactly the same as rk3568_vpu_variant
- Link to v1: https://lore.kernel.org/all/20231227173911.3295410-1-liujianfeng1994@gmail.com

[1]https://lore.kernel.org/all/20240118080602.9028-1-liujianfeng1994@gmail.com/

Jianfeng Liu (2):
  dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string
  arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588

 .../bindings/media/rockchip-vpu.yaml          |  3 +++
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     | 21 +++++++++++++++++++
 2 files changed, 24 insertions(+)


base-commit: b0a2c79c6f3590b74742cbbc76687014d47972d8
--
2.34.1


_______________________________________________
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] 5+ messages in thread

* [PATCH v7 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string
  2024-04-30  2:40 [PATCH v7 0/2] Add hantro g1 video decoder support for RK3588 Jianfeng Liu
@ 2024-04-30  2:40 ` Jianfeng Liu
  2024-04-30 16:21   ` Nicolas Dufresne
  2024-04-30  2:40 ` [PATCH v7 2/2] arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588 Jianfeng Liu
  1 sibling, 1 reply; 5+ messages in thread
From: Jianfeng Liu @ 2024-04-30  2:40 UTC (permalink / raw
  To: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: ezequiel, p.zabel, mchehab, robh, krzk+dt, conor+dt, heiko,
	sebastian.reichel, liujianfeng1994, sfr, sigmaris, nicolas,
	linkmauve, Conor Dooley

Add Hantro G1 VPU compatible string for RK3588.
RK3588 has the same Hantro G1 ip as RK3568, which are both
known as VDPU121 in TRM of RK3568 and RK3588.

Note that this VPU also has a jpeg encoder, which is one part of
the five VEPU121 jpeg encoders on RK3588. So this VPU121 shoud be
the same as vpu@ff650000 on RK3399. But we don't use the compatible
string rk3399-vpu because of two reasons:
1, rk3399-vpu has disabled H264 decoding because RK3399 also has
rkvdec to support 4K H264 decoding. And we need H264 decoding because
rkvdec2 on rk3588 for H264 decoding is not supported now.
2, There are five VEPU121 jpeg encoders, but the kernel driver can't
do scheduling. So it's better to disable the VEPU121 jpeg encoder
at the moment.

Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
index c57e1f488..2710bb2fb 100644
--- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
@@ -31,6 +31,9 @@ properties:
       - items:
           - const: rockchip,rk3228-vpu
           - const: rockchip,rk3399-vpu
+      - items:
+          - const: rockchip,rk3588-vpu121
+          - const: rockchip,rk3568-vpu

   reg:
     maxItems: 1
--
2.34.1


_______________________________________________
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] 5+ messages in thread

* [PATCH v7 2/2] arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588
  2024-04-30  2:40 [PATCH v7 0/2] Add hantro g1 video decoder support for RK3588 Jianfeng Liu
  2024-04-30  2:40 ` [PATCH v7 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string Jianfeng Liu
@ 2024-04-30  2:40 ` Jianfeng Liu
  1 sibling, 0 replies; 5+ messages in thread
From: Jianfeng Liu @ 2024-04-30  2:40 UTC (permalink / raw
  To: linux-media, linux-rockchip, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: ezequiel, p.zabel, mchehab, robh, krzk+dt, conor+dt, heiko,
	sebastian.reichel, liujianfeng1994, sfr, sigmaris, nicolas,
	linkmauve

Enable Hantro G1 video decoder in RK3588's devicetree.

Tested with FFmpeg v4l2_request code taken from [1]
with MPEG2, H.264 and VP8 samples.

[1] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch

Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Tested-by: Hugh Cole-Baker <sigmaris@gmail.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
index b0a59ec51..da10df7d6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -1135,6 +1135,27 @@ power-domain@RK3588_PD_SDMMC {
 		};
 	};

+	vpu: video-codec@fdb50000 {
+		compatible = "rockchip,rk3588-vpu121", "rockchip,rk3568-vpu";
+		reg = <0x0 0xfdb50000 0x0 0x800>;
+		interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH 0>;
+		interrupt-names = "vdpu";
+		clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+		clock-names = "aclk", "hclk";
+		iommus = <&vpu_mmu>;
+		power-domains = <&power RK3588_PD_VDPU>;
+	};
+
+	vpu_mmu: iommu@fdb50800 {
+		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
+		reg = <0x0 0xfdb50800 0x0 0x40>;
+		interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH 0>;
+		clock-names = "aclk", "iface";
+		clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+		power-domains = <&power RK3588_PD_VDPU>;
+		#iommu-cells = <0>;
+	};
+
 	av1d: video-codec@fdc70000 {
 		compatible = "rockchip,rk3588-av1-vpu";
 		reg = <0x0 0xfdc70000 0x0 0x800>;
--
2.34.1


_______________________________________________
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] 5+ messages in thread

* Re: [PATCH v7 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string
  2024-04-30  2:40 ` [PATCH v7 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string Jianfeng Liu
@ 2024-04-30 16:21   ` Nicolas Dufresne
  2024-04-30 16:26     ` Nicolas Dufresne
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Dufresne @ 2024-04-30 16:21 UTC (permalink / raw
  To: Jianfeng Liu, linux-media, linux-rockchip, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: ezequiel, p.zabel, mchehab, robh, krzk+dt, conor+dt, heiko,
	sebastian.reichel, sfr, sigmaris, linkmauve, Conor Dooley

Hi,

Le mardi 30 avril 2024 à 10:40 +0800, Jianfeng Liu a écrit :
> Add Hantro G1 VPU compatible string for RK3588.
> RK3588 has the same Hantro G1 ip as RK3568, which are both
> known as VDPU121 in TRM of RK3568 and RK3588.
> 
> Note that this VPU also has a jpeg encoder, which is one part of
> the five VEPU121 jpeg encoders on RK3588. So this VPU121 shoud be
> the same as vpu@ff650000 on RK3399. But we don't use the compatible
> string rk3399-vpu because of two reasons:
> 1, rk3399-vpu has disabled H264 decoding because RK3399 also has
> rkvdec to support 4K H264 decoding. And we need H264 decoding because
> rkvdec2 on rk3588 for H264 decoding is not supported now.
> 2, There are five VEPU121 jpeg encoders, but the kernel driver can't
> do scheduling. So it's better to disable the VEPU121 jpeg encoder
> at the moment.
> 
> Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> index c57e1f488..2710bb2fb 100644
> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> @@ -31,6 +31,9 @@ properties:
>        - items:
>            - const: rockchip,rk3228-vpu
>            - const: rockchip,rk3399-vpu
> +      - items:
> +          - const: rockchip,rk3588-vpu121
> +          - const: rockchip,rk3568-vpu

Sorry to come that late, but I'm noticing a big mistake here. You said you are
enabling VDPU121, the JPEG decoder. But we don't have a JPEG decoder driver
mainline, is there some patches missing ?

Nicolas

> 
>    reg:
>      maxItems: 1
> --
> 2.34.1
> 


_______________________________________________
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] 5+ messages in thread

* Re: [PATCH v7 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string
  2024-04-30 16:21   ` Nicolas Dufresne
@ 2024-04-30 16:26     ` Nicolas Dufresne
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Dufresne @ 2024-04-30 16:26 UTC (permalink / raw
  To: Jianfeng Liu, linux-media, linux-rockchip, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: ezequiel, p.zabel, mchehab, robh, krzk+dt, conor+dt, heiko,
	sebastian.reichel, sfr, sigmaris, linkmauve, Conor Dooley

Sorry,


[...]
> > +          - const: rockchip,rk3568-vpu
> 
> Sorry to come that late, but I'm noticing a big mistake here. You said you are
> enabling VDPU121, the JPEG decoder. But we don't have a JPEG decoder driver
> mainline, is there some patches missing ?
> 
> Nicolas

Ignore this part, just didn't read carefully. This is about getting H264, VP8
and MPEG2 out of these extra cores of course. I still would like to know how we
will express the grouping of these four cores, so a driver can know they are
identical G1 cores and not bound to be time sliced with an H1 core like the
fifth one? I want to see a plan that will work and will not cause headache for
future work on fully utilizing the HW resources.

Nicolas

_______________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2024-04-30 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30  2:40 [PATCH v7 0/2] Add hantro g1 video decoder support for RK3588 Jianfeng Liu
2024-04-30  2:40 ` [PATCH v7 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vpu121 compatible string Jianfeng Liu
2024-04-30 16:21   ` Nicolas Dufresne
2024-04-30 16:26     ` Nicolas Dufresne
2024-04-30  2:40 ` [PATCH v7 2/2] arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588 Jianfeng Liu

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 read-only IMAP folder(s) and NNTP newsgroup(s).