Install Mali400 GPU driver on BananaPi from sources

How to install manually a newer gpu driver on the bananapi. OS is Lubuntu 3.1.1.
run all „make install“ as sudo.
Thanks to Ryad’s Blog


Before we start, we need new permissions.

touch /etc/udev/rules.d/50-mali.rules
vi /etc/udev/rules.d/50-mali.rules
#insert following:
KERNEL=="mali", MODE="0660", GROUP="video"
KERNEL=="ump", MODE="0660", GROUP="video"

Make sure, your user is in the video group:

adduser xyz video
apt-get install build-essential git xorg-dev xutils-dev libdrm-dev x11proto-dri2-dev libltdl-dev libtool automake
git clone https://github.com/linux-sunxi/libump.git
cd libump
autoreconf -i
./configure
make
make install
cd ..
git clone https://github.com/linux-sunxi/sunxi-mali.git
cd sunxi-mali
git clone https://github.com/robclark/libdri2
cd libdri2
./autogen.sh --prefix=/usr
make
make install
cd ..
git submodule init
git submodule update
mkdir /usr/lib/mali
make config ABI=armhf VERSION=r3p0
wget http://pastebin.com/raw.php?i=hHKVQfrh -O ./include/GLES2/gl2.h
wget http://pastebin.com/raw.php?i=ShQXc6jy -O ./include/GLES2/gl2ext.h
make -C include install
make -C lib/mali prefix=/usr/ libdir='$(prefix)/lib/mali/' install
sh -c 'echo "/usr/lib/mali" > /etc/ld.so.conf.d/mali.conf'
cd ..
git clone https://github.com/ssvb/xf86-video-sunxifb.git
cd xf86-video-sunxifb
autoreconf -vi
./configure --prefix=/usr
make
make install
rm /usr/share/X11/xorg.conf.d/99-sunxifb.conf
cp xorg.conf /usr/share/X11/xorg.conf.d/99-sunxifb.conf

From mali-sunxi repository you can now type and you will see a triangle. The console will tell you which renderer is being used:

make test
test/test

...
GL Vendor: "ARM"
GL Renderer: "Mali-400 MP"
GL Version: "OpenGL ES 2.0"
...

Restart xserver

sudo restart lightdm

and have a quick look through /var/log/Xorg.0.log to verify that the correct driver has been loaded:

...
(II) Module fbturbo: vendor="X.Org Foundation"
   compiled for 1.12.4, module version = 0.4.0
   Module class: X.Org Video Driver
   ABI class: X.Org Video Driver, version 12.1
(II) FBTURBO: driver for framebuffer: fbturbo
(--) using VT number 7
...

You can check your running driver version by compiling the version.c from version directory in sunxi-mali repo:

cd sunxi-mali/version
gcc version.c -o versionCheck
sudo chmod +x versionCheck
./versionCheck

Unfortunately, the repo will only install driver version r3p0, but the current one is r4p1 see: http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-linux-kernel-device-drivers/

At the moment, i don’t know how to compile the latest version… Concerned

2 Gedanken zu „Install Mali400 GPU driver on BananaPi from sources

  1. Hi,
    thank You so much for this tutorial, working like a charm ! There is a small trap, as lib ump is installing in /usr/local/lib, has to be moved to /usr/lib

    I’m not that linux guru, and maybe this question sounds silly at all, but they offer the newest drivers to download at:
    http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-linux-kernel-device-drivers/

    Is there no way to use those in your great tutorial ?

    thanks
    Martin

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.