linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Cole-Baker <sigmaris@gmail.com>
To: Jianfeng Liu <liujianfeng1994@gmail.com>
Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, ezequiel@vanguardiasur.com.ar,
	p.zabel@pengutronix.de, mchehab@kernel.org, robh@kernel.org,
	krzk+dt@kernel.org, Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	sfr@canb.auug.org.au, sebastian.reichel@collabora.com,
	didi.debian@cknow.org
Subject: Re: [PATCH v6 2/2] arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588
Date: Fri, 19 Apr 2024 18:28:01 +0100	[thread overview]
Message-ID: <B9F108CF-4BC5-41A0-A28A-1CA1F4D2CD3C@gmail.com> (raw)
In-Reply-To: <20240418111002.83015-3-liujianfeng1994@gmail.com>

Hi Jianfeng,

> On 18 Apr 2024, at 12:10, Jianfeng Liu <liujianfeng1994@gmail.com> wrote:
> 
> 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..b0817382f 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-vdpu121", "rockchip,rk3568-vpu";
> + reg = <0x0 0xfdb50000 0x0 0x800>;

The register range at 0xfdb50000 length 0x800 includes "VEPU121 core0" encoder
regs at offset 0 and "VDPU121" decoder regs at offset 0x400 (referring to the
TRM v1.0 Part 1, section 5.5.1). So I think the "rockchip,rk3588-vdpu121"
compatible isn't exactly correct to use for this entire device.

IMO "rockchip,rk3588-vpu121" would be more appropriate if including both the
decoder and encoder. It also raises the question of whether the decoder and
encoder should be modeled in DT as one device like on RK3399, or separate
devices. In the vendor DT [0] they are modeled as two devices but they share
clocks, resets, IOMMU, and a "rockchip,taskqueue-node" value.

I've tested the JPEG encoding functionality of this encoder with [1], and it
seems to work, gstreamer produces a MJPEG video of the test pattern as
expected.

> + interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH 0>;
> + interrupt-names = "vdpu";
> + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> + clock-names = "aclk", "hclk";
> + iommus = <&vdpu_mmu>;
> + power-domains = <&power RK3588_PD_VDPU>;
> + };
> +
> + vdpu_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
> 

[0]: https://github.com/friendlyarm/kernel-rockchip/blob/18fd1215fee01daef16b6ced1c0c3c3b83a4d8df/arch/arm64/boot/dts/rockchip/rk3588s.dtsi#L3630-L3683
[1]: https://github.com/sigmaris/linux/tree/rk3588-hantro-vpus
     with: gst-launch-1.0 videotestsrc pattern=ball flip=true ! v4l2jpegenc \
      ! matroskamux ! filesink location=jpegtest.mkv


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-04-19 17:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 11:10 [PATCH v6 0/2] Add hantro g1 video decoder support for RK3588 Jianfeng Liu
2024-04-18 11:10 ` [PATCH v6 1/2] dt-bindings: media: rockchip-vpu: Add rk3588 vdpu121 compatible string Jianfeng Liu
2024-04-18 11:10 ` [PATCH v6 2/2] arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588 Jianfeng Liu
2024-04-19 17:28   ` Hugh Cole-Baker [this message]
2024-04-20  5:09     ` Jianfeng Liu
2024-04-26 12:49       ` Nicolas Dufresne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B9F108CF-4BC5-41A0-A28A-1CA1F4D2CD3C@gmail.com \
    --to=sigmaris@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=didi.debian@cknow.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=heiko@sntech.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=liujianfeng1994@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).