Mali-450 support by lima

(dorabmon) #1


Mali-450 seems like ablely supported by lima on an out-of-tree v4.16-rc5. A reference design can be found at

and the tree can run some basic examples.

Btw, Lima is an open source implementation for mali 450 driver. However, I thought It is not mature as the driver officially ARM provides. But knowing the port to lima should be helpful for us to know how to port to driver and library ARM provided officially.


We add support for lima now ! Please take a look at wiki:

(Frank W.) #3

can you give me the steps to include it? i guess i have to apply your patches and include the repo ( into my kernel-source-Tree.

The last step is not completely clear to me. where should it be included, will it compiled by kenel-makefile or does it need additional make-command

did i need additional kernel-options?

(Alex R.) #4

I’ve adopted lima driver from and patchwork (for now - w/o mediatek patches)

I got this during boot:

pi@bpi-iot-ros-ai:~$ dmesg | grep lima
[    8.492918] lima 13040000.gpu: bus rate = 500500000
[    8.492930] lima 13040000.gpu: mod rate = 500500000
[    8.493292] [TTM] Zone  kernel: Available graphics memory: 248738 kiB
[    8.493298] [TTM] Zone highmem: Available graphics memory: 1030560 kiB
[    8.493302] [TTM] Initializing pool allocator
[    8.493324] [TTM] Initializing DMA pool allocator
[    8.494773] lima 13040000.gpu: gp - mali450 version major 0 minor 0
[    8.494849] lima 13040000.gpu: pp0 - mali450 version major 0 minor 0
[    8.494918] lima 13040000.gpu: pp1 - mali450 version major 0 minor 0
[    8.494980] lima 13040000.gpu: pp2 - mali450 version major 0 minor 0
[    8.495031] lima 13040000.gpu: l2 cache 8K, 4-way, 64byte cache line, 128bit external bus
[    8.495040] lima 13040000.gpu: l2 cache 128K, 4-way, 64byte cache line, 128bit external bus
[    8.505811] [drm] Initialized lima 1.0.0 20170325 for 13040000.gpu on minor 1

And, at least for now, I have no questions about kernel driver.

But during mesa installation ( using instruction at on make install) i got these errors: log (88,1 kb).

As I’m not familiar with ubuntu/debian distros I can’t resolve this problem by myself :frowning:. I suppose that I’m missing some lib or lib-dev which is nessesary, but I’m not sure.

P.S. I’ve tried to build/install mesa on R2 itself, using ubuntu 2018-03-29-ubuntu-16.04-mate-desktop-bpi-r2-sd-emmc.

P.P.S. Latest chages are in - based on franks 4.16-hdmi+wlan branch.

P.P.P.S. CONFIG_DRM_LIMA sould be configured manually - it’s not in defconf.

(Frank W.) #5

I guess it’s a problem similar to that: (not using linker directly)


I suggest you to build those stuff in Debian environment.

(Alex R.) #7

Thank you for Your advice. Looks like it’s ubuntu problem. I’m going to use Gentoo linux which I’m familiar to. :slight_smile:

(Alex R.) #8

I’ve forgot to add new files to git last time. Fixed now.

(Alex R.) #9

I’ve finnaly built mesa-lima. And it doesn’t work out of box:

pi@bpi-r2-gentoo ~ $ glxinfo 
name of display: :0.0
Error: couldn't find RGB GLX visual or fbconfig

Xorg.0.log (31,6 КБ)

My thoughts:

./configure --with-gallium-drivers=exynos,sun4i,meson,rockchip,lima --with-dri-drivers= \
  --with-platforms=drm,x11 --disable-xvmc --disable-vdpau --enable-debug

There are more gallium-drivers than just mesa probably we need another one for mediatek.

  1. There is mediatek-related code in this repo which, propably, should be used too.

(dorabmon) #10

if you have mesa-lima, please give a try first with “offscreen” as below or [1] for details to say, at least it can be working for me with these offscreen examples.

But currently, i have no much idea about how to let them work on hdmi, because I don’t know how to have a good setup on xserver allowing two drm devices, gpu and hdmi, can work together and perfectly.

Maybe it requires somebody good to know xserver script can help it out.


Be able to run the following OGL application:

off-screen rendering
simple triangle:
vertex shader uniform:
multi varying:
multi draw:
./kmscube -d -D /dev/dri/renderD128
./kmscube -d -D /dev/dri/renderD128 -M rgba

(Alex R.) #11

I’ve tried ro run ./kmscube -d -D /dev/dri/renderD128

And it partially works, but hangs. kmscube.log (4,8 КБ) lima-dmesg (4,7 КБ)

Probably it’s a promlem with lima kernel driver backporting drom 4.17 to 4.16

simple triangle hangs on same place

lima_pipe_flush: flags=1

(Alex R.) #12

Probably it should work in a way like laptop hybrig graphics - using DRI_PRIME to choose driver (e.g. intel+radeon or intel+nvidia), but i’m not sure if it’s implemented in gpu driver or in Xorg server itself.

P.S. I’m still trying to debug and run offscreen example, but w/o success.