diff --git a/packages/mesa/arch/PKGBUILD b/packages/mesa/arch/PKGBUILD index d3bbb93..4e35222 100644 --- a/packages/mesa/arch/PKGBUILD +++ b/packages/mesa/arch/PKGBUILD @@ -30,7 +30,7 @@ epoch=1 # Mesa's version, the commit's number on the fork's main branch (so that a # newer commit is a newer package), and the commit. pkgver=27.0.0.4 -pkgrel=3 +pkgrel=4 pkgdesc="Mesa from the OrchardLinux fork: OpenGL through Zink or in software, the asahi drivers (OpenGL and Vulkan) for the Apple A12 GPU, the Vulkan driver for the Apple PowerVR GPUs, and the desktop's GPU probe" url="https://github.com/OrchardLinux/mesa" license=('MIT') @@ -51,7 +51,7 @@ conflicts=('mesa-libgl' 'mesa-orchard' 'vulkan-powervr' 'vulkan-powervr-orchard' replaces=('mesa-orchard' 'vulkan-powervr-orchard') source=("mesa-${_commit}.tar.gz::${url}/archive/${_commit}.tar.gz" gpu-probe.c) sha256sums=('3cd0a985ee428de98eadd6ae6e1d6fefa0df4ca0ebd58aaedc34a7778f26af30' - '8b6622bdd9bba6f8bdcc7bf407e98078517e8823a7ce22416774ca88481864f2') + '1b66ca2329b729632ed2670d86b9504d22a2839ebea5b7aef3bc829356191a51') build() { # Not arch-meson: its --auto-features=enabled turns on Mesa features this diff --git a/packages/mesa/gpu-probe.c b/packages/mesa/gpu-probe.c index 2478076..5128548 100644 --- a/packages/mesa/gpu-probe.c +++ b/packages/mesa/gpu-probe.c @@ -6,7 +6,8 @@ * Does what Labwc's GLES2 renderer does for one frame, without modesetting: * opens EGL on the render node, allocates one output buffer of the display's * size there, draws into it and reads it back. Exits 0 only if all of that - * worked and the renderer is not a software one. It then also offers the + * worked and the renderer is a GPU (Zink on one where the desktop asks for it), + * not a software one. It then also offers the * buffer to the display controller as a framebuffer and says so in a * "GPU-PROBE NOTE" when the controller does not take it: that does not fail * the probe, because wlroots copies to the display where direct import is @@ -22,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -111,8 +113,14 @@ int main(int argc, char **argv) CHECK(ctx != EGL_NO_CONTEXT); const char *renderer = (const char *)glGetString(GL_RENDERER); CHECK(renderer); - if (!strstr(renderer, "zink") || strstr(renderer, "llvmpipe") || strstr(renderer, "softpipe")) { - fprintf(stderr, "GPU-PROBE FAIL: not Zink on a GPU: renderer=%s\n", renderer); + /* A GPU, not Mesa's software rasterizers: Zink on a Vulkan driver (the + * PowerVR GPUs, which have no OpenGL driver of their own) or a GPU's own + * OpenGL driver (asahi on the A12). */ + const char *zink = getenv("MESA_LOADER_DRIVER_OVERRIDE"); + int want_zink = zink && !strcmp(zink, "zink"); + if ((want_zink && !strstr(renderer, "zink")) || strstr(renderer, "llvmpipe") || + strstr(renderer, "softpipe") || strstr(renderer, "swrast")) { + fprintf(stderr, "GPU-PROBE FAIL: not %s: renderer=%s\n", want_zink ? "Zink on a GPU" : "a GPU", renderer); return 1; }