A20 mali gpu hardware acceleration Debian?

Started by jeeppler, January 18, 2021, 01:31:13 am

Previous topic - Next topic


I tested if I can run 0 A.D.[1] or Endless-Sky[2] on the A20 Lime2 board.

My objective was to see how well the Mali 400 MP2 GPU on the A20 Lime2 board works. According to the Linux-Sunxi article about Mali[1], the kernel parts of the Lima driver have been merged into the Linux Kernel 5.2 and the userspace parts are merged into Mesa since April 2019. Lima is the free and open source driver for Mali 4xx Utgard.

I was not able to get the hardware acceleration to work. Instead the Gallium llvmpipe driver[4] was used.

The steps:

1. I downloaded and installed the latest Debian 10 "Buster" image from Olimex on my A20 Lime2 board: A20-OLinuXino-buster-base-20201217-194545.img.7z [5].

2. Started the board. Checked the software:
- Mesa version: 18.3.x -> using the Gallium LLVMpipe driver
- Olimex kernel 5.8.x

3. Installed 0 A.D. It did load the start menu, but crashed the moment I started a new match in the game.

4. Upgraded Debian "Buster" to Debian testing "Bullseye"

5. Rebooted.

6. Checked software:
- Mesa version: 20.3.x -> using the Gallium LLVMpipe driver
- Olimex kernel 5.8.x

7. Started 0 A.D. again. Same as previously, the game showed the menu, but crashed after starting a new match.

8. Installed Endless-Sky. Started Endless-Sky and it worked. Endless-Sky is super slow (around 1 fps), but it worked.

My expectation was, that after upgrading to Mesa 20.3, the system will use the "Lima driver" and I have 3D hardware acceleration from the Mali 400 MP2 GPU.

Don't get me wrong, I am impressed about the performance of the llvmpipe driver. Upgrading from Mesa 18.3 to 20.3 improved the graphics performance significantly.

However, I would like to know how to get the Mali GPU hardware acceleration working under Lima. What did I miss?   

[1]: https://play0ad.com/
[2]: https://endless-sky.github.io/
[3]: http://linux-sunxi.org/Mali
[4]: https://docs.mesa3d.org/drivers/llvmpipe.html
[5]: http://images.olimex.com/release/a20/


Unfortunately all existing Mali Hardware acceleration patches are incompatible with Mainline Linux.

The hardware acceleration works only on the 3.4 images with Android Kernel and on KODI images.


According to the Linux-Sunix the Lima driver is available in the mainline kernel 5.2+:

"Lima driver (Open Source)

Lima is a project to develop a completely open source graphics driver which supports ARM's Mali-400 and Mali-450 GPUs.

It consists of two main parts:

    Kernel parts have been included in mainline kernel since v5.2
    Mesa (userspace) parts have been part of upstream project since April 2019."

source: http://linux-sunxi.org/Mali

The Linux kernel contains the Lima driver: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/lima

I am not an expert when it comes to the Linux kernel or the graphics stack, but from my understanding it should be possible to run the Lima driver from the mainline kernel on the A20. Again, I think I missed something like configuration settings or compiling the kernel with the Lima driver.


Just to clarify my objective (goal). I want to run the free and open source Lima driver on the A20.


We want that too, but our developers can't get it working either, else we would have included it in the images. Maybe we miss something or maybe the announcement of the LIMA support in mainline is misleading.

As Tsvetan mentioned, for the moment only the older images with sunxi kernel (3.4.x) have hardware acceleration (but these images contain some binary blobs).
Technical support and documentation manager at Olimex