On Sun, 20 Sep 2015 08:26:27 -0700 (PDT)
[email protected] wrote:

> Hey all!
> 
> I'm considering moving from kernel 3.4.103 to 4.2
> IIRC the mali binary driver will not work on 4.2 but
> I can't find the page I got that information from.
> Will I be able to use mali on the new kernel?

First of all, Mali is a 3D accelerator, which can only render
3D graphics to the system memory. It has nothing to do with
delivering the picture to LCD, HDMI, VGA or other displays.

Mali can work together with the display controller (which is
a different hardware block), so that you can actually see your
3D game on your monitor.

The display controller can work fine without Mali. Currently
the display controller is configured by U-Boot to provide a
simple framebuffer (a dedicated area in memory, where you
can write pixel data and it becomes visible on your display).
The mainline kernel can just keep this display controller
configuration and use it. This is called simplefb. And simplefb
can't change the screen resolution, switch output between
VGA/HDMI, blank/unblank the screen for power saving purposes,
and do other useful things. The real display controller driver
for the kernel would be KMS.

Now back to Mali. It should work with any kernel if you compile
the kernel driver for it and obtain the userspace binary blob
with exactly the same version as the kernel driver. ARM offers
the kernel driver sources from their website, because they
are GPL licensed:
    
http://malideveloper.arm.com/resources/drivers/open-source-mali-utgard-gpu-linux-kernel-drivers/
However obtaining the proprietary userland blob is a bit
tricky. ARM only seems to provide the 64-bit blob for Mali-450
for the HiKey platform directly from their website:
    
http://malideveloper.arm.com/resources/drivers/arm-mali-utgard-gpu-user-space-drivers/
 
Please note that it has quite a restrictive EULA. This is far
from perfect. You can also have a look at these links:
    https://groups.google.com/forum/#!topic/linux-sunxi/qwbF5rb4soc
    https://lists.linaro.org/pipermail/linaro-dev/2014-July/017352.html 

The users of the non-HiKey hardware are supposed to obtain the
Mali blobs from the hardware vendor. We do have the old Mali
userland blobs (versions r3p0 and r3p2), which had been provided
by CubieTech. The old userspace blobs are not compatible with
the newer versions of the kernel drivers.

Theoretically, one could try to port the old r3p0 or r3p2 Mali
kernel driver to 4.2 and get it to work with the r3p0 or r3p2
userspace blobs. However this is not a very good idea, because
the newer Mali kernel drivers got support for devicetree and
dmabuf. Working with the outdated code is not nice.

Oh, and when I'm saying that one just needs to download the
kernel driver sources from the ARM website and compile them,
that's only one part of the work. Another part is to ensure
that the Mali hardware can be powered up (some clocks need
to be enabled) and that the resources (such as IRQ) are also
configured correctly. With the modern kernels, this
configuration information is usually added to the DTS
files. If you only compile the kernel module without doing
anything else and try to load it, then it will not work.

Other than this, one should be able to make Mali work even
with simplefb. As I mentioned in the beginning of this post,
the Mali hardware writes its output to the system memory.
It can render pictures to the framebuffer too. You will not
get tear-free animation though, because tear-free animation
requires page flipping synchronized with vblank. And this
needs the KMS driver.

To sum it up:
1. It makes very little sense even trying to do anything with
   the proprietary Mali drivers without the new binary blobs.
2. Somebody needs to adapt the Mali kernel driver to sunxi
   hardware. It is not too difficult and I can do this myself
   or provide some assistance. But I don't feel very motivated
   at the moment :-)
3. The KMS driver would be nice to have, but it is not strictly
   required.
4. Everyone needs to understand that a patched kernel would
   be required (to add the Mali driver and also update the
   dts/dtsi files with the description of Mali hardware).

-- 
Best regards,
Siarhei Siamashka

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to