Panfork GPU Driver
切换 Xorg server
信息
虽然官方镜像自带了厂商 Mali 驱动,但是只支持 OpenGL ES,不符合 Linux 生态大多数应用使用的 OpenGL 接口。 Panfork 开源驱动需要运行于主线 Xorg server,厂商 Mali 驱动需要运行于 Rockchip Xorg server。 所以我们需要如下命令切换 Xorg server 版本。
sudo apt update
sudo apt-get install xserver-xorg-core/bullseye
# 如需恢复 Rockchip Xorg server,请运行以下命令
# sudo apt-get install xserver-xorg-core/rockchip-bullseye
安装编译依赖
sudo apt update
sudo apt install build-essential meson git python3-mako libexpat1-dev bison flex libwayland-egl-backend-dev libxext-dev libxfixes-dev libxcb-glx0-dev libxcb-shm0-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev libxshmfence-dev libxxf86vm-dev libxrandr-dev zlib1g-dev pkg-config libwayland-* libdrm*
sudo pip3 install cmake ninja
编译并安装 dri2to3
git clone https://gitlab.com/panfork/dri2to3.git
mkdir dri2to3/build
cd dri2to3/build
meson setup
sudo ninja install
编译并安装 libdrm
cd ~/
git clone https://gitlab.freedesktop.org/mesa/drm
mkdir drm/build
cd drm/build
meson
sudo ninja install
编译并安装 Wayland protocols
cd ~/
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols
mkdir wayland-protocols/build
cd wayland-protocols/build
git checkout 1.24
meson
sudo ninja install
编译并安装 Mesa
cd ~/
git clone https://gitlab.com/panfork/mesa.git
mkdir mesa/build
cd mesa/build
meson -Dgallium-drivers=panfrost -Dvulkan-drivers= -Dllvm=disabled --prefix=/opt/panfrost
sudo ninja install
设置 Panfork 相关依赖的优先值
echo /opt/panfrost/lib/aarch64-linux-gnu | sudo tee /etc/ld.so.conf.d/0-panfrost.conf
sudo mv /etc/ld.so.conf.d/00-aarch64-mali.conf /etc/ld.so.conf.d/2-aarch64-mali.conf
sudo ldconfig