If Mali400 is compiled without libump, then how to make it work?

Hello. I've compiled that driver. https://github.com/mripard/sunxi-mali

The kernel is latest Armbian for Orange Pi Lite, its version is 4.14.4, next branch.

I tried to enable included Mali driver, but it's for another device, so I disabled it.

One important note about the driver - I used 145c517 "Fix build against 4.14" commit. Latest commit had some troubles.

There's also note. The dirty hack is present in the source - it's even written in the file, and they say "to be eventually removed".

<../mm/cma.h> Charming. It's created during the patch. And there's even no cma.h in the headers. So I have to copy mm folder from the source and change that string during the build.

After the build, I noticed that there's no ump.ko. It's even disabled in build.sh, USING_UMP=0. Also, the UMP provided is broken, "incompatible pointer" to pagefault or whatever it was. So there's no option to use ump (I don't know which pointers are compatible, I use Python).

Before I ever managed to get a working kernel with mali module, I built libump, fbturbo and libdri2 by that guide https://gist.github.com/kashimAstro/2708a2e420900249e7ae8bc44ff3a875. Well that setup said that access to ump is denied. Of course - there was no ump.

Then i tried libs from mali-blobs. Fbdev one say eglgetdisplay() failed. I didn't mentioned that I've fixed the udev permissions to /dev/mali before.

Setting FRAMEBUFFER won't help. I have /dev/fb0 btw.

DMA_buf, or DMABUF one just crashes the X. Maybe I should try to enable aux display in the kernel.

Now I'm thinking about how to rebuild mali userspace again without libump.

Now to the point. Which userspace and/or kernel tools should be installed additionally, what to check if something goes wrong, and am I using legacy version of the driver which needs to be replaced, finally I just want to have GLES. Also - did I forgot to mention something.

Ah yes, during the Uboot boot I have a warning Cannot setup simplefb: node not found.

mali at sunxi repo is r3, mripard's is r6p2. Also README of first says something about "matching version of libump". So I need to find another source.

mripard's bundle includes mali_drm, but files isn't enough. Looks like these are just headers. Or don't need at all.

ADD: I got smarter! I catched x11_dma_buf stderr output before it crashed.

It's "XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
      after 11 requests (11 known processed) with 0 events remaining."

ADD: more smarter, I looked in Xorg logs. fbdev driver is unloaded and modesetting driver is loaded instead. Trying to figure out why.

ADD: edited xorg.conf.d, forced fbdev for Card0. Now "fbioputcmap invalid argument" in xorg log.

ADD: how to change screen resolution for fbdev?

It seems that fbturbo had its own xorg conf. Copied that to xorg.conf.d. Now my driver is fbturbo. Bunch of another errors. Here:

[ 14.467] (EE) FBTURBO(0): FBIOPUTCMAP: Invalid argument
[ 14.467] (==) FBTURBO(0): DPMS enabled
[ 14.467] (II) FBTURBO(0): failed to enable hardware cursor
[ 14.490] (II) FBTURBO(0): can't load 'mali_drm' kernel module
[ 14.499] (II) FBTURBO(0): can't load 'sunxi_cedar_mod' kernel module
[ 14.499] (II) Loading sub module "dri2"
[ 14.499] (II) LoadModule: "dri2"
[ 14.499] (II) Module "dri2" already built-in
[ 14.593] SunxiMaliDRI2_Init: drmOpen failed!
[ 14.593] (II) FBTURBO(0): failed to enable DRI2 integration for Mali GPU