[Panfrost] Open Source Mali Midgard driver

Talk about the project itself, the community, where we are and what we need. Great place to introduce yourself and make friends as well.

[Panfrost] Open Source Mali Midgard driver

Postby apokalypz » Tue Apr 16, 2019 10:59 pm

I have to say that I am absolutely surprised that a search in the forums for the term "panfrost" turns up ZERO results.

For those of you who don't know what Panfrost is, it is an open source driver for the Mali Midgard (and bifrost) GPU chipsets that was recently merged into the upstream mesa codebase. It's reportedly not ready for daily use yet though, as it isn't conformant and is still in it's infancy. But judging by the fact that it wasn't even a thing a year ago and now is able to run Kodi and simple games like tuxcart (with some graphical glitches), it's something that really should be mentioned here in our community.

As far as details go, one of the project's founders, Alyssa Rsenzweig, has a sparsely updated personal blog that includes news on the project here:
https://rosenzweig.io/blog/

I've attempted to get it up and running about a month and a half ago with minimal success. I couldn't get X DRI working, but managed to run Weston and glmark2. With X, I kept having issues where llvmpipe kept loading instead of the panfrost driver, not sure why.

Also, because the kernel space is ARM's weird implementation, there's an effort in writing a DRM driver to match the panfrost userspace. The DRM driver is reportedly far enough along to be functional and is under review for inclusion in the mainline kernel.

With the momentum this project seems to have, I'm excited to see what this turns into!
apokalypz
 
Posts: 41
Joined: Sun Apr 06, 2014 6:13 pm

Re: [Panfrost] Open Source Mali Midgard driver

Postby grendalf » Thu Apr 18, 2019 2:35 am

I'm curious if this is something i need to get my hikey970 running. it has a Arm Mali-G72 MP12 GPU. I'm kinda a noob with ARM but i need to learn this stuff, I have used Arch for about a year and ubuntu for 3 years before that. I'm a student building an arm based system for college project. I am willing to put work in.
grendalf
 
Posts: 6
Joined: Sun Apr 14, 2019 1:36 am

Re: [Panfrost] Open Source Mali Midgard driver

Postby sehraf » Thu May 23, 2019 8:25 am

For the record:
  • Kernel 5.2 includes the panfrost drm driver
  • upcoming mesa 19.1 includes the panfrost (userspace) driver

So long story short, in a few weeks everything should be in our repositories.
But don't expect a full fledged driver :!: This is WIP :!:
sehraf
 
Posts: 69
Joined: Mon Feb 03, 2014 10:06 pm

Re: [Panfrost] Open Source Mali Midgard driver

Postby moonlinux » Thu Jul 11, 2019 6:21 pm

Could some body elaborate necessary packages needed to run and check Pamfost is working on ARM.
moonlinux
 
Posts: 14
Joined: Mon Jul 13, 2015 5:38 pm

Re: [Panfrost] Open Source Mali Midgard driver

Postby TheCycoONE » Sat Sep 21, 2019 8:02 pm

You will want to build your own mesa, because the version from 19.1 is very buggy.

I pieced together a PKGBUILD from a variety of sources (archlinuxarm's, mesa-git in the aur, and noglvd in the aur):

$this->bbcode_second_pass_code('', '
# Modified by Stephen E. Baker

# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - Removed DRI and Gallium3D drivers/packages for chipsets that don't exist in our ARM devices (intel, radeon, VMware svga).
# - disable assembly and rip out VC4 forced NEON for v6/v7
# - remove makedepend on valgrind, -Dvalgrind=false

pkgbase=mesa
pkgname=('mesa-seb')
pkgdesc="An open-source implementation of the OpenGL specification"
pkgver=19.3.0_devel.115361
pkgrel=1
arch=('aarch64')
makedepends=('python-mako' 'libxml2' 'libx11' 'glproto' 'libdrm' 'dri2proto' 'dri3proto' 'presentproto'
'libxshmfence' 'libxxf86vm' 'libxdamage' 'libvdpau' 'libva' 'wayland' 'wayland-protocols'
'elfutils' 'llvm' 'libomxil-bellagio' 'clang' 'lm_sensors'
'libxrandr' 'meson')
url="https://www.mesa3d.org/"
license=('custom')
source=('mesa::git+http://anongit.freedesktop.org/git/mesa/mesa.git#branch=master'
LICENSE)
#glesv2.pc)
sha512sums=('SKIP'
'f9f0d0ccf166fe6cb684478b6f1e1ab1f2850431c06aa041738563eb1808a004e52cdec823c103c9e180f03ffc083e95974d291353f0220fe52ae6d4897fecc7')
#'e5db81538625a056328c2ba83f3e6418e0d579c261bcddf685036ad19e816dd002313c80a6c48cef0289d1e1b0bdbe733810ae9f53604e380486253642cff52c')
depends=('libdrm' 'wayland' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf'
'libomxil-bellagio' 'llvm-libs' 'lm_sensors')
optdepends=('opengl-man-pages: for the OpenGL API man pages'
'mesa-vdpau: for accelerated video playback'
'libva-mesa-driver: for accelerated video playback')
provides=('mesa' 'ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri' 'mesa-libgl' 'opengl-driver' 'libgl' 'libegl' 'libgles')
conflicts=('mesa' 'ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri' 'mesa-libgl' 'libglvnd')
replaces=('mesa' 'ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri' 'mesa-libgl' 'libglvnd')


pkgver() {
cd "mesa"
echo $(cat VERSION | tr "-" "_").$(git rev-list --count HEAD)
}

prepare() {
cd mesa
}

build() {
MESON_OPT="-D asm=false"

arch-meson mesa build \
-D b_lto=false \
-D b_ndebug=true \
-D platforms=x11,wayland,drm,surfaceless \
-D dri-drivers= \
-D gallium-drivers=swrast,virgl,panfrost,kmsro \
-D vulkan-drivers= \
-D dri3=true \
-D egl=true \
-D gallium-extra-hud=true \
-D gallium-nine=false \
-D gallium-va=false \
-D gallium-vdpau=false \
-D gallium-xa=false \
-D gallium-xvmc=false \
-D gbm=true \
-D gles1=false \
-D gles2=true \
-D glvnd=false \
-D glx=dri \
-D libunwind=false \
-D llvm=true \
-D lmsensors=true \
-D osmesa=gallium \
-D shared-glapi=true \
-D valgrind=false $MESON_OPT \
-D glvnd=false

# Print config
meson configure build

ninja -C build

# fake installation to be seperated into packages
# outside of fakeroot but mesa doesn't need to chown/mod
DESTDIR="${srcdir}/fakeinstall" ninja -C build install
}

_install() {
local src f dir
for src; do
f="${src#fakeinstall/}"
dir="${pkgdir}/${f%/*}"
install -m755 -d "${dir}"
mv -v "${src}" "${dir}/"
done
}

package() {
_install fakeinstall/usr/share/drirc.d/00-mesa-defaults.conf
#_install fakeinstall/usr/share/glvnd/egl_vendor.d/50_mesa.json

# ati-dri, nouveau-dri, intel-dri, svga-dri, swrast, swr
_install fakeinstall/usr/lib/dri/*_dri.so

_install fakeinstall/usr/lib/lib*.so*

# in vulkan-headers
rm -rfv fakeinstall/usr/include/vulkan

_install fakeinstall/usr/include
_install fakeinstall/usr/lib/pkgconfig

# libglvnd support
#_install fakeinstall/usr/lib/libGLX_mesa.so*
#_install fakeinstall/usr/lib/libEGL_mesa.so*

# indirect rendering
#ln -s /usr/lib/libGLX_mesa.so.0 "${pkgdir}/usr/lib/libGLX_indirect.so.0"

# make sure there are no files left to install
find fakeinstall -depth -print0 | xargs -0 rmdir

# bring back missing glesv2.pc
#install -m644 -Dt ${pkgdir}/usr/lib/pkgconfig ${srcdir}/glesv2.pc

install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
}
')

You will want to grab LICENSE from: https://github.com/archlinuxarm/PKGBUIL ... extra/mesa

After installing that, panfrost should just work on the right hardware. Check with glxinfo in X.
TheCycoONE
 
Posts: 10
Joined: Thu Aug 10, 2017 8:29 pm

Re: [Panfrost] Open Source Mali Midgard driver

Postby janrinze » Thu Sep 26, 2019 8:16 am

I'm very interested if this actually works on the hikey970.
Has anyone tried this?
janrinze
 
Posts: 4
Joined: Thu Feb 18, 2016 7:24 pm

Re: [Panfrost] Open Source Mali Midgard driver

Postby adam900710 » Thu Oct 17, 2019 1:48 am

Already tried this on my RockPi4, using the mesa from alarm repo.

GNOME runs kinda OK, although it looks like my slow SDcard is a bottleneck.
adam900710
 
Posts: 44
Joined: Thu Sep 13, 2012 1:27 pm

Re: [Panfrost] Open Source Mali Midgard driver

Postby dlupi » Mon Oct 21, 2019 5:45 pm

I also tried the TheCycoONE's PKGBUILD on NanoPi M4 and it works (@TheCycoONE thanks!). Gnome Shell runs fine but there are ocassional crashes - as expected.
The one thing which is really annoying is Gnome (GDM as well) crashes when I touch the touchscreen. I suspect an on screen keyboard besause when I enabled it in preferences - to be always on - it crashed immediately. Any ideas how to fix t?
dlupi
 
Posts: 3
Joined: Tue Sep 24, 2019 7:44 am


Return to Community

Who is online

Users browsing this forum: No registered users and 2 guests