Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64: dts: rockchip: Enable the missing av1d nodes #189

Merged
merged 1 commit into from
May 20, 2024

Conversation

nyanmisaka
Copy link
Collaborator

Required by the RKMPP AV1 hardware decoding in
Chromium (libv4l-rkmpp), FFmpeg and Gstreamer.

The av1d and av1_mmu nodes are disabled by default as per

av1d: av1d@fdc70000 {
compatible = "rockchip,av1-decoder";
reg = <0x0 0xfdc70000 0x0 0x800>, <0x0 0xfdc80000 0x0 0x400>,
<0x0 0xfdc90000 0x0 0x400>;
reg-names = "vcd", "cache", "afbc";
interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "irq_av1d", "irq_cache", "irq_afbc";
clocks = <&cru ACLK_AV1>, <&cru PCLK_AV1>;
clock-names = "aclk_vcodec", "hclk_vcodec";
rockchip,normal-rates = <400000000>, <400000000>;
assigned-clocks = <&cru ACLK_AV1>, <&cru PCLK_AV1>;
assigned-clock-rates = <400000000>, <400000000>;
resets = <&cru SRST_A_AV1>, <&cru SRST_P_AV1>;
reset-names = "video_a", "video_h";
iommus = <&av1d_mmu>;
rockchip,srv = <&mpp_srv>;
rockchip,taskqueue-node = <11>;
power-domains = <&power RK3588_PD_AV1>;
status = "disabled";
};
av1d_mmu: iommu@fdca0000 {
compatible = "rockchip,iommu-av1d";
reg = <0x0 0xfdca0000 0x0 0x600>;
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "irq_av1d_mmu";
clocks = <&cru ACLK_AV1>, <&cru PCLK_AV1>;
clock-names = "aclk", "iface";
#iommu-cells = <0>;
power-domains = <&power RK3588_PD_AV1>;
status = "disabled";
};

Tested with a few clips and it also works on Rock-5C.

root@rock-5c:~# dmesg | grep av1d
[   12.953757] rk_iommu fdca0000.iommu: av1d iommu enabled
[   13.567192] mpp_av1dec fdc70000.av1d: Adding to iommu group 14
[   13.567556] mpp_av1dec fdc70000.av1d: probing start
[   13.568110] mpp_av1dec fdc70000.av1d: probing finish
root@rock-5c:~# ./ffmpeg -hide_banner -hwaccel rkmpp -hwaccel_output_format drm_prime -afbc on -i ~/bbb_sunflower_1080p_30fps_normal_5min.mp4 -an -sn -f null -
...
Stream mapping:
  Stream #0:0 -> #0:0 (av1 (av1_rkmpp) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomav01dby1iso2mp41
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    composer        : Sacha Goedegebure
    genre           : Animation
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    encoder         : Lavf60.16.100
  Stream #0:0(und): Video: wrapped_avframe, drm_prime(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default)
    Metadata:
      handler_name    : GPAC ISO Video Handler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.31.102 wrapped_avframe
[out#0/null @ 0xaaaad0006650] video:4219kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
frame= 9000 fps=242 q=-0.0 Lsize=N/A time=00:04:59.96 bitrate=N/A speed=8.08x

Required by the RKMPP AV1 hardware decoding in
Chromium (libv4l-rkmpp), FFmpeg and Gstreamer.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Copy link
Collaborator

@amazingfate amazingfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old 5.10 kernel doesn't need av1d enabled. AV1 decoding would work with av1d_mmu. And most of these devicetrees are copied from 5.10 branch, that's why.

@amazingfate amazingfate merged commit d06d87e into armbian:rk-6.1-rkr1 May 20, 2024
1 check passed
@nyanmisaka nyanmisaka deleted the enable-av1d branch May 20, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants