My Experiments With LIMA the Open-Source MALI GPU Driver

Experiment 1) Discovering LIMA:

When I first heard about the lima driver it was over at limadriver.org, at that time I didn’t had much interest as I was more of an RPi FanBoy but also the VC4 Opensource driver was coming along fairly well that that seemed more interesting and in contrast the development on the lima driver had gone a bit stale tbh.

Fast forward to a few months back I saw this post from Phoronix, about the re-initiation of work on the Lima driver by Qiang Yu, but again reading the lines “So far this Mesa Gallium3D driver can run a simple OpenGL triangle draw application” put my interest on hold… until two weeks back.

 

Experiment 2) Off-Screen Rendering

Now when I finally decided to go ahead and try this out, I didn’t had any device that would work out of the box with the existing build systems (as it later turns out I did) that included buildroot for Allwinner based devices and Yocto for Amlogic SoC. So naturally I had to enable a close relative and that turned out to be the Banana Pi M1+ since CubieBoard2 was already enabled with lima in build root and both the boards use the Allwinner A20 SoC.

So they way Mali GPUs work in general, and this is afaik, they are used for rendering ONLY, all the display work is done by a separate display processor usually specific to the SoC vendor (like sun4i-drm for Allwinner, mason-drm for Amlogic etc.) unless they are using one build by Arm. So at a given time there are two DRM(Direct Rendering Infrastructure + Kernel Modsetting + a bunch of other things) drivers running one for the “Display Processor” for the actual video output and a second one for the actual GPU for rendering. And LIMA tackles the latter one, the one that does all the rendering.

So now that you know this you should also know that I was completely unaware of this situation, so I merrily went ahead and enabled the lima-drm driver for Banana Pi and…. drum roll…. kmscube crashed 🙁 (for obvious reasons). However it worked great off-screen and this is how that looks:

 

Experiment 3) On-Screen Rendering and Nano Pi M1

NOW after a few emails back and forth I am aware of the situation. So before I went ahead and enabled the sun4i-drm, I really wanted to see Lima working, and still unaware of the fact that I do actually own a verified board, I went ahead and bought the Nano Pi M1 since Qiang Yu uses that on his end and it was really cheap.

So it did end up working really well, and I also ended up adding support for the Banana Pi M1+

 

Experiment 4) Khadas Vim, Mali 450, and GLMark2

NOW I FINALLY REALIZE that I have the Khadas Vim that has the Amlogic S905X which is verified, I setup a yocto build for that and… drum roll… It wont boot 🙁

Again a few emails back and forth and we found out the issue was with wrong root partition path, solved that and now kmscube runs smoooooth.

But now I want to sun something a bit more “real world” because as exciting it is to people like me, a spinning cube on a grey background doesn’t speak out to the general public as spinning horse, cat and jellyfish do. Ofc I am talking about glmark2. After coming across this thread on the mesa-lima repo, I was able to get bits and pieces of GLMark2 working and it looked Coool…

Here is a small demo of kmscube and whatever-runs-in-GLMark2: 400 vs 450

 

And now I am off to try and enable more boards and possibly SoC(s)…

 

Acknowledgements:

Qiang Yu: for LIMA and helping out with Banana Pi M1+

Erico Nunes: For Allwinner LIMA Buildroot

Neil Armstrong: For Help with Kadas Vim and Amlogic OE meta layer and moon landing

Vasily Khoruzhick: GLMark2 discussions.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Anti-Spam by WP-SpamShield