0
musicPi

BananaPro: lima driver problems

Recommended Posts

(edited)

Hello guys,

I've been playing around with the build-in lima drivers but didn't get it to work on BananaPro using Armbian_20.02.1_Bananapipro_buster_current_5.4.20_desktop image.
I installed drivers armsoc, modesetting, fbdev from debian buster repos but "Xorg -configure" fails.

 

/var/log/Xorg.0.log says:

 

Quote

[   624.247] (==) ServerLayout "X.org Configured"
[   624.247] (**) |-->Screen "Screen0" (0)
[   624.247] (**) |   |-->Monitor "Monitor0"
[   624.249] (**) |   |-->Device "Card0"
[   624.249] (**) |   |-->GPUDevice "Card0"
[   624.249] (**) |-->Input Device "Mouse0"
[   624.249] (**) |-->Input Device "Keyboard0"
[   624.249] (**) Option "BlankTime" "0"
[   624.249] (**) Option "StandbyTime" "0"
[   624.249] (**) Option "SuspendTime" "0"
[   624.250] (**) Option "OffTime" "0"

 

and

 

Quote

[   624.250] (**) ModulePath set to "/usr/lib/xorg/modules"
[   624.251] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[   624.251] (WW) Disabling Mouse0
[   624.251] (WW) Disabling Keyboard0
[   624.251] (WW) Falling back to old probe method for armsoc
[   624.251] (II) No BusID or DriverName specified - opening /dev/dri/card0
[   624.251] (II) Got BusID 1c40000.gpu
[   624.252] (II) Opened DRM
[   624.252] (II)    DeviceName is [/dev/dri/card0]
[   624.252] (II)    bus_id is [1c40000.gpu]
[   624.252] (II)    DriverName is [lima]
[   624.252] (II)    version is [1.0.0]
[   624.252] (II) Screen:1,  CRTC:0
[   624.252] (II) No BusID or DriverName specified - opening /dev/dri/card0
[   624.253] (II) Got BusID 1c40000.gpu
[   624.253] (II) Opened DRM
[   624.253] (II)    DeviceName is [/dev/dri/card0]
[   624.253] (II)    bus_id is [1c40000.gpu]
[   624.253] (II)    DriverName is [lima]
[   624.254] (II)    version is [1.0.0]
[   624.254] (II) Screen:2,  CRTC:1
[   624.254] Number of created screens does not match number of detected devices.
  Configuration failed.
[   624.254] (EE) Server terminated with error (2). Closing log file.

 

and generated xorg.conf:

 

 

Quote

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/X11/misc"
        FontPath     "/usr/share/fonts/X11/cyrillic"
        FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/Type1"
        FontPath     "/usr/share/fonts/X11/100dpi"
        FontPath     "/usr/share/fonts/X11/75dpi"
        FontPath     "built-ins"
EndSection

Section "Module"
        Load  "glx"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/input/mice"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "Debug"                     # [<bool>]
        #Option     "NoFlip"                    # [<bool>]
        #Option     "DRICard"                   # <i>
        #Option     "BusID"                     # <str>
        #Option     "DriverName"                # <str>
        #Option     "DRI2MaxBuffers"            # <i>
        #Option     "InitFromFBDev"             # <str>
        #Option     "UMP_LOCK"                  # [<bool>]
        Identifier  "Card0"
        Driver      "armsoc"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

 

Any suggestions what I am doing wrong?

 

regards

Edited by musicPi

Share this post


Link to post
Share on other sites

looks to me like it initialized properly but only has 2pp cores instead of 4 defined in the dtb maybe?

Share this post


Link to post
Share on other sites
(edited)

Thanks a lot for your replies!
I still have the problem lima does not work properly.
Module sun4i-drm, which is needed for lima, is avaliable via modprobe (at least ist gives no error message), but seems not to be loaded either. lsmod does not show it.

I don't exactly know what is wrong but it seems there is a problem with the compiled driver.
When I look into /lib/modules/5.4.44-sunxi/kernel/drivers/gpu/drm/sun4i/ there is just a file called sun6i_mipi_dsi.ko. What has sun6i todo with sun4i? The GPU is a different one (Power VR SGX 544 instead of Mali 400).

The only thing I've found on my system is /sys/bus/platforms/drivers/sun4i-drm.
There is no device bound to and no module connected.

So I've build an image for bananapro myself, but it looks the same.
For some reason I compiled an image for bananapi and surprisingly sun4i-drm has been loaded. I´m going to check if it works correctly...

I'm interested in the differences between those two configurations and of course it would be very nice to apply this configuration also to the bananapro image!

Edited by musicPi

Share this post


Link to post
Share on other sites

On the BananaPi image startx says:
 

Quote

gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/sun4i-drm_dri.so: cannot open shared object file: No such file or directory
failed to load driver: sun4i-drm

Indeed /usr/lib/arm-linux-gnueabihf/dri/ contains various *_dri.so files but none called sun4i-drm.
Any suggestions what to do?

Share this post


Link to post
Share on other sites
(edited)

Finally got it to work building mesa on my own on a recent BananaPi image  :beer:
But it would be very cool if the sun4i-drm driver was fixed in BananaPro images.
Can you please take care of that, Igor?
I'll help you as far as I can and will provide further information from my test machine.

Edited by musicPi

Share this post


Link to post
Share on other sites
Quote

I'll help you as far as I can and will provide further information from my test machine.

You could start by telling what you did to achieve make it work?

Share this post


Link to post
Share on other sites
(edited)
1 hour ago, Werner said:

You could start by telling what you did to achieve make it work?

I just built the lastest armbian sources for BananaPi minimal, which is version Armbian_20.08.0-trunk_Bananapi_buster_current_5.4.44_minimal and startet ist on my BananaPro.
After that I got mesa running doing this:

Quote

 

apt build-dep mesa
apt install -y valgrind cmake libunwind-dev

git clone --branch mesa-19.3.2 https://gitlab.freedesktop.org/mesa/mesa.git
cd mesa/
meson build/ --optimization s --buildtype release --prefix=/usr --libdir=lib/arm-linux-gnueabihf -Dgallium-drivers=lima,panfrost,kmsro,swrast -Dplatforms=x11,drm,surfaceless

ninja -C build/
ninja -C build/ install

 

... and kodi on X11 started properly. Got into Kodi->Systeminformation. There it says lima driver is used. This failed on various BananaPro images before.

 

The question is how to integrate that into a build script.


Furthermore there seem to be some differences between the image configuration of BananaPi and BananaPro although the only differences are integrated WIFI-Device (Pro) and 40-Pin GPIO (Pro). Therefore there should be no differences between processorelated functionality.
Differences known so far (each image tested on bananapro):
AHCI does work properly on Pro but fails on Pi,

sun4i-drm works on Pi but not on Pro

I`m going to try some reverse engineering to find the differences in configuration.


 

Edited by musicPi

Share this post


Link to post
Share on other sites
On 6/5/2020 at 3:28 PM, musicPi said:

sun4i-drm works on Pi but not on Pro

No, it doesn't. I have a Banana Pi M1 and I get the same errors about the missing sun4i-drm driver.  None of the builds with Linux kernels above 3.14 ever worked for me, they all fail to load the graphics drivers. Not only armbian, but other distributions as well.

Share this post


Link to post
Share on other sites
On 6/7/2020 at 7:53 AM, asdf2005 said:

No, it doesn't. I have a Banana Pi M1 and I get the same errors about the missing sun4i-drm driver.  None of the builds with Linux kernels above 3.14 ever worked for me, they all fail to load the graphics drivers. Not only armbian, but other distributions as well.

lsmod shows sun4idrm and as far as i can say all devices needed are where they should be. On that base Lima can be run with basic functionality. It does not work like a charm (not all GL-Drives do work) but lima is able to run kodi.
 

Share this post


Link to post
Share on other sites
(edited)

I got lima working on BananaPro by adding following contents to build/cache/sources/u-boot/v20XX.XX/arch/arm/dts/sun7i-a20-bananapro.dts :

Enable HDMI:

Quote

/ {

 

    // right under chosen-tag:
    hdmi-connector {
            compatible = "hdmi-connector";
            type = "a";

            port {
                hdmi_con_in: endpoint {
                    remote-endpoint = <&hdmi_out_con>;
                };
            };
        };

};

 

Quote

// right under &gmac-tag:

 

&hdmi {
    status = "okay";
};

&hdmi_out {
    hdmi_out_con: endpoint {
        remote-endpoint = <&hdmi_con_in>;
    };
};

 

Enable display engine:

Quote

right under &codec-tag:

&de {
    status = "okay";
};

 

Change build/cache/sources/linux-mainline/orange-pi-5.XX/arch/arm/boot/dts/sun7i-a20-bananapro.dts accordingly.

 

Then compile the mesa driver like this:

 

nano /etc/apt/sources.list // uncomment #src
apt update

apt build-dep -y mesa
apt install -y git g++ build-essential pkg-config
apt install -y libx11-dev libgl1-mesa-dev
apt install -y valgrind cmake libunwind-dev
apt install -y libudev-dev

// if you get meson version errors
apt install -y python3-pip
pip3 install --upgrade meson

git clone https://gitlab.freedesktop.org/mesa/mesa.git

cd mesa/
/usr/local/bin/meson build/ --optimization s --buildtype release --libdir=/usr/lib/arm-linux-gnueabihf -Dgallium-drivers=lima,panfrost,kmsro,swrast -Dplatforms=x11,drm,surfaceless

ninja -C build/
ninja -C build/ install

 

Now it's working (at least to run Kodi, but there ist still a great difference in power between this lima driver version and the mali driver provided at sunxi.org)!

 

I don't know what changes are necessary to BananaPi but the Problems concerning SATA and AHCI seem to come from a different way of handling the PMIC. I saw similar dts-files with that specific PMIC axp209.dtsi-file. They got a AHCI-tag looking like this:

Quote

&ahci {
    target-supply = <&reg_ahci_5v>;
    status = "okay";
};

Maybe the target-supply-line will do the thing. I'll ty later.

Never the less i get problems when starting my original allwinner 5"-LCD using this tutorial:

https://forum.armbian.com/topic/7233-bananapi-pro-7-touchlcd-with-debian-buster-and-mainline-kernel-5xxxx/

I changed the parameters from 7"-LCD to 5"-LCD and itis working very well without displayengine enabled.
But when I enable it the screen freezes at boottime, right after saying "starting networkinterfaces".
Has anyone ever had the same problem and can help me with that?

 

Edited by musicPi

Share this post


Link to post
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...
0