From 73a9100e1361879835a05e0515d0d8a28521601d Mon Sep 17 00:00:00 2001 From: Sergey Lisov Date: Fri, 30 Jun 2023 19:35:17 +0300 Subject: [PATCH] temp/mesa-dri-simpledrm: new package (MR 4026) This package provides a KMSRO stub for simpledrm, allowing GPU drivers from Mesa to work with it. --- temp/mesa-dri-simpledrm/APKBUILD | 28 +++++++++++++++++++ .../usr-lib-xorg-modules-dri-simpledrm_dri.c | 14 ++++++++++ 2 files changed, 42 insertions(+) create mode 100644 temp/mesa-dri-simpledrm/APKBUILD create mode 100644 temp/mesa-dri-simpledrm/usr-lib-xorg-modules-dri-simpledrm_dri.c diff --git a/temp/mesa-dri-simpledrm/APKBUILD b/temp/mesa-dri-simpledrm/APKBUILD new file mode 100644 index 000000000..07d8ee189 --- /dev/null +++ b/temp/mesa-dri-simpledrm/APKBUILD @@ -0,0 +1,28 @@ +# Temporary hack +# Upstream issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8929 +pkgname=mesa-dri-simpledrm +pkgdesc="Temporary KMSRO stub for simpledrm" +pkgver=0.1 +pkgrel=0 +url="https://mesa.freedesktop.org" +license="MIT" +arch="aarch64" +options="!check !archcheck" +depends="mesa-dri-gallium" +replaces="mesa-dri-gallium" +makedepends="gcc" +source=" + usr-lib-xorg-modules-dri-simpledrm_dri.c +" + +build() { + gcc usr-lib-xorg-modules-dri-simpledrm_dri.c -shared -o usr-lib-xorg-modules-dri-simpledrm_dri.so +} + +package() { + install -Dm755 "$srcdir"/usr-lib-xorg-modules-dri-simpledrm_dri.so "$pkgdir"/usr/lib/xorg/modules/dri/simpledrm_dri.so +} + +sha512sums=" +999b4909b25e9fcadb1e9ca034c0a014b219a8a3cf908072f1f8f58f75489ca72dd3765b2f5b9d89b69e29c7c1554a0fc5d62b11a2ab129103d9d3d6ed0c7f6c usr-lib-xorg-modules-dri-simpledrm_dri.c +" diff --git a/temp/mesa-dri-simpledrm/usr-lib-xorg-modules-dri-simpledrm_dri.c b/temp/mesa-dri-simpledrm/usr-lib-xorg-modules-dri-simpledrm_dri.c new file mode 100644 index 000000000..4ce91b063 --- /dev/null +++ b/temp/mesa-dri-simpledrm/usr-lib-xorg-modules-dri-simpledrm_dri.c @@ -0,0 +1,14 @@ +#include + +/* +This is a temporary hack until Mesa upstream adds 2 lines to their code. +https://gitlab.freedesktop.org/mesa/mesa/-/issues/8929 +*/ + +void* __driDriverGetExtensions_simpledrm(void) +{ + static void*(*ddge_mediatek)(void); + if(!ddge_mediatek) + ddge_mediatek = dlsym(dlopen("/usr/lib/xorg/modules/dri/mediatek_dri.so", RTLD_NOW), "__driDriverGetExtensions_mediatek"); + return ddge_mediatek(); +}