Detect Hyprland software rendering from the GL renderer

Carry a v0.56.2 backport of hyprwm/Hyprland#16343 so display-only KMS
drivers paired with llvmpipe are classified as software rendering.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Scott JonesandClaude Opus 5.5 committed 2026-09-25 21:31:25 -04:00
1 parent 83f85a4051
commit 09ef472bcb
2 files changed
+56 -3

No files matched your search

+7 -3
View File
@@ -5,7 +5,7 @@
pkgname=(hyprland hyprpm)
pkgver=0.56.2
pkgrel=3
pkgrel=4
pkgdesc='a highly customizable dynamic tiling Wayland compositor'
arch=(aarch64)
url="https://github.com/hyprwm/${pkgname^}"
@@ -65,12 +65,16 @@ optdepends=('hyprpm: build and install plugins'
'xdg-desktop-portal-hyprland: xdg-desktop-portal backend for hyprland')
provides=(wayland-compositor)
_archive="${pkgname^}-$pkgver"
source=("$_archive.tar.gz::$url/releases/download/v$pkgver/source-v$pkgver.tar.gz")
sha256sums=('03ad3f5ef152ff44116ffd56fcf808486211ecabf4f0ba567108ee746ba5cd2e')
source=("$_archive.tar.gz::$url/releases/download/v$pkgver/source-v$pkgver.tar.gz"
software-renderer.patch)
sha256sums=('03ad3f5ef152ff44116ffd56fcf808486211ecabf4f0ba567108ee746ba5cd2e'
'a703e36333087efdcd1ff9e077e039ba9020d26d20c8cfacc07192f3e7505f9e')
prepare() {
ln -sf hyprland-source "$_archive"
cd "$_archive"
# Backport of hyprwm/Hyprland#16343; drop once the packaged release includes it
patch -Np1 --fuzz=0 -i "$srcdir/software-renderer.patch"
sed -i -e '/^release:/{n;s/-D/-DCMAKE_SKIP_RPATH=ON -D/}' Makefile
sed -i -e '/find_package.glaze/s/7...<8 //' {.,hyprpm,start}/CMakeLists.txt
}
@@ -0,0 +1,49 @@
From: Scott Jones <scottajones@gmail.com>
Subject: [PATCH] render: detect software rendering from the GL renderer (0.56.2 backport)
Backport-of: 61d0ff60a7547d49229714a68b7ca9c0b6658727
Upstream-PR: https://github.com/hyprwm/Hyprland/pull/16343
Co-authored-by: Eryk Wieliczko <44800858+erykwieliczko@users.noreply.github.com>
Adapt constructor and logger-context differences against v0.56.2 while
preserving the original GL classification behavior. Remove this backport
once the packaged upstream version includes this behavior.
--- a/src/render/GLRenderer.cpp
+++ b/src/render/GLRenderer.cpp
@@ -36,7 +36,14 @@
#include <xf86drm.h>
}
-CHyprGLRenderer::CHyprGLRenderer() : IHyprRenderer(), m_elementRenderer(makeUnique<CGLElementRenderer>()) {}
+CHyprGLRenderer::CHyprGLRenderer() : IHyprRenderer(), m_elementRenderer(makeUnique<CGLElementRenderer>()) {
+ // KMS can be display-only; classify the active GL renderer instead of the DRM driver.
+ g_pHyprOpenGL->makeEGLCurrent();
+ if (const auto* renderer = rc<const char*>(glGetString(GL_RENDERER))) {
+ const std::string name{renderer};
+ m_software = name.contains("llvmpipe") || name.contains("softpipe") || name.contains("Software Rasterizer");
+ }
+}
IHyprRenderer::eType CHyprGLRenderer::type() {
return RT_GL;
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -104,8 +104,6 @@
m_nvidia = true;
else if (name.contains("i915"))
m_intel = true;
- else if (name.contains("softpipe") || name.contains("Software Rasterizer") || name.contains("llvmpipe"))
- m_software = true;
Log::logger->log(Log::DEBUG, "DRM driver information: {} v{}.{}.{} from {} description {}", name, DRMV->version_major, DRMV->version_minor, DRMV->version_patchlevel,
std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len});
@@ -126,8 +124,6 @@
m_nvidia = true;
else if (name.contains("i915"))
m_intel = true;
- else if (name.contains("softpipe") || name.contains("Software Rasterizer") || name.contains("llvmpipe"))
- m_software = true;
Log::logger->log(Log::DEBUG, "Primary DRM driver information: {} v{}.{}.{} from {} description {}", name, DRMV->version_major, DRMV->version_minor,
DRMV->version_patchlevel, std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len});