Hi! I see you have a github account, it would be nice to publish your code there, and provide links.
I’ve not exactly maintained a GIT tree I’ve just pulled all I needed, modified all I needed and then compiled it all. I can send you all the scripts I wrote to help? but you’ve already solved most if not all of the issues. I’ve got meson build scripts, the modifications to mesa (you basically find every instance of exynos (which is another similar board) and duplicate it as ‘mediatek’ in order to get your mediatek shim.
Let’s see - build Lima as a module (adding the dtsi extensions as provided by ryder lee?) - didn’t have a single issue with the detection and setup of the Mali, I sent my DTSI to frank at some point I’m sure - again it was just changes pertaining to an entry entitled ‘g3d’ or something along those lines.
I was having issues with performance but I believe you’ve solved that with optimization flags as well as disabling the debug logging for the driver?
I posted this all working in this thread aaaaages ago but if there’s anything I have that’s still useful? just message me an address to send it to.
I’m going to be integrating all the changes into franks latest version and then building lima with the optimizations and without logging - the figures you reported were much better than the performance I was getting - as long as it can spit out a frame in less than 16ms? that’ll suit me. I think the lima guys have video being hardware scaled already but for simple bi-linear scaling for emulators? Lima is capable - just need the speed!
Hey @frank-w, what is the current status of lima patches for your repos? Which branches are up to date to use if I would have a chance to give this a test?
What’s about the DTB regulator vs. board specific function in drm driver story conclusion? Am I correct that neither you nor other people in this thread were able to find how to power on/off GPU using DTB-only approach?
Also I’ve seen report from @DeadMeat that module initialization depends on the HDMI port being connected to some powered on device. Is it really the case? Had it been reproduced by other users? I’m thinking about trying to move from serial console to netconsole in u-boot and EFI grub2 plus normal HDMI console in linux - it will be easier to maintain boards in production with setup like this.
Ah, and yet another question: am I correct that to get text console working I need to have fbcon enabled, kmsconsole fb emulation enabled and working drm driver (lima in our case)? I’m wondering if it possible to have linux console working for BPi-R2 with some other driver than lima.
And while we’re at it - have anyone had any luck with using proprietary driver from ARM for utgard GPUs?
Afair 5.4 is latest kernel i added lima changes…it needs a modified mesa library. And we have only the power on/off via code…no dts only version.
Hdmi console needs no lima…it works also without lima…framebuffer config options (+hdmi driver of course)
Thats correct. Just in case - full kernel oftion is CONFIG_DRM_MEDIATEK_HDMI
@LeXa2, just wondering, is there an EFI implementation for bpi-r2? If so where can i learn about it?
Yes and no. U-boot has the bare minimum support for EFI boot and open bootloader specification but some changes are required to work properly on R2. I had implemented these changes and use all my R2s with EFI grub2 instead of u-boot to boot operating systems. I hadn’t pushed my changes yet to my github u-boot repo though as hadn’t seen much interest for this from other people. If you’re interested in it I can try to clean up the code and push it in near future.
I’ve applied dts patch to 5.8-main and got success:
Following research showed that it’s likely the proper way to use lima:
examples:
and many others mali boards - please search for “mali-supply” in dts files.
So IMHO overlay is not nesessery, and we should ude dts regulator.
@frank-w, i’ve created the pull-request for your 5.8-main branch, please check it out.
5.9-branch WIP - i’ll commit it as soon as it’s done.
P.S. it’s likely applicable for 5.5 (tested in my 5.5 branch), 5.6, and 5.7, but not tested.
5.4 changes is up to you, current patches works great.
If there is no more power consumption we can leave it enabled
If i remember correctly - you have an AC power meter? I don’t have it
Ok, i compare with and without regulator if i find some time just squash the 2 commits add commit message (and update subject to follow mainline convensions “arm: dts: Add lima related…”) and add your signed-off (btw. You’ve committed as root) so that we can post to mainline later
Do you mean rebase? Ok
Ok, can you provide some link(s) to example(s)?
git log arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
Or any other dts or my hdmi series: https://patchwork.kernel.org/project/linux-mediatek/list/?series=335017
If you git is setup right (and using as user) signed off can be added by
git commit --amend -s
author can be set with --author="…"
Ok, i have some lack of experience :
git push
Username for 'https://github.com': d3adme4t
Password for 'https://[email protected]':
To https://github.com/d3adme4t/BPI-R2.git
! [rejected] 5.8-main -> 5.8-main (non-fast-forward)
error: failed to push some refs to 'https://github.com/d3adme4t/BPI-R2.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
after rebasing.
UPD: done with --force, but looks like i messed up with authors
TODO: fix author.
Do you need the kernel precompiled?
No i can compile myself…need 2 versions with/without change and it’s easier if i do it bacause after build i upload to tftp
Author is still root…and please add commit message and signed-off
Sure, right afte i figure it out. (Tommorow it’s 00:37 my local time )
Ok, thx
As it is your top-most commit amend is enough (if not rebase is needed for edit-mode)
First add your signed off and add commit-message (describing what you do with commit) below the subject,above signed-off (leave one blank line between message and signed off).
git commit --amend -s
Copy name+email from signed off and use it to set author as it is same format
git commit --amend --author="name <email>"
You need force push again because commit-hash has changed
this is how it should look (example):
running 5.8-main from tftp (no modules) without the patch is 4.4w after stabilization…with regulator it is same…so with dts-node alone there is no more power-consumption, maybe with lima module loaded, but thats also with the other patch from 5.4.
so if lima works now in 5.9 i can send patch to mainline (need to build mesa again…)
For building mesa: Is there anything different to instructions i posted to my wiki https://wiki.fw-web.de/doku.php?id=en:bpi-r2:hdmi#lima ?
@DeadMeat have you seen lima issue again on 5.8? [BPI-R2] Kernel Development
Crosscompile seems to be possible https://sunxi.org/Mali_Open_Source_Driver#Cross_Compiling if that does not work,we can add a chroot like i do for building hostapd
build_hostapd.sh (753 Bytes) buildchroot.sh (1,2 KB) But how to catch the files installed to pack them in tar.gz/deb? Maybe with destdir
this is patchfile and build-script…last line have to be changed anyhow to install into other directory for packing mesabuild.sh (662 Bytes) mesa.patch (1017 Bytes) for travis/script-build we need to install depencies first
sudo apt-get build-dep mesa # after enabling source-packages
in 5.9-hdmi i see lima is initialized…
root@bpi-r2:~# dmesg | grep lima
[ 10.479118] lima 13040000.gpu: gp - mali450 version major 0 minor 0
[ 10.492463] lima 13040000.gpu: pp0 - mali450 version major 0 minor 0
[ 10.505431] lima 13040000.gpu: pp1 - mali450 version major 0 minor 0
[ 10.518215] lima 13040000.gpu: pp2 - mali450 version major 0 minor 0
[ 10.530953] lima 13040000.gpu: pp3 - mali450 version major 0 minor 0
[ 10.543583] lima 13040000.gpu: l2 cache 8K, 4-way, 64byte cache line, 128bits
[ 10.558019] lima 13040000.gpu: l2 cache 128K, 4-way, 64byte cache line, 128bs
[ 10.573732] lima 13040000.gpu: bus rate = 500500000
[ 10.584858] lima 13040000.gpu: mod rate = 500500000
[ 10.597993] [drm] Initialized lima 1.1.0 20191231 for 13040000.gpu on minor 1
root@bpi-r2:~#
xserver seems to use the mesa-driver i compiled for 5.4…
[ 27.438] (II) xfree86: Adding drm device (/dev/dri/card1)
[ 27.440] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 27.460] (II) no primary bus or device found
[ 27.460] falling back to /sys/devices/platform/13040000.gpu/drm/card1
e loaded elsewhere.
[ 27.460] (II) "glx" will be loaded by default.
[ 27.460] (II) LoadModule: "glx"
[ 27.465] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 27.569] (II) Module glx: vendor="X.Org Foundation"
[ 27.570] compiled for 1.20.4, module version = 1.0.0
[ 27.570] ABI class: X.Org Server Extension, version 10.0
Some power measurments:
I remembered that my usb power-metes supports voltage up to 24V so i measured the routers power comsupltion:
- 5.4 kernel, idle, with lima support, and lima module removed:
- same kernel idle with lima loaded:
- same kernel,Xorg,DE, and glxgears running:
- same, but extreme tux racer instead of glxgears:
- same, DE and xorg are shutted down after previous tests:
So in my measurements max difference between idle and not initialized lima is about 0.1W
P.S. In all tests i’ve usef @frank-w’s latest debian image with it’s kernel and if i remember correctly it enables lima power only on lima init, so removed module prevents GPU from power-on.
P.S. I’ll try to perform same tests with 5.8-main with and without dts-regulators in a coupleof days.
I can test it.
It’s generally the same, but in master branch which i use, you’ll need to replace -Dgallium-drivers=kmsro,lima
to -Dgallium-drivers=kmsro,lima,swrast
in order to satisfy vulkan dependency, or to explicitly disable vulkan support. It also required meson version > 0.5x which should be installed from sid in debian.
P.S. as for me in git master there are some issues fixed: at-least with blinking buttons/menus in DE, and it’s more stable.