Greetings,
I can't seem to make this a discussion so... I'm posting it as a question.
Here I provide a few patches I wrote to compile the Mali Midgard kernel drivers r19p0, along with the Mali UMP driver, when integrated into 4.17 kernels.
Why the r19p0 and not the latest r24p0 ? Because I'm either stuck with the legacy r14p0 user-space drivers from Rockchip, for GLES and DRM+GBM support, or the legacy r12p0 drivers from ARM for Vulkan support, and these won't get updated anytime soon, it seems. Since starting from the r20p0, the Mali Midgard kernel drivers dropped support for legacy IOCTL used by the legacy Mali Midgard user-space drivers, I'm staying with the r19p0 drivers.
Anyway, you'll still need to copy the drivers and integrate them to the Linux kernel in order to build them.
Note that if you're used to my previous posts, I've dropped the UMP patches as the DMABUF framework provide roughly the same features and the Mali driver uses DMABUF instead of the UMP framework when possible.
Most of these patches are mostly due to headers names and structure members being changed after Linux 4.10, but the last one is due to some changes to the mmap interface by Linus Torvalds himself, and will lead to the kernel driver loading correctly and the user-space binary driver failing mmap2 calls silently... Nasty stuff...
Mali Midgard specific patch :
Mali Midgard patches related to DTS detection :
The patches required to compile the Mali Midgard drivers are due to the following changes in Linux 4.11 and onward :
fs: add ksys_close() wrapper; remove in-kernel calls to sys_close()2ca2a09d6215fd9621aa3e2db7cc9428a61f2911 (Git.kernel.org Github)Mainlined in Linux v4.17-rc1
The DTS related patches target RK3288 owners and are related to the following changes :
The patches required to enable the compilation of Mali Midgard GPU drivers, after copying the drivers package TX011-SW-99002-r19p0-01rel0/driver/product/kernel/ content in your linux kernel base directory, are available here :
A full kernel download, patch and compilation procedure for ASUS Tinkerboard and MQMaker MiQi RK3288 Armv7 boards is available here : https://github.com/Miouyouyou/RockMyy
The procedure includes the download of the Linux 4.17 kernel and the Mali r19p0-01rel0 kernel driver.
These patches have been tested with the r14p0 drivers provided by Rockchip, and the r12p0 (fbdev with Vulkan) drivers for Firefly boards provided by ARM, using an Armbian system on a MiQi board and on an ASUS Tinkerboard.The Vulkan support still remains untested. Only listing Vulkan devices properties and queues have been tested so far.
If these patches were useful to you, don't hesitate to support me on Patreon !
Just wanted to say thanks for maintaining the list of patches on this forum :)
Thank you !
Just for completeness, if you want to run devfreq on kernels 4.14 or above, with r20p0 or below, you need this patch too:
https://github.com/mihailescu2m/linux/commit/bbe73c3c1143e5991bdcaee3afaecf5c31af0647
After commit 5b650b3, _find_opp_table() increments the reference under the opp_table_lock. So now there is no need to take the opp_table_lock or rcu_read_lock(). This patch drops the rcu_read_lock() around _find_opp_table() in the mali midgard r20p0 drivers.
Interesting. I'll try to include it in my next 4.18-rc release.