
Open source Mali GPU drivers merged - caf
https://lkml.org/lkml/2019/5/8/1122
======
Jonnax
What devices can be used with these drivers?

The message says there's two drivers:

"Lima covers the older t4xx and panfrost the newer 6xx/7xx series"

My perception is that Mali GPUs were just in Android phones where running
where it's generally not possible to run a vanilla kernel or the bootloader is
locked.

Any dev boards?

~~~
Gregordinary
There's a Chromebook, the Asus C201 that will benefit from this. I'm currently
running PrawnOS (Debian-based) on it. Wrote a bit about that on reddit:
[https://old.reddit.com/r/linux/comments/bebm93/linux_on_asus...](https://old.reddit.com/r/linux/comments/bebm93/linux_on_asus_chromebook_c201/)

Basically this DRM driver plus the companion Panfrost Gallium3D driver merged
into mesa 19.1 will enable blob-free 3D graphics on the C201 and other devices
that use this chipset.

Right now the DRM kernel driver does not support X11, so it'll be a few more
releases before I can really take advantage of it. I have successfully
installed it along with and run the kmscube demo outside of X. Pretty exciting
development.

With Panfrost, every component of the C201 except the BCM4354 WiFi chip
becomes libre. Cypress bought out a division of Broadcom and started releasing
datasheets on a bunch of WiFi chips including the BCM4354, which they now tag
as CYW4354. (PDF:
[https://www.cypress.com/file/298141/download](https://www.cypress.com/file/298141/download))

Not sure if that makes it easier or any more realistic to get blob-free
firmware for this chip. I can only hope.

~~~
floatboth
Does the new DRM driver currently work with Wayland compositors? I know Alyssa
has demonstrated Weston on Panfrost, but that might've been with ARM's kernel
driver or something

~~~
Gregordinary
Yup, it supports Weston. Possibly more as it does say it supports _some_
Wayland compositors, but only mentions Weston in the example:
[https://panfrost.freedesktop.org/building-panfrost-
mesa.html](https://panfrost.freedesktop.org/building-panfrost-mesa.html)

~~~
TheCycoONE
It's broken at present, due to exposing BUFFER_AGE which isn't properly
implemented. Should be fixed in mesa 19.2.

~~~
Gregordinary
Oh, good to know. Thanks for sharing that info!

------
q3k
The fact that ARM has not made their Mali drivers open source is a joke.
There's no excuse, same for Nvidia.

~~~
stefan_
Strictly speaking the _kernel_ drivers for the ARM Malis are all open-source
and GPL licensed (they need to be, since their customers want to ship Linux to
consumers).

They are also entirely useless without the userland software that is doing all
the actual work. The kernel drivers are just glorified task and memory
managers.

~~~
rjsw
It would be nice if they had been dual-licenced like the radeon, intel and
nouveau kernel drivers.

I thought that the Lima and Panfrost projects included an open-source userland
component too.

~~~
stefan_
They do, the userland part is in Mesa:

[https://gitlab.freedesktop.org/mesa/mesa](https://gitlab.freedesktop.org/mesa/mesa)

------
neilv
I'm not sure these exact GPUs are supported yet, but this sounds like good
news for mainline Linux on Samsung smartphone hardware:
[https://wiki.postmarketos.org/index.php?search=mali&title=Sp...](https://wiki.postmarketos.org/index.php?search=mali&title=Special%3ASearch&go=Go)

~~~
0xcde4c3db
Note that most flagship Samsung phones have US variants based on a Qualcomm
Snapdragon SoC (Adreno GPU) instead of an Exynos. This seems to be for US-
specific reasons related to a legal battle between Samsung and Qualcomm rather
than being driven by technology requirements.

~~~
neilv
Thank you, this confusion between very different International and US/NA
versions with the same marketing name has been a headache for open source
projects. You wouldn't believe how much trouble I had sourcing a few
International version S3, from US eBay (claims of an item being the GT-i9300
model number for the International version were usually wrong).

------
mgamache
Does this support hardware video encoding (h264)? There are a lot of SBCs with
Mali GPUs that could use video encoding support.

~~~
StudentStuff
H.264 and H.265 decoding is handled by the VPU, and there was already a
successful kickstarter to add mainline support for that:
[https://www.kickstarter.com/projects/bootlin/allwinner-
vpu-s...](https://www.kickstarter.com/projects/bootlin/allwinner-vpu-support-
in-the-official-linux-kernel/comments)

Ditto for the HDMI PHY, you can spin up Xorg with a fully libre stack on
nearly any of the Allwinner boards from OrangePi, FriendlyARM, etc. The Mali
GPU is really only useful for OpenGL ES (aka video games).

------
messe
What license? Are they, like the intel and radeon gpu drivers, importable into
OpenBSD/FreeBSD?

~~~
floatboth
FreeBSD does not import GPU drivers into base, they're now packaged and under
the GPL (they depend on some GPL code imported from Linux).

The "fun" part with these drivers is FDT attachment, but work is ongoing in
FreeBSD on this.

~~~
trasz
That's the current situation - but the drivers themselves are mostly free of
GPL; the GPL-derived parts in linuxkpi can be (and eventually will) be
rewritten to make them BSD-licensed, and that would make it possible to go
back to importing GPU drivers into base, if the DRM developers wish so.

------
ddtaylor
This should help a bit with the wave of new Pi-based emulation boards that are
being used.

~~~
simcop2387
Won't affect any raspberry pi based systems. the Broadcom chip there isn't
Mali based. For that you need a VC4/V3D chip driver, but that's also being
developed.
[https://anholt.github.io/twivc4/2018/10/30/twiv/](https://anholt.github.io/twivc4/2018/10/30/twiv/)

~~~
megous
There are many more '* Pi' boards than just Raspberry Pi. A lot (most) of them
have ARM GPU.

~~~
imtringued
Yeah and they were useless because they didn't have GPU drivers. Now the
situation has reversed and the Raspberry Pi is now the board that is most
dependent on proprietary software.

~~~
megous
Actually not true, even without GPU support all the ones I have (4 different
SoCs - H3,H5,H6,A83T) are noticeably faster than Rpi 2 for things like
browsing the web. (H5/H6 a bit unfair, since it's A53 CPU)

And desktop use is not the only thing you can do with these boards, and pretty
much any of them is better than Rpi on connectivity, which is what matters for
other use cases.

------
anonymousDan
Do any of the Mali GPUs support GPGPU (e.g. OpenCL), and are those drivers
being open sourced? In fact, if I wanted to do GPGPU on something like a
Raspberry Pi, what are the best options currently (open source drivers or
not)?

~~~
robert_foss
The ARM Mali T-series and G-series of GPUs do support compute (OpenCL), the
drivers are a different story.

Let's just start out by saying that the GPU designer, ARM, does not support
the Open Source driver. Most likely due to their IP-licensing scheme relying
on charging customers for the hardware IP and then again charging them for the
drivers that they are going to need. Previously the rumors went that they
charged customers a 3rd time if they wanted OpenCL support. This is part of
the reason why OpenCL on mobile is dead.

As for actual OpenCL support for Mali GPUs using the Open Source stack, work
is progressing, but we (the Mesa & Clover) project aren't there yet.

Regarding the RPi, I don't think it has ever had OpenCL support. Proprietary
or otherwise. About the RPi, Broadcom (the SOC designer) recently lost their
very talented GPU driver engineer, due to not being serious enough about
pushing the Open Source driver forward.

To answer your question about OpenCL on the RPi in practical terms, it's not
possible to use the GPU. But you can use POCL for CPU-backed OpenCL support.

~~~
anonymousDan
Thanks for the detailed comment! Regarding OpenCL on RPi, what about something
like this: [https://hackaday.com/2019/01/24/running-opencl-on-a-
raspberr...](https://hackaday.com/2019/01/24/running-opencl-on-a-raspberry-pi-
gpu/) Do you think it could support ML training/inference on a Pi GPU (albeit
very slowly obviously), or even OpenCV?

~~~
robert_foss
Sorry, I'm not familiar enough with ML/OpenCV but I would think that GPU
acceleration of it on the RPi is a tall ask.

------
cbluth
i hear the armbian team cheering from all the way over here.

------
kbumsik
I don't know much about ARM SoC ecosystems for Linux, but am I correct if I
take this as a direct ARM Mali version of Nouveau, or it's slightly different?

I'm very surprised that ARM, the company that should provide proper software
references for its ecosystem, is not open source friendly.

~~~
djsumdog
There is no actual ARM platform, like in the case of a PC. (Intel x86/64 is
not a platform. You can find an x86 compatible chip in a PS4, but it's missing
all of the critical components that let it boot like a PC. See the Fail0ver
video on PS4 kernel hacking for more info).

ARM chips are just System-on-Chips with random pins soldered to random shit
and broken, non-upstreamable kernels that are only released after a phone has
been out for like 6 months.

It's a shit system for any type of truly open development:

[https://penguindreams.org/blog/android-
fragmentation/](https://penguindreams.org/blog/android-fragmentation/)

~~~
makomk
This is actually useful though - it's not a full equivalent of Noveau because
it doesn't include video output support of any kind and that tends to be
vendor-specific hardware, but people have already got the necessary video out
support for a bunch of cheap hardware with ARM Mali GPUs into mainline Linux
and this was the missing link for full accelerated graphics support.

------
rocky1138
Will this improve performance on the Pinebook?

------
thanatos519
Hopefully this gets us closer to better-than-OpenGL-ES support on the Gemini
PDA which has an 8xx.

------
snowAbstraction
Are any odroid SBCs affected?

~~~
IronBacon
I would say C1/C2 (Mali-450) and maybe XU4 (Mali-t628).

------
TazeTSchnitzel
⠀

~~~
mises
Interesting stuff in userspace? I thought drivers worked in kernel for
performance reasons (part of why wireguard performs well). Any where I can
learn more about what is in userspace and why?

I'm also curious, how does performance compare to the binary blob?

~~~
blu42
Buffer management is in kernel space, but that's about all that happens in
kernel space GPU-wise. Indeed, most interesting things happen in user space.

------
codedokode
Linux still is not friendly to proprietary code. To install third-party
software user often has either to run a bash script with root privileges that
can potentially break the system, or add a proprietary repository (which
allows its owner to replace any software on user's machine). Before flatpack
and snapcraft there was no sane way to install third-party software.

The same problem is with drivers. Maybe there is a way to allow drivers with
closed source code and get better hardware support? For example, what about
copying or supporting Android's driver model?

~~~
megous
Linux is much more than general distros and closed source drivers are pain in
the ass for everybody. Vendors should just mainline the support for their HW,
especially if they benefit from Linux overall.

~~~
codedokode
Maybe there is a way to run them safely. For example, have an open source part
running in kernel, and closed source part that is properly isolated in
userspace.

~~~
monocasa
That's AMD's current model. There's both community open drivers and closed
vendor drivers sharing an open and upstreamed kernel module.

