fix(desktop): Firefox renders in software on the system PowerVR driver (#2839)

* fix(desktop): Firefox draws on the system PowerVR driver

Under the nested KWin on the system PowerVR driver, Firefox's Wayland window
stops updating partway through drawing and repaints only where the pointer
moves. Through Xwayland it draws normally, so Desktop runs Firefox on X11 on
that path.

* fix(desktop): Firefox renders in software on the system PowerVR driver

The Xwayland workaround only worked because Firefox fell back to software
WebRender there. The breakage follows hardware WebRender on zink, not the
Wayland window: with MOZ_ACCELERATED=0 Firefox draws correctly on Wayland,
so it keeps native Wayland features such as fractional scaling.

---------

Co-authored-by: Jacob Lambert <183008808+JMLambo@users.noreply.github.com>
This commit is contained in:
JM LamboandJacob Lambert authored and GitHub committed 2026-11-24 16:16:55 -05:00
1 parent bcd4e0d99f
commit 0a27c8bb98
2 files changed
+43

No files matched your search

+3
View File
@@ -115,6 +115,9 @@ fi
if [ "$(cat /usr/share/droiddeck/kwin-compositor 2>/dev/null)" = opengl ]; then if [ "$(cat /usr/share/droiddeck/kwin-compositor 2>/dev/null)" = opengl ]; then
unset LIBGL_ALWAYS_SOFTWARE QT_QUICK_BACKEND unset LIBGL_ALWAYS_SOFTWARE QT_QUICK_BACKEND
export KWIN_COMPOSE=O2 MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink LIBGL_KOPPER_DRI2=true export KWIN_COMPOSE=O2 MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink LIBGL_KOPPER_DRI2=true
# On the system PowerVR driver, Firefox's hardware WebRender on zink leaves stale, half-drawn
# frames; its software renderer draws correctly.
[ "${DD_STEAM_GL_PRESENT:-}" = 1 ] && export MOZ_ACCELERATED=0
if [ -z "${KWIN_RENDER_NODES:-}" ]; then if [ -z "${KWIN_RENDER_NODES:-}" ]; then
for node in /dev/dri/renderD0 /dev/dri/renderD307 /dev/dri/renderD*; do for node in /dev/dri/renderD0 /dev/dri/renderD307 /dev/dri/renderD*; do
if [ -c "$node" ]; then export KWIN_RENDER_NODES="$node"; break; fi if [ -c "$node" ]; then export KWIN_RENDER_NODES="$node"; break; fi
@@ -0,0 +1,40 @@
import os
from pathlib import Path
import subprocess
import unittest
DESKTOP = (Path(__file__).resolve().parents[1] / 'linuxfs/desktop/droiddeck-desktop').read_text()
START = 'if [ "$(cat /usr/share/droiddeck/kwin-compositor 2>/dev/null)" = opengl ]; then'
LINE = '\n [ "${DD_STEAM_GL_PRESENT:-}" = 1 ] && export MOZ_ACCELERATED=0\n'
class DesktopFirefoxSoftwareTest(unittest.TestCase):
def firefox_environment(self, gl_present):
head = DESKTOP[:DESKTOP.index('\n', DESKTOP.index('export MOZ_ENABLE_WAYLAND=1'))]
head = head[head.rindex('\n') + 1:]
block = DESKTOP[DESKTOP.index(START):]
block = block[block.index('\n') + 1:block.index('\n if [ -z "${KWIN_RENDER_NODES:-}" ]')]
environment = {key: value for key, value in os.environ.items()
if key not in ('DD_STEAM_GL_PRESENT', 'MOZ_ENABLE_WAYLAND', 'MOZ_ACCELERATED')}
if gl_present is not None:
environment['DD_STEAM_GL_PRESENT'] = gl_present
script = head + '\n' + block + '\nsh -c \'echo "wayland:${MOZ_ENABLE_WAYLAND:-unset} accelerated:${MOZ_ACCELERATED:-unset}"\''
result = subprocess.run(['bash', '-c', script], env=environment, capture_output=True,
text=True, timeout=5)
self.assertEqual(0, result.returncode, result.stderr)
return result.stdout.strip().splitlines()[-1]
def test_system_powervr_desktop_runs_firefox_on_wayland_with_software_rendering(self):
self.assertEqual('wayland:1 accelerated:0', self.firefox_environment('1'))
def test_other_drivers_keep_firefox_hardware_rendering(self):
self.assertEqual('wayland:1 accelerated:unset', self.firefox_environment(None))
self.assertEqual('wayland:1 accelerated:unset', self.firefox_environment('0'))
def test_override_is_set_before_plasma(self):
self.assertLess(DESKTOP.index(LINE), DESKTOP.index('dbus-run-session -- startplasma-wayland'))
if __name__ == '__main__':
unittest.main()