devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/6] RK3588 VEPU121/VPU121 support
@ 2024-06-13 13:48 Sebastian Reichel
  2024-06-13 13:48 ` [PATCH v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 Sebastian Reichel
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-13 13:48 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel

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/20240316071100.2419369-1-liujianfeng1994@gmail.com/
 * https://lore.kernel.org/linux-rockchip/20240412151515.837824-1-linkmauve@linkmauve.fr/

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.

Changes since PATCHv5:
 * Fix binding for vepu121 (use enum)
 * split hantro driver patch (multicore / vepu121 compatible)
 * move video-codec@fdb50000 node to correct position
 * change "jpeg_enc*" alias to "vepu121_*"
 * change "vpu_*" alias to "vpu121_*" (to be consistent)

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 (2):
  media: hantro: Disable multicore support
  media: hantro: Add RK3588 VEPU121

 .../bindings/media/rockchip,rk3568-vepu.yaml  |   1 +
 .../bindings/media/rockchip-vpu.yaml          |   3 +
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     | 101 ++++++++++++++++++
 .../media/platform/verisilicon/hantro_drv.c   |  38 +++++++
 4 files changed, 143 insertions(+)

-- 
2.43.0


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

* [PATCH v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121
  2024-06-13 13:48 [PATCH v6 0/6] RK3588 VEPU121/VPU121 support Sebastian Reichel
@ 2024-06-13 13:48 ` Sebastian Reichel
  2024-06-13 16:22   ` Conor Dooley
  2024-06-13 13:48 ` [PATCH v6 2/6] media: dt-bindings: rockchip-vpu: Add RK3588 VPU121 Sebastian Reichel
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-13 13:48 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, kernel,
	Sebastian Reichel

From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>

This encoder-only device is present four times on this SoC, and should
support everything the rk3568 vepu supports (so JPEG, H.264 and VP8
encoding). No fallback compatible has been added, since the operating
systems might already support RK3568 VEPU and want to avoid registering
four of them separately considering they can be used as a cluster.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../devicetree/bindings/media/rockchip,rk3568-vepu.yaml          | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml
index 9d90d8d0565a..947ad699cc5e 100644
--- a/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml
@@ -17,6 +17,7 @@ properties:
   compatible:
     enum:
       - rockchip,rk3568-vepu
+      - rockchip,rk3588-vepu121
 
   reg:
     maxItems: 1
-- 
2.43.0


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

* [PATCH v6 2/6] media: dt-bindings: rockchip-vpu: Add RK3588 VPU121
  2024-06-13 13:48 [PATCH v6 0/6] RK3588 VEPU121/VPU121 support Sebastian Reichel
  2024-06-13 13:48 ` [PATCH v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 Sebastian Reichel
@ 2024-06-13 13:48 ` Sebastian Reichel
  2024-06-13 13:48 ` [PATCH v6 3/6] media: hantro: Disable multicore support Sebastian Reichel
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-13 13:48 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, kernel, Conor Dooley,
	Sebastian Reichel

From: Jianfeng Liu <liujianfeng1994@gmail.com>

RK3588 has four Hantro H1 VEPUs (encoder-only) modules and one combined
Hantro H1/G1 VPU (decoder and encoder). These are not described as
separate IP, since they are sharing an internal cache. This adds the
RK3588 specific compatible string for the combined VPU, which seems to
be identical to the version found in the RK3568.

Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-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 c57e1f488895..2710bb2fb0d1 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.43.0


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

* [PATCH v6 3/6] media: hantro: Disable multicore support
  2024-06-13 13:48 [PATCH v6 0/6] RK3588 VEPU121/VPU121 support Sebastian Reichel
  2024-06-13 13:48 ` [PATCH v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 Sebastian Reichel
  2024-06-13 13:48 ` [PATCH v6 2/6] media: dt-bindings: rockchip-vpu: Add RK3588 VPU121 Sebastian Reichel
@ 2024-06-13 13:48 ` Sebastian Reichel
  2024-06-13 13:48 ` [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121 Sebastian Reichel
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-13 13:48 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel

Avoid exposing equal Hantro video codecs to userspace. Equal video
codecs allow scheduling work between the cores. For that kernel support
is required, which does not yet exist. Until that is implemented avoid
exposing each core separately to userspace so that multicore can be
added in the future without breaking userspace ABI.

This was written with Rockchip RK3588 in mind (which has 4 Hantro H1
cores), but applies to all SoCs.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../media/platform/verisilicon/hantro_drv.c   | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 34b123dafd89..7123479b3eab 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -992,6 +992,39 @@ static const struct media_device_ops hantro_m2m_media_ops = {
 	.req_queue = v4l2_m2m_request_queue,
 };
 
+/*
+ * Some SoCs, like RK3588 have multiple identical Hantro cores, but the
+ * kernel is currently missing support for multi-core handling. Exposing
+ * separate devices for each core to userspace is bad, since that does
+ * not allow scheduling tasks properly (and creates ABI). With this workaround
+ * the driver will only probe for the first core and early exit for the other
+ * cores. Once the driver gains multi-core support, the same technique
+ * for detecting the main core can be used to cluster all cores together.
+ */
+static int hantro_disable_multicore(struct hantro_dev *vpu)
+{
+	const char *compatible;
+	struct device_node *node;
+	int ret;
+
+	/* Intentionally ignores the fallback strings */
+	ret = of_property_read_string(vpu->dev->of_node, "compatible", &compatible);
+	if (ret)
+		return ret;
+
+	/* first compatible node found from the root node is considered the main core */
+	node = of_find_compatible_node(NULL, NULL, compatible);
+	if (!node)
+		return -EINVAL; /* broken DT? */
+
+	if (vpu->dev->of_node != node) {
+		dev_info(vpu->dev, "missing multi-core support, ignoring this instance\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
 static int hantro_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *match;
@@ -1011,6 +1044,10 @@ static int hantro_probe(struct platform_device *pdev)
 	match = of_match_node(of_hantro_match, pdev->dev.of_node);
 	vpu->variant = match->data;
 
+	ret = hantro_disable_multicore(vpu);
+	if (ret)
+		return ret;
+
 	/*
 	 * Support for nxp,imx8mq-vpu is kept for backwards compatibility
 	 * but it's deprecated. Please update your DTS file to use
-- 
2.43.0


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

* [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121
  2024-06-13 13:48 [PATCH v6 0/6] RK3588 VEPU121/VPU121 support Sebastian Reichel
                   ` (2 preceding siblings ...)
  2024-06-13 13:48 ` [PATCH v6 3/6] media: hantro: Disable multicore support Sebastian Reichel
@ 2024-06-13 13:48 ` Sebastian Reichel
  2024-06-17  2:50   ` Jianfeng Liu
  2024-06-13 13:48 ` [PATCH v6 5/6] arm64: dts: rockchip: Add VEPU121 to RK3588 Sebastian Reichel
  2024-06-13 13:48 ` [PATCH v6 6/6] arm64: dts: rockchip: Add VPU121 support for RK3588 Sebastian Reichel
  5 siblings, 1 reply; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-13 13:48 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel

RK3588 handling is exactly the same as RK3568. This is not
handled using fallback compatibles to avoid exposing multiple
video devices on kernels not having the multicore disable
patch.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 drivers/media/platform/verisilicon/hantro_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 7123479b3eab..b722a20c5fe3 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -722,6 +722,7 @@ static const struct of_device_id of_hantro_match[] = {
 	{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
 	{ .compatible = "rockchip,rk3568-vepu", .data = &rk3568_vepu_variant, },
 	{ .compatible = "rockchip,rk3568-vpu", .data = &rk3568_vpu_variant, },
+	{ .compatible = "rockchip,rk3588-vepu121", .data = &rk3568_vpu_variant, },
 	{ .compatible = "rockchip,rk3588-av1-vpu", .data = &rk3588_vpu981_variant, },
 #endif
 #ifdef CONFIG_VIDEO_HANTRO_IMX8M
-- 
2.43.0


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

* [PATCH v6 5/6] arm64: dts: rockchip: Add VEPU121 to RK3588
  2024-06-13 13:48 [PATCH v6 0/6] RK3588 VEPU121/VPU121 support Sebastian Reichel
                   ` (3 preceding siblings ...)
  2024-06-13 13:48 ` [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121 Sebastian Reichel
@ 2024-06-13 13:48 ` Sebastian Reichel
  2024-06-13 17:21   ` Nicolas Dufresne
  2024-06-13 13:48 ` [PATCH v6 6/6] arm64: dts: rockchip: Add VPU121 support for RK3588 Sebastian Reichel
  5 siblings, 1 reply; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-13 13:48 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, kernel,
	Sebastian Reichel

From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>

RK3588 has 4 Hantro G1 encoder-only cores. They are all independent IP,
but can be used as a cluster (i.e. sharing work between the cores).
These cores are called VEPU121 in the TRM. The TRM describes one more
VEPU121, but that is combined with a Hantro H1. That one will be handled
using the VPU binding instead.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 80 +++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
index 6ac5ac8b48ab..dd85d4e55922 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -1159,6 +1159,86 @@ power-domain@RK3588_PD_SDMMC {
 		};
 	};
 
+	vepu121_0: video-codec@fdba0000 {
+		compatible = "rockchip,rk3588-vepu121";
+		reg = <0x0 0xfdba0000 0x0 0x800>;
+		interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER0>, <&cru HCLK_JPEG_ENCODER0>;
+		clock-names = "aclk", "hclk";
+		iommus = <&vepu121_0_mmu>;
+		power-domains = <&power RK3588_PD_VDPU>;
+	};
+
+	vepu121_0_mmu: iommu@fdba0800 {
+		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
+		reg = <0x0 0xfdba0800 0x0 0x40>;
+		interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER0>, <&cru HCLK_JPEG_ENCODER0>;
+		clock-names = "aclk", "iface";
+		power-domains = <&power RK3588_PD_VDPU>;
+		#iommu-cells = <0>;
+	};
+
+	vepu121_1: video-codec@fdba4000 {
+		compatible = "rockchip,rk3588-vepu121";
+		reg = <0x0 0xfdba4000 0x0 0x800>;
+		interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER1>, <&cru HCLK_JPEG_ENCODER1>;
+		clock-names = "aclk", "hclk";
+		iommus = <&vepu121_1_mmu>;
+		power-domains = <&power RK3588_PD_VDPU>;
+	};
+
+	vepu121_1_mmu: iommu@fdba4800 {
+		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
+		reg = <0x0 0xfdba4800 0x0 0x40>;
+		interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER1>, <&cru HCLK_JPEG_ENCODER1>;
+		clock-names = "aclk", "iface";
+		power-domains = <&power RK3588_PD_VDPU>;
+		#iommu-cells = <0>;
+	};
+
+	vepu121_2: video-codec@fdba8000 {
+		compatible = "rockchip,rk3588-vepu121";
+		reg = <0x0 0xfdba8000 0x0 0x800>;
+		interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER2>, <&cru HCLK_JPEG_ENCODER2>;
+		clock-names = "aclk", "hclk";
+		iommus = <&vepu121_2_mmu>;
+		power-domains = <&power RK3588_PD_VDPU>;
+	};
+
+	vepu121_2_mmu: iommu@fdba8800 {
+		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
+		reg = <0x0 0xfdba8800 0x0 0x40>;
+		interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER2>, <&cru HCLK_JPEG_ENCODER2>;
+		clock-names = "aclk", "iface";
+		power-domains = <&power RK3588_PD_VDPU>;
+		#iommu-cells = <0>;
+	};
+
+	vepu121_3: video-codec@fdbac000 {
+		compatible = "rockchip,rk3588-vepu121";
+		reg = <0x0 0xfdbac000 0x0 0x800>;
+		interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER3>, <&cru HCLK_JPEG_ENCODER3>;
+		clock-names = "aclk", "hclk";
+		iommus = <&vepu121_3_mmu>;
+		power-domains = <&power RK3588_PD_VDPU>;
+	};
+
+	vepu121_3_mmu: iommu@fdbac800 {
+		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
+		reg = <0x0 0xfdbac800 0x0 0x40>;
+		interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru ACLK_JPEG_ENCODER3>, <&cru HCLK_JPEG_ENCODER3>;
+		clock-names = "aclk", "iface";
+		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


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

* [PATCH v6 6/6] arm64: dts: rockchip: Add VPU121 support for RK3588
  2024-06-13 13:48 [PATCH v6 0/6] RK3588 VEPU121/VPU121 support Sebastian Reichel
                   ` (4 preceding siblings ...)
  2024-06-13 13:48 ` [PATCH v6 5/6] arm64: dts: rockchip: Add VEPU121 to RK3588 Sebastian Reichel
@ 2024-06-13 13:48 ` Sebastian Reichel
  5 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-13 13:48 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, kernel, Hugh Cole-Baker,
	Sebastian Reichel

From: Jianfeng Liu <liujianfeng1994@gmail.com>

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>
Signed-off-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 dd85d4e55922..c0466982646f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -1159,6 +1159,27 @@ power-domain@RK3588_PD_SDMMC {
 		};
 	};
 
+	vpu121: 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 = <&vpu121_mmu>;
+		power-domains = <&power RK3588_PD_VDPU>;
+	};
+
+	vpu121_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>;
+	};
+
 	vepu121_0: video-codec@fdba0000 {
 		compatible = "rockchip,rk3588-vepu121";
 		reg = <0x0 0xfdba0000 0x0 0x800>;
-- 
2.43.0


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

* Re: [PATCH v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121
  2024-06-13 13:48 ` [PATCH v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 Sebastian Reichel
@ 2024-06-13 16:22   ` Conor Dooley
  0 siblings, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2024-06-13 16:22 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Ezequiel Garcia, Philipp Zabel, Nicolas Frattaroli,
	Heiko Stuebner, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jianfeng Liu, Emmanuel Gil Peyrot, Nicolas Dufresne, linux-media,
	linux-rockchip, devicetree, linux-kernel, kernel

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

On Thu, Jun 13, 2024 at 03:48:42PM +0200, Sebastian Reichel wrote:
> From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> 
> This encoder-only device is present four times on this SoC, and should
> support everything the rk3568 vepu supports (so JPEG, H.264 and VP8
> encoding). No fallback compatible has been added, since the operating
> systems might already support RK3568 VEPU and want to avoid registering
> four of them separately considering they can be used as a cluster.
> 
> Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v6 5/6] arm64: dts: rockchip: Add VEPU121 to RK3588
  2024-06-13 13:48 ` [PATCH v6 5/6] arm64: dts: rockchip: Add VEPU121 to RK3588 Sebastian Reichel
@ 2024-06-13 17:21   ` Nicolas Dufresne
  0 siblings, 0 replies; 13+ messages in thread
From: Nicolas Dufresne @ 2024-06-13 17:21 UTC (permalink / raw)
  To: Sebastian Reichel, Ezequiel Garcia, Philipp Zabel,
	Nicolas Frattaroli, Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jianfeng Liu,
	Emmanuel Gil Peyrot, linux-media, linux-rockchip, devicetree,
	linux-kernel, kernel

Le jeudi 13 juin 2024 à 15:48 +0200, Sebastian Reichel a écrit :
> From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> 
> RK3588 has 4 Hantro G1 encoder-only cores. They are all independent IP,
               Hantro H1

H1 is the encoder core, G1 is the decoder core, and this exists as a combo on
this platform (vpu121).

> but can be used as a cluster (i.e. sharing work between the cores).
> These cores are called VEPU121 in the TRM. The TRM describes one more
> VEPU121, but that is combined with a Hantro H1. That one will be handled
> using the VPU binding instead.
> 
> Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

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

> ---
>  arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 80 +++++++++++++++++++++++
>  1 file changed, 80 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> index 6ac5ac8b48ab..dd85d4e55922 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> @@ -1159,6 +1159,86 @@ power-domain@RK3588_PD_SDMMC {
>  		};
>  	};
>  
> +	vepu121_0: video-codec@fdba0000 {
> +		compatible = "rockchip,rk3588-vepu121";
> +		reg = <0x0 0xfdba0000 0x0 0x800>;
> +		interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER0>, <&cru HCLK_JPEG_ENCODER0>;
> +		clock-names = "aclk", "hclk";
> +		iommus = <&vepu121_0_mmu>;
> +		power-domains = <&power RK3588_PD_VDPU>;
> +	};
> +
> +	vepu121_0_mmu: iommu@fdba0800 {
> +		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
> +		reg = <0x0 0xfdba0800 0x0 0x40>;
> +		interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER0>, <&cru HCLK_JPEG_ENCODER0>;
> +		clock-names = "aclk", "iface";
> +		power-domains = <&power RK3588_PD_VDPU>;
> +		#iommu-cells = <0>;
> +	};
> +
> +	vepu121_1: video-codec@fdba4000 {
> +		compatible = "rockchip,rk3588-vepu121";
> +		reg = <0x0 0xfdba4000 0x0 0x800>;
> +		interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER1>, <&cru HCLK_JPEG_ENCODER1>;
> +		clock-names = "aclk", "hclk";
> +		iommus = <&vepu121_1_mmu>;
> +		power-domains = <&power RK3588_PD_VDPU>;
> +	};
> +
> +	vepu121_1_mmu: iommu@fdba4800 {
> +		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
> +		reg = <0x0 0xfdba4800 0x0 0x40>;
> +		interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER1>, <&cru HCLK_JPEG_ENCODER1>;
> +		clock-names = "aclk", "iface";
> +		power-domains = <&power RK3588_PD_VDPU>;
> +		#iommu-cells = <0>;
> +	};
> +
> +	vepu121_2: video-codec@fdba8000 {
> +		compatible = "rockchip,rk3588-vepu121";
> +		reg = <0x0 0xfdba8000 0x0 0x800>;
> +		interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER2>, <&cru HCLK_JPEG_ENCODER2>;
> +		clock-names = "aclk", "hclk";
> +		iommus = <&vepu121_2_mmu>;
> +		power-domains = <&power RK3588_PD_VDPU>;
> +	};
> +
> +	vepu121_2_mmu: iommu@fdba8800 {
> +		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
> +		reg = <0x0 0xfdba8800 0x0 0x40>;
> +		interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER2>, <&cru HCLK_JPEG_ENCODER2>;
> +		clock-names = "aclk", "iface";
> +		power-domains = <&power RK3588_PD_VDPU>;
> +		#iommu-cells = <0>;
> +	};
> +
> +	vepu121_3: video-codec@fdbac000 {
> +		compatible = "rockchip,rk3588-vepu121";
> +		reg = <0x0 0xfdbac000 0x0 0x800>;
> +		interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER3>, <&cru HCLK_JPEG_ENCODER3>;
> +		clock-names = "aclk", "hclk";
> +		iommus = <&vepu121_3_mmu>;
> +		power-domains = <&power RK3588_PD_VDPU>;
> +	};
> +
> +	vepu121_3_mmu: iommu@fdbac800 {
> +		compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu";
> +		reg = <0x0 0xfdbac800 0x0 0x40>;
> +		interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH 0>;
> +		clocks = <&cru ACLK_JPEG_ENCODER3>, <&cru HCLK_JPEG_ENCODER3>;
> +		clock-names = "aclk", "iface";
> +		power-domains = <&power RK3588_PD_VDPU>;
> +		#iommu-cells = <0>;
> +	};
> +
>  	av1d: video-codec@fdc70000 {
>  		compatible = "rockchip,rk3588-av1-vpu";
>  		reg = <0x0 0xfdc70000 0x0 0x800>;


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

* Re: [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121
  2024-06-13 13:48 ` [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121 Sebastian Reichel
@ 2024-06-17  2:50   ` Jianfeng Liu
  2024-06-17 11:30     ` Sebastian Reichel
  0 siblings, 1 reply; 13+ messages in thread
From: Jianfeng Liu @ 2024-06-17  2:50 UTC (permalink / raw)
  To: sebastian.reichel
  Cc: conor+dt, devicetree, ezequiel, frattaroli.nicolas, heiko, kernel,
	krzk+dt, linkmauve, linux-kernel, linux-media, linux-rockchip,
	liujianfeng1994, nicolas.dufresne, p.zabel, robh

Hi Sebastian,

Thu, 13 Jun 2024 15:48:45 +0200, Sebastian Reichel wrote:
>+	{ .compatible = "rockchip,rk3588-vepu121", .data = &rk3568_vpu_variant, },

rk3568_vpu_variant is decoder's data, typo?

Regards,
Jianfeng

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

* Re: [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121
  2024-06-17  2:50   ` Jianfeng Liu
@ 2024-06-17 11:30     ` Sebastian Reichel
  2024-06-17 15:07       ` Jianfeng Liu
  2024-06-18  8:28       ` Alex Bee
  0 siblings, 2 replies; 13+ messages in thread
From: Sebastian Reichel @ 2024-06-17 11:30 UTC (permalink / raw)
  To: Jianfeng Liu
  Cc: conor+dt, devicetree, ezequiel, frattaroli.nicolas, heiko, kernel,
	krzk+dt, linkmauve, linux-kernel, linux-media, linux-rockchip,
	nicolas.dufresne, p.zabel, robh

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

Hi,

On Mon, Jun 17, 2024 at 10:50:22AM GMT, Jianfeng Liu wrote:
> Hi Sebastian,
> 
> Thu, 13 Jun 2024 15:48:45 +0200, Sebastian Reichel wrote:
> >+	{ .compatible = "rockchip,rk3588-vepu121", .data = &rk3568_vpu_variant, },
> 
> rk3568_vpu_variant is decoder's data, typo?

See first sentence of the commit message.

-- Sebastian.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121
  2024-06-17 11:30     ` Sebastian Reichel
@ 2024-06-17 15:07       ` Jianfeng Liu
  2024-06-18  8:28       ` Alex Bee
  1 sibling, 0 replies; 13+ messages in thread
From: Jianfeng Liu @ 2024-06-17 15:07 UTC (permalink / raw)
  To: sebastian.reichel
  Cc: conor+dt, devicetree, ezequiel, frattaroli.nicolas, heiko, kernel,
	krzk+dt, linkmauve, linux-kernel, linux-media, linux-rockchip,
	liujianfeng1994, nicolas.dufresne, p.zabel, robh

Hi,

On Mon, 17 Jun 2024 13:30:52 +0200, Sebastian Reichel wrote:
>> rk3568_vpu_variant is decoder's data, typo?
>
>See first sentence of the commit message.

I know you want a different compatible string for this VEPU121 beacause
of multi cores. But rk3568_vpu_variant is data for VDPU121. I applied this
patch and from output of command:
v4l2-ctl -l -d 3
I see h264/vp8 decoder, which is wrong. vtl2-ctl output of this device
should be JPEG endoer.

Best regards,
Jianfeng

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

* Re: [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121
  2024-06-17 11:30     ` Sebastian Reichel
  2024-06-17 15:07       ` Jianfeng Liu
@ 2024-06-18  8:28       ` Alex Bee
  1 sibling, 0 replies; 13+ messages in thread
From: Alex Bee @ 2024-06-18  8:28 UTC (permalink / raw)
  To: Sebastian Reichel, Jianfeng Liu
  Cc: conor+dt, devicetree, ezequiel, frattaroli.nicolas, heiko, kernel,
	krzk+dt, linkmauve, linux-kernel, linux-media, linux-rockchip,
	nicolas.dufresne, p.zabel, robh

Am 17.06.24 um 13:30 schrieb Sebastian Reichel:
> Hi,
> 
> On Mon, Jun 17, 2024 at 10:50:22AM GMT, Jianfeng Liu wrote:
>> Hi Sebastian,
>>
>> Thu, 13 Jun 2024 15:48:45 +0200, Sebastian Reichel wrote:
>>> +	{ .compatible = "rockchip,rk3588-vepu121", .data = &rk3568_vpu_variant, },
>>
>> rk3568_vpu_variant is decoder's data, typo?
> 
> See first sentence of the commit message.
> 
I think, what Jianfeng meant, is that you are incorrectly using
rk3568_vpu_variant for the newly added "rockchip,rk3588-vepu121"
compatible: rk3568_vpu_variant is for the decoder (confusing, I know:
should actually be rk3568_vdpu_variant) - you want to use
rk3568_vepu_variant instead for it instead.

Alex
> -- Sebastian.
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip


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

end of thread, other threads:[~2024-06-18  8:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-13 13:48 [PATCH v6 0/6] RK3588 VEPU121/VPU121 support Sebastian Reichel
2024-06-13 13:48 ` [PATCH v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 Sebastian Reichel
2024-06-13 16:22   ` Conor Dooley
2024-06-13 13:48 ` [PATCH v6 2/6] media: dt-bindings: rockchip-vpu: Add RK3588 VPU121 Sebastian Reichel
2024-06-13 13:48 ` [PATCH v6 3/6] media: hantro: Disable multicore support Sebastian Reichel
2024-06-13 13:48 ` [PATCH v6 4/6] media: hantro: Add RK3588 VEPU121 Sebastian Reichel
2024-06-17  2:50   ` Jianfeng Liu
2024-06-17 11:30     ` Sebastian Reichel
2024-06-17 15:07       ` Jianfeng Liu
2024-06-18  8:28       ` Alex Bee
2024-06-13 13:48 ` [PATCH v6 5/6] arm64: dts: rockchip: Add VEPU121 to RK3588 Sebastian Reichel
2024-06-13 17:21   ` Nicolas Dufresne
2024-06-13 13:48 ` [PATCH v6 6/6] arm64: dts: rockchip: Add VPU121 support for RK3588 Sebastian Reichel

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