diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a16556d3f..a0def2167 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,7 @@ on: workflow_dispatch: permissions: + actions: read contents: read pull-requests: write @@ -190,7 +191,13 @@ jobs: done if [ -f tools/gamescope/release.env ]; then . tools/gamescope/release.env - gh release download "${GAMESCOPE_TAG}" -R "${GITHUB_REPOSITORY}" -p gamescope.tzst -O gamescope.tzst + if [ -n "${GAMESCOPE_ARTIFACT_RUN:-}" ]; then + gh run download "${GAMESCOPE_ARTIFACT_RUN}" -R "${GITHUB_REPOSITORY}" -n gamescope-patched -D gamescope-artifact + mv gamescope-artifact/gamescope.tzst gamescope.tzst + rm -r gamescope-artifact + else + gh release download "${GAMESCOPE_TAG}" -R "${GITHUB_REPOSITORY}" -p gamescope.tzst -O gamescope.tzst + fi echo "${GAMESCOPE_SHA256} gamescope.tzst" | sha256sum -c - tar --use-compress-program=unzstd -xf gamescope.tzst -C "$D" test -f "$D/usr/local/bin/gamescope" diff --git a/docs/testing/mali-software-steam.md b/docs/testing/mali-software-steam.md new file mode 100644 index 000000000..bb5367ae1 --- /dev/null +++ b/docs/testing/mali-software-steam.md @@ -0,0 +1,40 @@ +# Mali software Steam experiment + +This branch adds an opt-in CPU rendering path for Steam and Gamescope. Android's compositor selects system Vulkan automatically on non-Adreno hardware; explicit custom driver choices are retained. Linux uses Lavapipe for Gamescope and llvmpipe/software SDL for Steam. This is a UI compatibility fallback, not proof of accelerated game support. + +Set `/sdcard/Download/droiddeck-env` to: + +```sh +BL_STEAM_SOFTWARE=1 +``` + +Launch **Steam → Play Steam**. The session selects Gamescope's SDL Wayland Vulkan swapchain, which can present Lavapipe frames through `wl_shm`. Gamescope's native Wayland backend requires exportable dma-bufs even for its blank texture. The new patch keeps locally sampled textures, including cursors and shared-memory client frames, private on swapchain backends and makes `VK_KHR_present_id`/`VK_KHR_present_wait` optional, using the existing timer pacing when they are unavailable. Drivers that support both features retain the present-wait thread. Shared-memory pixels are uploaded on every commit because clients reuse their buffers; the private textures are marked ready after the synchronous copy, avoiding an invalid dma-buf fence lookup. + +Steam's embedded browser disables GPU rendering, and the native client uses the SDL software renderer and X11. The performance overlay is disabled in this mode. + +## Building this branch + +This experimental branch pins native CI run [37146942306](https://github.com/Droid-Deck/DroidDeck/actions/runs/37146942306) and its bundle checksum in `tools/gamescope/release.env`. Both the APK workflow and ordinary local build fetch and verify that artifact. No component release is published. + +```sh +DROIDDECK_BUILD_VARIANT=debug tools/build_local.sh +``` + +To test a different successful native build, download its **gamescope-patched** artifact and verify the accompanying checksum: + +```sh +gh run download -R Droid-Deck/DroidDeck -n gamescope-patched -D /tmp/mali-gamescope +(cd /tmp/mali-gamescope && shasum -a 256 -c gamescope.tzst.sha256) +DROIDDECK_GAMESCOPE_BUNDLE=/tmp/mali-gamescope/gamescope.tzst \ +DROIDDECK_BUILD_VARIANT=debug tools/build_local.sh +``` + +`DROIDDECK_GAMESCOPE_BUNDLE` overrides the pin for that local build. Before shipping, publish the native component and replace the temporary artifact pin with its release tag and checksum. CI artifacts have limited retention; this branch is an experiment, not a permanent release source. + +The desktop path can also use the software Steam settings. On the tested G52 device, its labwc renderer requires `/sdcard/Download/droiddeck-wlr-renderer` containing `pixman`. Add `BL_DESKTOP_STEAM=1` only to start Steam automatically on the desktop. + +## Device validation + +Testing is in progress on the wired Unisoc T618 / Mali-G52 MC2 device (`RGB05001607258`, Android 12, kernel 5.4, 4 KiB pages). The desktop and desktop Steam QR screen have been observed. Gamescope acceptance and the native artifact identity will be recorded after the patched build is tested. + +A guest glibc Mali ICD and compatible image transport remain necessary for hardware acceleration. This patch does not install Steam-ARM's feature layers, prove Proton/DXVK support, or validate other Mali generations. The Android presenter also caps its requested Vulkan API to the loader's supported version and withholds dma-buf advertisement when the complete import extension set is missing; that missing-extension branch has not been exercised on this G52 driver. diff --git a/tools/build_local.sh b/tools/build_local.sh index 67b9dacfd..70b88dddc 100755 --- a/tools/build_local.sh +++ b/tools/build_local.sh @@ -207,12 +207,25 @@ cached() { echo "${out}" } +# Experimental branches can pin a CI artifact until their native component is released. +download_gamescope_artifact() ( + set -e + local artifact_dir + artifact_dir=$(mktemp -d) + trap 'rm -rf "$artifact_dir"' EXIT + gh run download "$1" -R "$2" -n gamescope-patched -D "$artifact_dir" + cp "$artifact_dir/gamescope.tzst" "$out" +) + if [[ -f "${repo_root}/tools/gamescope/release.env" ]]; then . "${repo_root}/tools/gamescope/release.env" if [[ -n "${DROIDDECK_GAMESCOPE_BUNDLE:-}" ]]; then gamescope_archive=${DROIDDECK_GAMESCOPE_BUNDLE} test -f "${gamescope_archive}" echo "Using local Gamescope bundle: ${gamescope_archive}" + elif [[ -n "${GAMESCOPE_ARTIFACT_RUN:-}" ]]; then + gamescope_archive=$(cached "${GAMESCOPE_SHA256}" gamescope.tzst \ + download_gamescope_artifact "${GAMESCOPE_ARTIFACT_RUN}" "${github_repo}") else gamescope_archive=$(cached "${GAMESCOPE_SHA256}" gamescope.tzst \ bash -c 'gh release download "$0" -R "$1" -p gamescope.tzst -O "$out"' "${GAMESCOPE_TAG}" "${github_repo}") diff --git a/tools/gamescope/release.env b/tools/gamescope/release.env index 55f3940d8..2ce83cb69 100644 --- a/tools/gamescope/release.env +++ b/tools/gamescope/release.env @@ -1,2 +1,5 @@ +# Experimental branch pin: build the tested native patch without publishing a component release. +# Before shipping, publish a Gamescope release and remove GAMESCOPE_ARTIFACT_RUN. +GAMESCOPE_ARTIFACT_RUN=37146942306 +GAMESCOPE_SHA256=22df550d60fcd62e351790eb775ee857e037fcd49fcc23a5bfa4638377e6b4b7 GAMESCOPE_TAG=gamescope-3.16.29-p5 -GAMESCOPE_SHA256=188144e5564e020d0bc485a1f4f90e1c5fd61d0d1d6dd29db21e8b019036a5c6 diff --git a/tools/linuxfs/overlay/usr/local/bin/bannerlator-session b/tools/linuxfs/overlay/usr/local/bin/bannerlator-session index 360e4b05e..cea117923 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-session +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-session @@ -655,8 +655,8 @@ BUSCONF # desktop's launchers ask for; gamescope shows one window at a time and the game takes over. _bl_ui=(-gamepadui) [ "${BL_STEAM_UI:-}" = desktop ] && _bl_ui=() - # A diagnostic client on a pixman desktop: CEF uses CPU frames through Xwayland. - # This does not give games a Vulkan device or make Gamescope work on this GPU. + # Software compatibility mode: CEF and Steam use CPU frames through Xwayland, + # inside either the desktop or the software Gamescope session. _bl_cef=(-cef-force-gpu -cef-use-gl=angle -cef-use-angle=vulkan) if [ "${BL_STEAM_SOFTWARE:-0}" = 1 ]; then _bl_cef=(-cef-disable-gpu -cef-disable-gpu-compositing)