Lima userspace drivers: Xorg/mesa/tools/etc for BPI-R2

In my 5.5-lima i used the same approach as in 4.4-mali module - dts regulators. Literally ported part of dts from 4.4 to 5.5. So now i want to try use it as an overlay.

We can define it in bananapi.dts disabled so you to enable it only in your overlay

I see you have also code changes in the mentioned commit…

You can rebase needed changes on my 5.9-hdmi, then i can include it in my repo in future

All code changes are for debug only.

Ok, i can try.

to be continue in Mali-450 support by lima :slight_smile:

Seems like crosscompiling mesa is possible without additional vm

https://sunxi.org/Mali_Open_Source_Driver#Cross_Compiling

Looks like it’s for debian, so i’ll need an additional VM :slight_smile:

But the binaries created will only work on debian because they are linked to debian libs :slight_smile:

Maybe chroot variant is best way…maybe that can be used also for other versions

Create a chroot and run build-process inside

Mali-450 support by lima => 20.0.x to have no unstable depency (meson 0.49.2 from debian 10)

successfully build mesa inside chroot

buildchroot.sh (1,2 KB)

build_mesa.sh (1,3 KB) mesa.patch (1017 Bytes)

sudo cp build_mesa.sh mesa.patch debian_buster_armhf/root/
sudo chroot debian_buster_armhf /root/build_mesa.sh

built files here: https://drive.google.com/file/d/1cNdpbW7cOSbvQPLc72KsdwwFxJMuY8az/view?usp=sharing

Great! Did you tested it? (I mean stability, blinking menus/buttons etc.)

Not yet due to missing time

Recently mediatek entry point patch was accepted to mesa mainline.

So now it’s not nessesery to patch mesa for git master.

UPD: Just finished testing - everything compiles and works just great with latest sources from git.

2 Likes

Hi Guys - just reporting that I’ve gotten everything working with Frank’s 5.10-rc - patches to mesa etc

I had reached this stage all that time ago! the ONE thing I didn’t do? is to disable DRM debugging - all of a sudden? I have buttery smooth GL - thanks Alex for spotting that!

I’m going to be uploading an image with everything correctly setup and I’m building the patched mesa as debian packages - so that should make intergration in future far less painful.

I’m using Debian 10 upgraded to the testing branch - Mesa + Libdrm are both snapshots from their respective gits - performance is excellent.

I have also, this time, very carefully noted every single step to cross compile mesa, I’ve written scripts that install all dependencies, add the architecture support etc

Also meson cross files as well as an LLVM meson wrapper (needed due to some package dependency quirks not allowing llvm to be installed on one machine for two architectures)

I’ll upload those too so people can compile themselves - but I think a lot of people just want it working in a distro

Hdmi is mailine till 5.10,

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts?h=linux-5.10.y#n246

mesa patch (adding mediatek.so) are also in,but maybe not yet in distribution packages (debian buster) so need to be compiled manually.

Drmdebug should be only a option in uboot (bootargs/graphics var) passed to kernel cmdline which can be removed in production.

debug.drm=0x07 seems to be set somewhere outside of uEnv.txt - it’s being appended to the linux command line AFTER the bootopts insertion.

I’ve checked the boot section of the kernel config but the culprit isn’t there either.

Currently I have to manually ‘echo 0 > /sys/drm/parameters/debug’ (might not be exactly that) after boot in order to disable debugging.

I’m also looking at your work on the HDMI sound - have you noticed that in the original R2-BSP tree - the ‘mt7623n.dtsi’ file (I think) contains a similar sound node to the one you inserted for your _hdmi driver effort - it however includes far more detail than your insertion - worth investigating?

imho i added it to builtin-environment, list graphics/bootargs var in uboot with printenv and override it using uenv.txt

i tried to integrate it with @DeadMeat, but the driver for mt2701-hdmi is missing, needs to be upported…alex did some work, but far away from working

I’ll take a look - going to hack away at the audio too - it was working before and I’ve read your and Alex’s conversation regarding the new drivers.

If the WM9860 codec (or whatever it was called) was working before (I remember reading something about the audio being backwards compatible with some other mediatek chip - hence the support in 4.4 etc at the time)

So how about just modifying the newer driver to output over HDMI? the WM9860 codec or whatever - it’s still there - it just… lost HDMI support right?

It’s so frustrating. I finally get 3D working smoothly on the board and now I’ve lost sound lol

hdmi-audio is only working in 4.4…the driver needs to be up ported and modified to fit new driver structure

Right I can see what’s going on yeah :slight_smile:

That needs porting to the new style of audio driver etc - I’ll take a look.

if working on it please use existing threads for progress/questions

Afair alex posted a separate thread,but i do not find it atm