mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 15:26:04 +00:00
Merge main into playstore and harden SDK compatibility
Bring in the ten upstream commits through 55362d68 without rewriting contributor history.
Guard the bottom-screen accessibility watcher on API 33, remove a duplicate HOME query, translate 22 new strings across 32 locales and clean the extracted candidate when runtime installation is cancelled before replacement. Add cancellation coverage while retaining rollback protection.
Validation: 3,293 JVM tests, 1,623 Python tests (eight skips), sanitized GPU harness, release APK and app bundle builds, full lint with zero errors, runtime assets and native dependency/export checks.
Physical verification of this exact candidate, performance parity and native 16 KiB audio support remain pending.
This commit is contained in:
commit
8a8bb2053c
91 files changed
+3025
-604
No files matched your search
@@ -124,6 +124,17 @@ def arkham_city_x87(game):
|
||||
|
||||
|
||||
|
||||
@fix
|
||||
def doom_2016_swapchain_images(game):
|
||||
if "doomx64vk.exe" in game.files and game.stem in ("doomx64", "doomx64vk"):
|
||||
images = {
|
||||
"GAMESCOPE_WSI_MIN_IMAGE_COUNT": None,
|
||||
"GAMESCOPE_WSI_ENSURE_MIN_IMAGE_COUNT": None,
|
||||
"vk_x11_strict_image_count": "true",
|
||||
}
|
||||
return images, [], "DOOM (2016): the swapchain keeps the image count the game asks for"
|
||||
|
||||
|
||||
@fix
|
||||
def teardown_vsync(game):
|
||||
if game.stem == "teardown":
|
||||
|
||||
@@ -18,6 +18,19 @@ COMPAT = runpy.run_path(os.path.join(HERE, "steam-compatibility"))
|
||||
BINDING = "droiddeckCompatChanged"
|
||||
BRIGHTNESS_BINDING = "droiddeckBrightnessChanged"
|
||||
CONTROLS_DIR = "/etc/droiddeck-device-controls"
|
||||
LIBRARY_ART_JS = r"""
|
||||
(() => {
|
||||
if (window.__droiddeckLibraryArt) return "present";
|
||||
const store = typeof appStore === "object" ? appStore : null;
|
||||
if (typeof store?.BHasCachedLibraryAsset !== "function") return "unavailable";
|
||||
// The client reports which cached assets exist only after a logon that reaches Steam; before that every app reads as
|
||||
// uncached and the UI asks the CDN, which is blank offline. The native check still runs, so misses are still reported.
|
||||
const native = store.BHasCachedLibraryAsset.bind(store);
|
||||
store.BHasCachedLibraryAsset = (appid, version, type) => native(appid, version, type) || !version;
|
||||
window.__droiddeckLibraryArt = true;
|
||||
return "installed";
|
||||
})()
|
||||
"""
|
||||
BRIGHTNESS_JS = r"""
|
||||
(() => {
|
||||
if (window.__droiddeckBrightness) return "present";
|
||||
@@ -851,6 +864,7 @@ class Helper:
|
||||
if self.files_only:
|
||||
page.call("Runtime.addBinding", {"name": FILE_BINDING})
|
||||
page.evaluate(FILE_JS)
|
||||
page.evaluate(LIBRARY_ART_JS)
|
||||
self.page = page
|
||||
self.controls_state = None
|
||||
self.controls_installed = False
|
||||
@@ -861,6 +875,7 @@ class Helper:
|
||||
page.evaluate(VR_JS)
|
||||
page.call("Runtime.addBinding", {"name": FILE_BINDING})
|
||||
page.evaluate(FILE_JS)
|
||||
page.evaluate(LIBRARY_ART_JS)
|
||||
try:
|
||||
page.evaluate(TOUR_JS)
|
||||
except RuntimeError:
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "kgsl_busy.h"
|
||||
#include "kgsl_layout.h"
|
||||
|
||||
#define ENTRIES 819
|
||||
|
||||
@@ -52,5 +53,61 @@ int main(void) {
|
||||
assert(moved == 0);
|
||||
|
||||
puts("PASS: kgsl memstore busy");
|
||||
|
||||
// Hardware-scheduled kernels: ringbuffer entries stay 0, contexts carry the stamps.
|
||||
memset(memstore, 0, sizeof(memstore));
|
||||
static uint32_t seen[ENTRIES], ctx_last[ENTRIES];
|
||||
int live[KGSL_BUSY_MAX_LIVE];
|
||||
stamp(3, 50, 50);
|
||||
stamp(9, 21, 20);
|
||||
stamp(first - 1, 4, 4);
|
||||
int count = kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE);
|
||||
assert(count == 3 && live[0] == 3 && live[1] == 9 && live[2] == first - 1);
|
||||
moved = 0;
|
||||
assert(kgsl_busy_sample_contexts(memstore, live, count, ctx_last, &moved) == 1);
|
||||
assert(moved == 1 && ctx_last[9] == 21);
|
||||
|
||||
// Busy or newly started contexts come first; idle ones that have run work stay in the list.
|
||||
stamp(9, 21, 21);
|
||||
stamp(5, 2, 1);
|
||||
count = kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE);
|
||||
assert(count == 4 && live[0] == 5 && live[1] == 3 && live[2] == 9 && live[3] == first - 1);
|
||||
moved = 0;
|
||||
assert(kgsl_busy_sample_contexts(memstore, live, count, ctx_last, &moved) == 1);
|
||||
assert(moved == 1);
|
||||
moved = 0;
|
||||
assert(kgsl_busy_sample_contexts(memstore, live, count, ctx_last, &moved) == 1);
|
||||
assert(moved == 0);
|
||||
stamp(5, 2, 2);
|
||||
assert(kgsl_busy_sample_contexts(memstore, live, count, ctx_last, &moved) == 0);
|
||||
|
||||
// Entry 0 (global) and the ringbuffer entries are not contexts; the live list is capped.
|
||||
memset(memstore, 0, sizeof(memstore));
|
||||
memset(seen, 0, sizeof(seen));
|
||||
stamp(0, 8, 7);
|
||||
stamp(first, 8, 7);
|
||||
assert(kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE) == 0);
|
||||
for (int id = 1; id <= KGSL_BUSY_MAX_LIVE + 10; id++) stamp(id, 1, 1);
|
||||
assert(kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE) == KGSL_BUSY_MAX_LIVE);
|
||||
assert(kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE) == KGSL_BUSY_MAX_LIVE);
|
||||
stamp(KGSL_BUSY_MAX_LIVE + 5, 2, 1);
|
||||
assert(kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE) == KGSL_BUSY_MAX_LIVE);
|
||||
assert(live[0] == KGSL_BUSY_MAX_LIVE + 5);
|
||||
stamp(KGSL_BUSY_MAX_LIVE + 5, 0, 0);
|
||||
count = kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE);
|
||||
count = kgsl_busy_scan_contexts(memstore, first, seen, live, KGSL_BUSY_MAX_LIVE);
|
||||
for (int i = 0; i < count; i++) assert(live[i] != KGSL_BUSY_MAX_LIVE + 5);
|
||||
puts("PASS: kgsl memstore contexts");
|
||||
|
||||
assert(kgsl_layout_for(0x44050001u) == &KGSL_LAYOUT_A8XX); // Adreno 830
|
||||
assert(kgsl_layout_for(0x44030a20u) == &KGSL_LAYOUT_A8XX); // Adreno 829
|
||||
assert(kgsl_layout_for(0x43020100u) == &KGSL_LAYOUT_A7XX); // Adreno 722
|
||||
assert(kgsl_layout_for(0x43050a01u) == &KGSL_LAYOUT_A7XX); // Adreno 740
|
||||
assert(kgsl_layout_for(0x07010000u) == &KGSL_LAYOUT_A7XX); // Adreno 710
|
||||
assert(kgsl_layout_for(0x06030001u) == &KGSL_LAYOUT_A7XX); // Adreno 630
|
||||
assert(kgsl_layout_for(0x45000000u) == NULL);
|
||||
assert(KGSL_LAYOUT_A8XX.always_on == 0x8e7u && KGSL_LAYOUT_A8XX.cycles == 1u);
|
||||
assert(KGSL_LAYOUT_A7XX.always_on == 0x980u && KGSL_LAYOUT_A7XX.cycles == 0u);
|
||||
puts("PASS: kgsl counter layout");
|
||||
return 0;
|
||||
}
|
||||
@@ -873,6 +873,38 @@ class GameEnvironmentTest(unittest.TestCase):
|
||||
(game / "D3DGear64.DLL").unlink()
|
||||
self.assertEqual(MODULE["engine_fixes"](str(game / "TheCrew2.exe"), []), ({}, [], []))
|
||||
|
||||
def test_doom_2016_keeps_the_swapchain_image_count_it_asks_for(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
game = Path(tmp) / "DOOM (2016)"
|
||||
game.mkdir()
|
||||
for name in ("DOOMx64.exe", "DOOMx64vk.exe", "Galaxy64.dll"):
|
||||
(game / name).touch()
|
||||
images = {
|
||||
"GAMESCOPE_WSI_MIN_IMAGE_COUNT": None,
|
||||
"GAMESCOPE_WSI_ENSURE_MIN_IMAGE_COUNT": None,
|
||||
"vk_x11_strict_image_count": "true",
|
||||
}
|
||||
for exe in ("DOOMx64.exe", "DOOMx64vk.exe"):
|
||||
env, extra, notes = MODULE["engine_fixes"](str(game / exe), [])
|
||||
self.assertEqual((env, extra), (images, []))
|
||||
self.assertTrue(notes)
|
||||
launched = {"GAMESCOPE_WSI_MIN_IMAGE_COUNT": "8", "GAMESCOPE_WSI_ENSURE_MIN_IMAGE_COUNT": "1"}
|
||||
result = MODULE["apply_config"](launched, {"version": 1}, "3566086475", env)
|
||||
self.assertNotIn("GAMESCOPE_WSI_MIN_IMAGE_COUNT", result)
|
||||
self.assertNotIn("GAMESCOPE_WSI_ENSURE_MIN_IMAGE_COUNT", result)
|
||||
self.assertEqual(result["vk_x11_strict_image_count"], "true")
|
||||
config = {"version": 1, "games": {"3566086475": {"GAMESCOPE_WSI_MIN_IMAGE_COUNT": "3"}}}
|
||||
self.assertEqual(MODULE["apply_config"](launched, config, "3566086475", env)["GAMESCOPE_WSI_MIN_IMAGE_COUNT"], "3")
|
||||
eternal = Path(tmp) / "DOOMEternal"
|
||||
eternal.mkdir()
|
||||
(eternal / "DOOMEternalx64vk.exe").touch()
|
||||
self.assertEqual(MODULE["engine_fixes"](str(eternal / "DOOMEternalx64vk.exe"), []), ({}, [], []))
|
||||
other = Path(tmp) / "Other"
|
||||
other.mkdir()
|
||||
for name in ("Other.exe", "DOOMx64vk.exe"):
|
||||
(other / name).touch()
|
||||
self.assertEqual(MODULE["engine_fixes"](str(other / "Other.exe"), []), ({}, [], []))
|
||||
|
||||
def test_dll_overrides_from_several_fixes_are_all_kept(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
for name in ("Game.exe", "Game.pck", "GodotSharp.dll", "libsentry.windows.release.x86_64.dll", "d3dgear64.dll"):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Exercise the HUD's kgsl memstore busy sampling (app/src/main/cpp/gpuclock/kgsl_busy.h)."""
|
||||
"""Exercise the HUD's kgsl memstore busy sampling and counter layout (app/src/main/cpp/gpuclock)."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
@@ -27,6 +27,8 @@ class KgslBusyTest(unittest.TestCase):
|
||||
result = subprocess.run([str(self.binary)], capture_output=True, text=True)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
self.assertIn('PASS: kgsl memstore busy', result.stdout)
|
||||
self.assertIn('PASS: kgsl memstore contexts', result.stdout)
|
||||
self.assertIn('PASS: kgsl counter layout', result.stdout)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
BIN = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin"
|
||||
LIVE = runpy.run_path(str(BIN / "droiddeck-steam-compat"))
|
||||
|
||||
HARNESS = """
|
||||
const reports = [];
|
||||
global.appStore = {
|
||||
BHasCachedLibraryAsset(appid, version, type) {
|
||||
if ((version ?? 0) & (1 << type)) return true;
|
||||
reports.push([appid, type]);
|
||||
return false;
|
||||
},
|
||||
};
|
||||
const first = eval(process.argv[2]);
|
||||
const second = eval(process.argv[2]);
|
||||
const check = (name, actual, expected) => { if (actual !== expected) throw new Error(name + ": " + actual); };
|
||||
check("install", first, "installed");
|
||||
check("reinstall", second, "present");
|
||||
check("no logon", appStore.BHasCachedLibraryAsset(10, undefined, 3), true);
|
||||
check("zero version", appStore.BHasCachedLibraryAsset(10, 0, 3), true);
|
||||
check("reported", reports.length, 2);
|
||||
check("bit set", appStore.BHasCachedLibraryAsset(10, 1 << 3, 3), true);
|
||||
check("bit missing", appStore.BHasCachedLibraryAsset(10, 1 << 2, 3), false);
|
||||
check("reported again", reports.length, 3);
|
||||
"""
|
||||
|
||||
|
||||
@unittest.skipUnless(shutil.which("node"), "node is not installed")
|
||||
class LibraryArtTest(unittest.TestCase):
|
||||
def run_node(self, harness):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
script = Path(directory, "harness.js")
|
||||
script.write_text("global.window = {};\n" + harness)
|
||||
return subprocess.run(["node", str(script), LIVE["LIBRARY_ART_JS"]], capture_output=True, text=True, timeout=20)
|
||||
|
||||
def test_apps_without_a_client_cache_report_read_from_the_local_library_cache(self):
|
||||
result = self.run_node(HARNESS)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
|
||||
def test_a_page_without_the_app_store_is_left_alone(self):
|
||||
result = self.run_node("""
|
||||
if (eval(process.argv[2]) !== "unavailable") throw new Error("installed without an app store");
|
||||
""")
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user