Files
DroidDeck/tools/tests/test_quest_kgsl.py
T
Anuar Lukpanov 9fce12730c fix(quest): answer a refused KGSL timestamp read from waits
Mesa 27 polls timeline points with CMDSTREAM_READTIMESTAMP_CTXTID and
reports any failure as VK_ERROR_UNKNOWN, so gamescope aborted at start on
Quest with vk.WaitSemaphores result -13. Track each context's submitted
timestamps in the preload and answer a failed read from one millisecond
WAITTIMESTAMP calls. Log refused KGSL ioctls to session.log.
2026-11-01 10:52:06 +05:00

33 lines
1.4 KiB
Python

from pathlib import Path
import shutil
import subprocess
import sys
import tempfile
import unittest
QUEST = Path(__file__).resolve().parents[1] / 'quest'
@unittest.skipUnless(sys.platform == 'linux' and shutil.which('gcc'), 'needs Linux and gcc')
class QuestKgslTest(unittest.TestCase):
def test_allocation_passthrough_translation_and_cleanup(self):
with tempfile.TemporaryDirectory() as folder:
binary = str(Path(folder) / 'test-kgsl')
subprocess.run(['gcc', '-Wall', '-Wextra', '-Werror', '-O2', '-o', binary,
str(QUEST / 'test_kgsl_compat.c'), str(QUEST / 'kgsl_compat.c')], check=True)
result = subprocess.run([binary], capture_output=True, text=True, check=True, timeout=10)
self.assertIn('PASS: 12 GPUOBJ', result.stdout)
def test_refused_timestamp_read_is_answered_from_waits(self):
with tempfile.TemporaryDirectory() as folder:
binary = str(Path(folder) / 'test-kgsl-read')
subprocess.run(['gcc', '-Wall', '-Wextra', '-Werror', '-O2', '-o', binary,
str(QUEST.parent / 'tests/test_kgsl_read.c'),
str(QUEST.parent / 'linuxfs/preload/kgslpoll.c')], check=True)
result = subprocess.run([binary], capture_output=True, text=True, check=True, timeout=10)
self.assertIn('PASS: refused timestamp reads', result.stdout)
if __name__ == '__main__':
unittest.main()