Hi,
This series enables Hantro support for RK3588. It is based on these two
previous series from Emmanuel Gil Peyrot and Jianfeng Liu, which looked
stall to me. Considering the full driver is already upstream, I think
this low hanging fruit should be enabled in 6.11:
* https://lore.kernel.org/all/[email protected]/
* https://lore.kernel.org/linux-rockchip/[email protected]/
Their series got some feedback from Nicolas Dufresne, that there should be a
plan how multi-core processing will be handled once it is supported in the
kernel. I had a look (and internal discussion with Nicolas) and came up with a
patch, which allows describing all the Hantro IP in DT. The driver will only
probe for the first instance. This involves dropping the RK3568 compatible
for the VEPU121, so that only kernels with the driver change will try to
handle these IP. Once the kernel is capable of multi-core support, the same
technique to disable cores 1-3 can be used to combine them all into one
cluster.
We also discussed, if they should be described as a cluster (e.g. by creating
some kind of virtual bus for the 4 encoders in DT). Apparently the VSI doc
describes the grouping of up to 4 instances. But there is no obvious reason
why only these groups can be used as a cluster. It seems that even the 5th
encoder from the combo VPU121 could be used together with the other clustered
cores in theory. In practice this is probably a bad idea because of the shared
cache of that encoder. Since that is handled with a different compatible, this
can be thought about at a later point of time and handled in the kernel. Thus
no special cluster description is needed in DT.
The series is based on Heiko's for-next branch.
Changes since PATCHv3 (VEPU121) / PATCHv4 (VPU121)
* combine both patchsets, since there is some overleap
* add patch to disable multi-core handling in the hantro driver
* drop the RK3568 fallback compatible for VEPU (see above for the reason)
* describe all RK3588 VEPU cores (possible because of driver change)
Greetings,
-- Sebastian
Emmanuel Gil Peyrot (2):
media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121
arm64: dts: rockchip: Add VEPU121 to RK3588
Jianfeng Liu (2):
media: dt-bindings: rockchip-vpu: Add RK3588 VPU121
arm64: dts: rockchip: Add VPU121 support for RK3588
Sebastian Reichel (1):
media: hantro: Add RK3588 VEPU121 support
.../bindings/media/rockchip,rk3568-vepu.yaml | 5 +-
.../bindings/media/rockchip-vpu.yaml | 3 +
arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 101 ++++++++++++++++++
.../media/platform/verisilicon/hantro_drv.c | 38 +++++++
4 files changed, 145 insertions(+), 2 deletions(-)
--
2.43.0
From: Jianfeng Liu <[email protected]>
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 <[email protected]>
Tested-by: Hugh Cole-Baker <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
---
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 9edbcfe778ca..e7e1b456b9b9 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -1239,6 +1239,27 @@ jpeg_enc3_mmu: iommu@fdbac800 {
#iommu-cells = <0>;
};
+ 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.43.0
Hi,
On Wednesday, 12 June 2024 19:15:45 CEST Sebastian Reichel wrote:
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index
> 9edbcfe778ca..e7e1b456b9b9 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> @@ -1239,6 +1239,27 @@ jpeg_enc3_mmu: iommu@fdbac800 {
> #iommu-cells = <0>;
> };
>
> + 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 {
Shouldn't these nodes come *before*
jpeg_enc0: video-codec@fdba0000
As fdb50000 is lower then fdba0000?
Cheers,
Diederik
Hi,
On Wed, Jun 12, 2024 at 08:10:30PM GMT, Diederik de Haas wrote:
> On Wednesday, 12 June 2024 19:15:45 CEST Sebastian Reichel wrote:
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> > b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index
> > 9edbcfe778ca..e7e1b456b9b9 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> > +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> > @@ -1239,6 +1239,27 @@ jpeg_enc3_mmu: iommu@fdbac800 {
> > #iommu-cells = <0>;
> > };
> >
> > + 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 {
>
> Shouldn't these nodes come *before*
> jpeg_enc0: video-codec@fdba0000
> As fdb50000 is lower then fdba0000?
Of course. I will fix that in v6.
-- Sebastian