Jump to content

Unable to make Panfrost work on H6


NicoD

Recommended Posts

Hi all. 
I've been working with the OPi3 and PineH64 model B the last days to try installing MESA and DRM drivers to make Panfrost work.
This doesn't seem to work. Every time I install Mesa and reboot. It boots into the desktop normally, but a few seconds later the screen goes into one color. Everything is unresponsive. Can't go to a terminal window. Numlock is stuck...
Just tried again with compositor disabled. It does take a bit longer before it blocks. But it still happens about a minute in every time. 
I can't find a ttl adapter for better debugging. I'll order new ones. 
Both the OPi3 (bionic 5.4) and PineH64(bionic 5.3) have the same issue. I'm using self built images.

You can try it with the script here 

Don't install all, only install mesa and drm. It seems to install well, but after reboot everything is broken. 
Any clue would help. 
Cheers.

Link to comment
Share on other sites

Panfrost does work on the H6. Except for hanging the system. I was able to start supertuxkart to see it's using panfrost. And then the system crashed. This time just showing what was on the screen instead of one color, but still crashed fully.
I'm sick of it. I have no idea what I could do. 

Link to comment
Share on other sites

I have been told LE 9.8.8 has panfrost working smooth , i think it's a @jernej's work. (not sure)

I have no idea how to fetch this version and have a look at panfrost diff. Maybe you can.

In my experience i have applied all available patches and still not stable enough.

 

Link to comment
Share on other sites

51 minutes ago, @lex said:

In my experience i have applied all available patches and still not stable enough.

 

That's the problem. I can install everything, the panfrost driver does work. But the system crashes every time. I should try with debian, I'll see if I can find the time.

Link to comment
Share on other sites

@NicoD How did you even got Panfrost to work? I am trying your script in the Orange Pi Lite 2 using Armbian Ubuntu Bionic (kernel 5.5.8) and I can't get glxinfo to recognize the Mesa Panfrost driver, it still says it's using llvmpipe.

 

Is there anything else I'm missing, like special Xorg configuration?

Link to comment
Share on other sites

1 hour ago, JORGETECH said:

@NicoD How did you even got Panfrost to work? I am trying your script in the Orange Pi Lite 2 using Armbian Ubuntu Bionic (kernel 5.5.8) and I can't get glxinfo to recognize the Mesa Panfrost driver, it still says it's using llvmpipe.

 

Is there anything else I'm missing, like special Xorg configuration?

I don't know. I wasn't able to get it stable with the H6, but panfrost was activated.
Now panfrost stopped working on all devices. I don't know what's going on. Even on my rockpi4b I can't get it to work anymore. Tried different kernels and all the same. llvmpipe....
With both my script, or with the video-repo. So we've got the same problem.


I don't have that much time to invest into searching a fix. If you/anybody finds out what's happening. Let me know.

Link to comment
Share on other sites

On 3/12/2020 at 7:23 PM, NicoD said:

I don't know. I wasn't able to get it stable with the H6, but panfrost was activated.
Now panfrost stopped working on all devices. I don't know what's going on. Even on my rockpi4b I can't get it to work anymore. Tried different kernels and all the same. llvmpipe....
With both my script, or with the video-repo. So we've got the same problem.


I don't have that much time to invest into searching a fix. If you/anybody finds out what's happening. Let me know.

I thought that the problem lied in the DTS/DTSI files because the GPU and Display Engine have a line saying "status = disabled" which lead me to believe they were disabled due to instability (it may have a different meaning, correct me if I'm wrong). However, I don't know if that's true since I compiled LibreELEC for the Orange Pi Lite 2 successfully and Panfrost just works with the 5.5.6 Linux kernel, which means that the problem may lie elsewhere (I think LibreELEC uses GBM for the display rendering though, not X11). Maybe @jernej can give a better answer.

On 3/13/2020 at 12:40 AM, ning said:

if you use wayland session, panfrost is used by default.

if you use Xorg, a config file is required, which is same as lima. please follow: https://gitlab.freedesktop.org/lima/web

and make sure your xorg >= 1.20

 

 

I'm sure wayland should work since LibreELEC has something similar going on. I tried making a custom Xorg file as described in that wiki, but it still uses llvmpipe for both GL and GLES. Also,I don't know what to put in the "MatchDriver" field since sun4i-drm seems to be related to older AllWinner SoCs (H6 is sun50i).

On 3/13/2020 at 12:49 AM, ning said:

if you use ubuntu, don't build mesa your self, you can use https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers

if you insist to build your self, please also update libdrm and libglvnd. these two deps are also important.

 

 

Thanks for the useful advice, I'll test with that PPA from now on.

Link to comment
Share on other sites

24 minutes ago, JORGETECH said:

I thought that the problem lied in the DTS/DTSI files because the GPU and Display Engine have a line saying "status = disabled" which lead me to believe they were disabled due to instability (it may have a different meaning, correct me if I'm wrong).

No, they are disabled because nobody took time to properly enable them in board DTS until now (it will be in 5.7).

26 minutes ago, JORGETECH said:

sun4i-drm seems to be related to older AllWinner SoCs (H6 is sun50i).

No, sun4i-drm is for all Allwinner SoCs, it supports Display Engine 1.0, 2.0 and 3.0. It's just named by Linux tradition where it takes name of first (oldest) supported platform.

Link to comment
Share on other sites

On 3/15/2020 at 1:37 PM, jernej said:

No, they are disabled because nobody took time to properly enable them in board DTS until now (it will be in 5.7).

Ok, now I understand better how hardware is defined in DTS files. I realized the Orange Pi Lite 2 DTS is really barebones compared to the Orange Pi 3. I can wait for kernel 5.7 to test more.

 

The question I have is: How does it work in LibreELEC if the same DTS is used? (Is it only needed for X11 acceleration?)

 

EDIT: I answered my own question. The LibreELEC pull request for Orange Pi Lite 2 (which I merged on my local repository) adds the GPU and Display Engine entries in the DTS. So Armbian would need to merge that in the first place, @Igor can you take a look at the commits from this pull request (if you have the time of course)?, it has both the GPU and DE added to the DTS unlike Armbian's one. I would do it myself but I fear I would break the working patch since I have to learn more about git and diff. EDIT: I enabled the gpu myself but I found the system to be unstable after doing that, I will try to debug it with UART (SSH crashes too) and report back.

On 3/15/2020 at 1:37 PM, jernej said:

No, sun4i-drm is for all Allwinner SoCs, it supports Display Engine 1.0, 2.0 and 3.0. It's just named by Linux tradition where it takes name of first (oldest) supported platform.

Thanks, I completely forgot about that Linux naming convention inside the kernel.

 

As always, thanks for the useful advice and answers.

Link to comment
Share on other sites

attached dtb with working config for panfrost and hdmi, just paste on /boot/dtb/allwinner and test.

I've followed panfrost instalation guide and is working fine, changed gpu supply fixes the one color system hang and change hdmi supply fixes dvi no dtc hdmi output making sound works.

 

PS: just a fix, not a solution but at least is working like librelec.

PS2: I have OPI lite 2, for OPI3 just copy the changes to OPI3 dtb

sun50i-h6-orangepi-lite2.dtb

Link to comment
Share on other sites

19 hours ago, AndreBotelho said:

attached dtb with working config for panfrost and hdmi, just paste on /boot/dtb/allwinner and test.

I've followed panfrost instalation guide and is working fine, changed gpu supply fixes the one color system hang and change hdmi supply fixes dvi no dtc hdmi output making sound works.

 

PS: just a fix, not a solution but at least is working like librelec.

PS2: I have OPI lite 2, for OPI3 just copy the changes to OPI3 dtb

sun50i-h6-orangepi-lite2.dtb 32.31 kB · 14 downloads

 

Do I need to convert it back to dts too, or do I leave the armbian kernel dts? Do the modifications come from other patches?

Link to comment
Share on other sites

I examined @AndreBotelho's DTB and it's not really much different from the DTB I'm already using, so I don't think it would change anything. However, patches like this could help, I think I should wait first for the Armbian patches to be adapted for 5.6 kernel and then continue testing. Forget it, it's already been merged, but I still have my doubts over the posted DTB.

Edited by JORGETECH
Correction
Link to comment
Share on other sites

On 3/22/2020 at 1:03 PM, JORGETECH said:

 

Do I need to convert it back to dts too, or do I leave the armbian kernel dts? Do the modifications come from other patches?

Yes, use DTC tool

9 hours ago, JORGETECH said:

I examined @AndreBotelho's DTB and it's not really much different from the DTB I'm already using, so I don't think it would change anything. However, patches like this could help, I think I should wait first for the Armbian patches to be adapted for 5.6 kernel and then continue testing. Forget it, it's already been merged, but I still have my doubts over the posted DTB.

 

Like I said it just a quick fix while it is not merged, I've built Armbian from source and the hdmi still is not working with default DTB so using Libreelec source( works but buggy) I've changed some options on the DTB( I'm not expert). It appears that the hang is beeing caused by the GPU clock table and the dummy clock driver from Panfrost and the HDMI missing sound and resolutions is due to some bug on voltage source option.

Link to comment
Share on other sites

On 2/19/2020 at 1:00 AM, NicoD said:

I'm still getting nowhere with it. After installing panfrost onto Armbian Bionic and reboot I get this result. (OPi3)
I think I'll throw in the towel. 
If anyone fas more succes then I have, please let me know.
DSCN6122.thumb.JPG.fa6983748058e5ea90942b85f2acd254.JPG

My OrangePi3 hangs after boot up for 5s ~ 1minute. Anyone have better luck?

 

Image:

Armbian_20.02.1_Orangepi3_bionic_current_5.4.20_desktop.7z

Steps done:

sudo apt-get install software-properties-common -y

sudo add-apt-repository ppa:oibaf/graphics-drivers 

sudo apt-get update

sudo apt-get upgrade

Link to comment
Share on other sites

Seems also be the same issue on 5.6. As soon as you log in and start doing stuff it freezes the board

[ +33,408356] panfrost 1800000.gpu: gpu sched timeout, js=0, config=0x3700, status=0x8, head=0x3d07800, tail=0x3d07800, sched_job=000000001ec47767
[Apr 7 16:54] panfrost 1800000.gpu: gpu sched timeout, js=1, config=0x3700, status=0x8, head=0x4993680, tail=0x4997c80, sched_job=00000000f643e8d9

 

Link to comment
Share on other sites

Spoiler

[Apr 7 18:09] ------------[ cut here ]------------
[  +0,000014] panfrost 1800000.gpu: matching BO is not heap type (GPU VA = 4200000)
[  +0,000100] WARNING: CPU: 0 PID: 523 at drivers/gpu/drm/panfrost/panfrost_mmu.c:464 panfrost_mmu_irq_handler_thread+0x538/0x6b0 [panfrost]
[  +0,000002] Modules linked in: fuse rfkill zstd snd_soc_hdmi_codec snd_soc_simple_card snd_soc_simple_card_utils sunxi_cir rc_core sun4i_i2s dw_hdmi_cec dw_hdmi_i2s_audio snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer snd soundcore zram panfrost gpu_sched sun8i_ce crypto_engine cpufreq_dt realtek dwmac_sun8i mdio_mux i2c_mv64xxx
[  +0,000030] CPU: 0 PID: 523 Comm: irq/13-mmu Not tainted 5.6.2-sunxi64 #trunk
[  +0,000002] Hardware name: OrangePi One Plus (DT)
[  +0,000004] pstate: 60000005 (nZCv daif -PAN -UAO)
[  +0,000005] pc : panfrost_mmu_irq_handler_thread+0x538/0x6b0 [panfrost]
[  +0,000004] lr : panfrost_mmu_irq_handler_thread+0x538/0x6b0 [panfrost]
[  +0,000002] sp : ffff800011413ce0
[  +0,000002] x29: ffff800011413d00 x28: ffff000033772480
[  +0,000003] x27: ffff80001011b2d0 x26: 0000000000000000
[  +0,000003] x25: ffff0000376e0ea4 x24: ffff00001e885600
[  +0,000004] x23: ffff00003419df80 x22: ffff00003567c200
[  +0,000003] x21: 0000000000000001 x20: ffff80001128a41c
[  +0,000003] x19: 0000000000010001 x18: 0000000000000020
[  +0,000003] x17: 0000000000000000 x16: 0000000000000000
[  +0,000002] x15: ffffffffffffffff x14: ffff800011018908
[  +0,000003] x13: ffff8000110d13e8 x12: ffff8000110d1045
[  +0,000004] x11: ffff800011030000 x10: ffff8000110d0650
[  +0,000003] x9 : ffff800011413ce0 x8 : 2055504728206570
[  +0,000003] x7 : 7974207061656820 x6 : ffff8000110d06cd
[  +0,000003] x5 : 0000000000000045 x4 : 0000000000000000
[  +0,000002] x3 : 0000000000000000 x2 : 00000000ffffffff
[  +0,000003] x1 : 94ce92addd5e3400 x0 : 0000000000000000
[  +0,000004] Call trace:
[  +0,000006]  panfrost_mmu_irq_handler_thread+0x538/0x6b0 [panfrost]
[  +0,000010]  irq_thread_fn+0x28/0x98
[  +0,000003]  irq_thread+0x148/0x280
[  +0,000005]  kthread+0x118/0x120
[  +0,000005]  ret_from_fork+0x10/0x1c
[  +0,000003] ---[ end trace 5c3ebbfed91ea903 ]---
[  +0,000015] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004490180
              Reason: TODO
              raw fault status: 0x280002C2
              decoded fault status: SLAVE FAULT
              exception type 0xC2: TRANSLATION_FAULT_LEVEL2
              access type 0x2: READ
              source id 0x2800
[  +0,022976] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000000000080
              Reason: TODO
              raw fault status: 0x280002C2
              decoded fault status: SLAVE FAULT
              exception type 0xC2: TRANSLATION_FAULT_LEVEL2
              access type 0x2: READ
              source id 0x2800
[  +0,039943] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,037224] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,022877] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,026009] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,053772] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,030162] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,030171] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,063846] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,035962] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,036085] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,073750] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,009934] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,010214] panfrost 1800000.gpu: Unhandled Page fault in AS0 at VA 0x0000000004123000
              Reason: TODO
              raw fault status: 0x1C8
              decoded fault status: SLAVE FAULT
              exception type 0xC8: PERMISSION_FAULT
              access type 0x1: EXECUTE
              source id 0x0
[  +0,012945] panfrost 1800000.gpu: gpu sched timeout, js=0, config=0x3700, status=0x8, head=0x2103680, tail=0x2103680, sched_job=000000000421cf1d

 

At least I know this way that the drivers built from source (Freedesktop.org) have been installed properly even though they do not work either....

Link to comment
Share on other sites

Do you have the entire dmesg that comes with it ? Maybe there's some message like a broken MMU or IOMMU. Or some other messages that might indicate that the problem is not directly within panfrost.

 

Also, did you try this patch : https://github.com/jernejsk/LibreELEC.tv/blob/linux56/packages/linux/patches/amlogic/amlogic-0001-FROMLIST-drm-panfrost-Don-t-try-to-map-on-error-faul.patch

 

This might just crash the driver earlier though.

 

EDIT : The patch is actually mainlined. Here's the commit (and patch) : https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/gpu/drm/panfrost/panfrost_mmu.c?id=eb9d8ddbc107d02e489681f9dcbf93949e1a99a4

Link to comment
Share on other sites

Aight, this is what I've got so far:

It seems like Panfrost does not like to be run on dvfs. Put the gpu governor to userspace and fix its frequency. This way it will run halfway stable. It still throws some errors to the dmesg but at least it does not crash.

Heatsink is mandatory!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines