From 6f4ced5ed62efd3a02b21ff6086385ed99a998c9 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 5 Feb 2026 23:13:53 -0600 Subject: [PATCH] Assume GPUs on non-x86 platforms are slow by default This can be overriden with GL_IS_SLOW=0 at runtime for systems with a fast GPU, though it doesn't make much difference either way for non-KMSDRM cases. For slower GPUs, this enables important scaling and rendering optimizations that can substantially improve performance (especially on fillrate-limited GPUs common in SBCs). --- app/streaming/video/ffmpeg.cpp | 8 ++++---- app/wm.cpp | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/streaming/video/ffmpeg.cpp b/app/streaming/video/ffmpeg.cpp index 4e4f843b..d66de359 100644 --- a/app/streaming/video/ffmpeg.cpp +++ b/app/streaming/video/ffmpeg.cpp @@ -344,7 +344,7 @@ bool FFmpegVideoDecoder::createFrontendRenderer(PDECODER_PARAMETERS params, bool #ifdef GL_IS_SLOW glIsSlow = true; #else - glIsSlow = false; + glIsSlow = WMUtils::isGpuSlow(); #endif } @@ -352,7 +352,7 @@ bool FFmpegVideoDecoder::createFrontendRenderer(PDECODER_PARAMETERS params, bool #ifdef VULKAN_IS_SLOW vulkanIsSlow = true; #else - vulkanIsSlow = false; + vulkanIsSlow = WMUtils::isGpuSlow(); #endif } @@ -1298,7 +1298,7 @@ bool FFmpegVideoDecoder::tryInitializeRendererForUnknownDecoder(const AVCodec* d #ifdef GL_IS_SLOW glIsSlow = true; #else - glIsSlow = false; + glIsSlow = WMUtils::isGpuSlow(); #endif } @@ -1306,7 +1306,7 @@ bool FFmpegVideoDecoder::tryInitializeRendererForUnknownDecoder(const AVCodec* d #ifdef VULKAN_IS_SLOW vulkanIsSlow = true; #else - vulkanIsSlow = false; + vulkanIsSlow = WMUtils::isGpuSlow(); #endif } diff --git a/app/wm.cpp b/app/wm.cpp index 4a47dc86..09cf6df6 100644 --- a/app/wm.cpp +++ b/app/wm.cpp @@ -210,7 +210,8 @@ bool WMUtils::isGpuSlow() bool ret; if (!Utils::getEnvironmentVariableOverride("GL_IS_SLOW", &ret)) { -#ifdef GL_IS_SLOW +#if defined(GL_IS_SLOW) || !defined(Q_PROCESSOR_X86) + // We currently assume GPUs on non-x86 hardware are slow by default ret = true; #else ret = false;