DRI Library - akhilharihar/tinydrm_show GitHub Wiki
A DRI library specific to your controller is required if you want to run an application based on opengl es or Qt for Embedded Linux without an xserver. If a file with name <your_driver_name>_dri.so
format exists in /usr/lib/arm-linux-gnueabihf/dri/
, you need not proceed with the DRI library compilation and can directly use QT eglfs or opengl ES application.
- Enable source code repository by uncommenting deb-src line in
/etc/apt/sources.list
. Then run: - Update apt cache and install mesa build dependencies.
sudo apt update && sudo apt upgrade -y
sudo apt build-dep mesa
- Get mesa sources from https://github.com/mesa3d/mesa/releases that matches
libgl1-mesa-dri
package version installed in your system.
pi@raspberrypi:~ $ apt search libgl1-mesa-dri | grep "installed"
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libgl1-mesa-dri/testing,now 19.3.2-1~bpo10+1~rpt3 armhf [installed]
...
pi@raspberrypi:~ $ wget https://github.com/mesa3d/mesa/archive/refs/tags/mesa-19.3.2.zip && unzip mesa-19.3.2 && mv mesa-19.3.2 mesa
pi@raspberrypi:~ $ cd mesa
-
- Add
DEFINE_LOADER_DRM_ENTRYPOINT(driver_name)
insrc/gallium/targets/dri/target.c
file just below#if defined(GALLIUM_KMSRO)
line. - Add
driver_name_dri.so
insrc/gallium/targets/dri/meson.build
file in array next towith_gallium_kmsro
text. Refer https://github.com/mesa3d/mesa/search?q=st7735r
- Add
- configure and build mesa DRI drivers
pi@raspberrypi:~ $ meson build \
--prefix=/usr \
--libdir=/usr/lib/arm-linux-gnueabihf \
-Dbuildtype=release \
-Dplatforms=x11,drm \
-Ddri-drivers= \
-Dgallium-drivers=vc4,kmsro
pi@raspberrypi:~ $ ninja -C build
pi@raspberrypi:~ $ sudo ninja -C build install