armbian / linux-rockchip

Improved Rockchip Linux
Other
123 stars 174 forks source link

Some more Panthor fixes #210

Closed ginkage closed 1 month ago

ginkage commented 1 month ago

The first two commits are actually present in the kernel 6.10 release, so no reason not to include them. The third one is present in drm-tip, as well as in for-linux-next, and is authored by an ARM engineer, so I'd expect it to land soon. The final one is found in the Collabora branch, and is the only one I have some doubts about. But, as I didn't squash it all this time, it would be easy to revert if needed.

rpardini commented 1 month ago

Hi, I'm not sure this is related, but very recently I've lost panthor. I'm running on Meko r58x, this kernel sha1 7d54 (thus containing this), and I only get lvmpipe.

mekotronics-r58x-pro:~:# dmesg | grep -i -e drm -e panthor
[    5.173712] OF: fdt: Reserved memory: failed to reserve memory for node 'drm-logo@0': base 0x0000000000000000, size 0 MiB
[    5.173731] OF: fdt: Reserved memory: failed to reserve memory for node 'drm-cubic-lut@0': base 0x0000000000000000, size 0 MiB
[    6.646076] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp0 assign plane mask: Cluster0 | Esmart0[0x5], primary plane phy id: Esmart0[2]
[    6.646106] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp1 assign plane mask: Cluster1 | Esmart1[0xa], primary plane phy id: Esmart1[3]
[    6.646126] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp2 assign plane mask: Cluster2 | Esmart2[0x140], primary plane phy id: Esmart2[8]
[    6.646145] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp3 assign plane mask: Cluster3 | Esmart3[0x280], primary plane phy id: Esmart3[9]
[    6.646311] [drm] failed to init overlay plane Cluster0-win1
[    6.646351] [drm] failed to init overlay plane Cluster1-win1
[    6.646386] [drm] failed to init overlay plane Cluster2-win1
[    6.646421] [drm] failed to init overlay plane Cluster3-win1
[    6.656833] rockchip-drm display-subsystem: bound fdd90000.vop (ops 0xffff8000092ada00)
[    6.657888] rockchip-drm display-subsystem: bound fde80000.hdmi (ops 0xffff8000092c5f20)
[    6.658064] rockchip-drm display-subsystem: bound fde60000.dp (ops 0xffff8000092c93d0)
[    6.658352] rockchip-drm display-subsystem: failed to parse loader memory
[    6.658943] [drm] Initialized rockchip 4.0.0 20140818 for display-subsystem on minor 0
[    6.699902] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 2560x1440p60, type: 11(if:HDMI0, flag:0x0) for vp0 dclk: 248880000
[    6.700077] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] dclk_out0 div: 0 dclk_core0 div: 2
[    6.700093] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] set dclk_vop0 to 248880000, get 237600000
[    6.768326] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] Crtc atomic disable vp0
[    6.787455] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd6
[    6.787465] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd5
[    6.909043] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 1920x1080p60, type: 11(if:HDMI0, flag:0x0) for vp0 dclk: 148500000
[    6.909203] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] dclk_out0 div: 0 dclk_core0 div: 2
[    6.909220] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] set dclk_vop0 to 148500000, get 148500000
[    6.987846] rockchip-drm display-subsystem: [drm] fb0: rockchipdrmfb frame buffer device
[    8.369613] [drm] Initialized rknpu 0.9.7 20240424 for fdab0000.npu on minor 1
[    8.651050] panthor fb000000.gpu-panthor: [drm] clock rate = 198000000
[    8.652581] panthor fb000000.gpu-panthor: Looking up mali-supply from device tree
[    8.653080] panthor fb000000.gpu-panthor: Looking up sram-supply from device tree
[    8.653085] panthor fb000000.gpu-panthor: Looking up sram-supply property in node /gpu-panthor@fb000000 failed
[    8.655308] panthor fb000000.gpu-panthor: EM: OPP:400000 is inefficient
[    8.655315] panthor fb000000.gpu-panthor: EM: OPP:300000 is inefficient
[    8.655413] panthor fb000000.gpu-panthor: EM: created perf domain
[    8.657040] panthor fb000000.gpu-panthor: [drm] mali-g610 id 0xa867 major 0x0 minor 0x0 status 0x5
[    8.658326] panthor fb000000.gpu-panthor: [drm] Features: L2:0x7120306 Tiler:0x809 Mem:0x301 MMU:0x2830 AS:0xff
[    8.659568] panthor fb000000.gpu-panthor: [drm] shader_present=0x50005 l2_present=0x1 tiler_present=0x1
[    8.662733] panthor fb000000.gpu-panthor: [drm] Firmware protected mode entry not be supported, ignoring
[    8.664277] panthor fb000000.gpu-panthor: [drm] CSF FW v1.1.0, Features 0x0 Instrumentation features 0x71
[    8.665722] [drm] Initialized panthor 1.0.0 20230801 for fb000000.gpu-panthor on minor 2
[    9.594049] systemd[1]: Starting Load Kernel Module drm...
[    9.613979] systemd[1]: modprobe@drm.service: Deactivated successfully.
[    9.614318] systemd[1]: Finished Load Kernel Module drm.
[   23.009449] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] Crtc atomic disable vp0
[   23.042634] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd6
[   23.042648] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_disable] *ERROR* unexpected power on pd5
[   23.051057] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 3840x2160p30, type: 11(if:HDMI0, flag:0x0) for vp0 dclk: 297000000
[   23.051206] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] dclk_out0 div: 0 dclk_core0 div: 2
[   23.051218] rockchip-vop2 fdd90000.vop: [drm:vop2_crtc_atomic_enable] set dclk_vop0 to 297000000, get 297000000

This was built with EXT=mesa-vpu RELEASE=jammy -- wonder if that firmware warn is relevant?

Not saying this is to blame, but has anyone an idea?

amazingfate commented 1 month ago

We can see panthor driver is loaded from dmesg. After updating mesa in oibaf ppa, my gpu also become llvmpipe. Since mesa 24.1 is released with panthor support, we may toggle to this ppa: https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa instead of bleeding edge oibaf git version.

rpardini commented 1 month ago

toggle to this ppa: launchpad.net/~kisak/+archive/ubuntu/kisak-mesa instead of bleeding edge oibaf git version.

Confirmed, this works. Thanks!