mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 23:36:04 +00:00
fix(desktop): Plasma draws on the system PowerVR driver (#2836)
* fix(desktop): Plasma draws on the system PowerVR driver KWin lacks the Android-buffer Wayland protocol the system PowerVR driver's swapchain needs, so every Plasma client failed with "zink: could not create swapchain" and the desktop stayed black under the cursor. Plasma's clients now present through DRI on that path, as the Steam session already does. * test(desktop): the kopper override reaches Plasma's child processes * test(desktop): check the kopper override where Plasma launches --------- Co-authored-by: Jacob Lambert <183008808+JMLambo@users.noreply.github.com>
This commit is contained in:
1 parent
e36cf24ba9
commit
049c4be6e5
2 files changed
+45
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
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'
|
||||
LAUNCH = 'dbus-run-session -- startplasma-wayland'
|
||||
STUBS = '''
|
||||
pipewire() { return 0; }
|
||||
dbus-run-session() { sh -c 'echo "kopper:${LIBGL_KOPPER_DISABLE:-on}"'; }
|
||||
'''
|
||||
|
||||
|
||||
class DesktopPowerVrTest(unittest.TestCase):
|
||||
def kopper_at_plasma_launch(self, gl_present):
|
||||
segment = DESKTOP[DESKTOP.index(START):DESKTOP.index(LAUNCH) + len(LAUNCH)]
|
||||
with tempfile.TemporaryDirectory() as run:
|
||||
segment = (segment.replace(START, 'if true; then')
|
||||
.replace('/usr/local/bin/droiddeck-pipewire', 'pipewire')
|
||||
.replace('/run/droiddeck', run))
|
||||
environment = {key: value for key, value in os.environ.items()
|
||||
if key not in ('DD_STEAM_GL_PRESENT', 'LIBGL_KOPPER_DISABLE')}
|
||||
if gl_present is not None:
|
||||
environment['DD_STEAM_GL_PRESENT'] = gl_present
|
||||
result = subprocess.run(['bash', '-c', STUBS + segment], 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_plasma_starts_with_kopper_off(self):
|
||||
self.assertEqual('kopper:true', self.kopper_at_plasma_launch('1'))
|
||||
|
||||
def test_other_drivers_start_plasma_with_kopper(self):
|
||||
self.assertEqual('kopper:on', self.kopper_at_plasma_launch(None))
|
||||
self.assertEqual('kopper:on', self.kopper_at_plasma_launch('0'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user