Add system and imported Qualcomm drivers as Linux runtime choices

(cherry picked from commit 08fbd19f74561231e6a3adc2069686af111bd0ad)
(cherry picked from commit dd6a86a187)
This commit is contained in:
K11MCH1 authored and The412Banner committed 2026-10-25 23:09:02 +00:00
1 parent 6339d00a7a
commit 3dfe06b05a
18 files changed
+403 -14

No files matched your search

+11 -2
View File
@@ -6,7 +6,8 @@ if [ -n "${BL_DEBUG_DIR:-}" ]; then
fi
width=${BL_WIDTH:-1280}
height=${BL_HEIGHT:-720}
args=(--backend wayland --expose-wayland -f -W "$width" -H "$height" -w "$width" -h "$height")
backend=${BL_GAMESCOPE_BACKEND:-wayland}
args=(--backend "$backend" --expose-wayland -f -W "$width" -H "$height" -w "$width" -h "$height")
if [ "${BL_FPS:-0}" -gt 0 ]; then
args+=(-r "$BL_FPS")
elif [ "${BL_REFRESH:-0}" -gt 0 ]; then
@@ -20,7 +21,15 @@ unset LIBGL_ALWAYS_SOFTWARE QT_QUICK_BACKEND KWIN_COMPOSE
export MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink LIBGL_KOPPER_DRI2=true
[ -n "${DROIDDECK_GLTHREAD:-}" ] && export mesa_glthread=$DROIDDECK_GLTHREAD
export APPIMAGE_EXTRACT_AND_RUN=1
gamescope "${args[@]}" -- /usr/local/bin/droiddeck-gpu-window "$@"
if [ "$backend" = sdl ]; then export SDL_VIDEODRIVER=wayland; fi
child_env=(SDL_VIDEODRIVER=x11)
if [ "${DROIDDECK_SYSTEM_QUALCOMM:-0}" = 1 ]; then
export VK_LAYER_PATH="$DROIDDECK_QUALCOMM_ROOT/shaders"
export VK_INSTANCE_LAYERS=VK_LAYER_DROIDDECK_qualcomm_shaders
child_env+=("VK_LAYER_PATH=$DROIDDECK_QUALCOMM_ROOT/wsi:$DROIDDECK_QUALCOMM_ROOT/lib"
VK_INSTANCE_LAYERS=VK_LAYER_window_system_integration:VK_LAYER_HYBRIS_compat WSI_X11_FORCE_SHM=1 DISABLE_GAMESCOPE_WSI=1)
fi
"${BL_GAMESCOPE_BINARY:-gamescope}" "${args[@]}" -- /usr/bin/env "${child_env[@]}" /usr/local/bin/droiddeck-gpu-window "$@"
rc=$?
echo "== droiddeck-gpu $(date -u +%H:%M:%S): exited $rc"
exit $rc
@@ -75,7 +75,7 @@ run_gamescope() (
status_file=$(mktemp "${XDG_RUNTIME_DIR:-/tmp}/droiddeck-steam-exit.XXXXXX") || exit 73
trap 'rm -f "$status_file"' EXIT
# Gamescope can return success when its primary child crashed.
BL_STEAM_EXIT_FILE="$status_file" gamescope "$@"
BL_STEAM_EXIT_FILE="$status_file" "${BL_GAMESCOPE_BINARY:-gamescope}" "$@"
compositor_status=$?
if read -r child_status < "$status_file" && [[ $child_status =~ ^[0-9]{1,3}$ ]] \
&& [ "$child_status" -gt 0 ] && [ "$child_status" -le 255 ]; then
@@ -98,6 +98,9 @@ collect_steam_logs() {
fi
}
trap 'collect_steam_logs 2>/dev/null || true' TERM INT HUP
if [ "${DROIDDECK_SYSTEM_QUALCOMM:-0}" = 1 ]; then
echo "== Qualcomm driver source: ${DROIDDECK_QUALCOMM_DRIVER:-system-qualcomm}"
fi
if [ -n "${BL_VK_DRIVER:-}" ]; then
bl_icd_lib=$(sed -n 's/.*"library_path"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$BL_VK_DRIVER" 2>/dev/null | head -1)
bl_icd_lib=$(printf '%s' "$bl_icd_lib" | sed 's|\\/|/|g')
@@ -231,7 +234,10 @@ if [ -z "${BL_INSIDE:-}" ]; then
if [ "$mode" = steam ] && [ "${BL_CURSOR_COMPOSITE:-0}" = 1 ]; then
export gamescope_cursor_composite=2
fi
args=(--backend wayland --expose-wayland -f -W "$width" -H "$height" -w "$nested" -h "$nested_h")
backend=${BL_GAMESCOPE_BACKEND:-wayland}
case "$backend" in wayland|sdl) ;; *) echo "Invalid Gamescope backend: $backend"; exit 1 ;; esac
[ "$backend" != sdl ] || export SDL_VIDEODRIVER=wayland
args=(--backend "$backend" --expose-wayland -f -W "$width" -H "$height" -w "$nested" -h "$nested_h")
if [ "$nested" != "$width" ] || [ "$nested_h" != "$height" ]; then
args+=(-S stretch)
export BL_STRETCHED=1
@@ -269,7 +275,7 @@ if [ -z "${BL_INSIDE:-}" ]; then
/usr/local/bin/droiddeck-pipewire stop
exit $_bl_status
fi
exec gamescope "${args[@]}" -- "$0" "$mode" "$@"
exec "${BL_GAMESCOPE_BINARY:-gamescope}" "${args[@]}" -- "$0" "$mode" "$@"
fi
bl_displays() {
@@ -285,6 +291,13 @@ bl_xprop_set_all() {
[ "$ok" = 1 ]
}
export GDK_BACKEND=x11 QT_QPA_PLATFORM=xcb SDL_VIDEODRIVER=x11
if [ "${DROIDDECK_SYSTEM_QUALCOMM:-0}" = 1 ]; then
export VK_LAYER_PATH="$DROIDDECK_QUALCOMM_ROOT/wsi:$DROIDDECK_QUALCOMM_ROOT/lib"
export VK_INSTANCE_LAYERS=VK_LAYER_window_system_integration:VK_LAYER_HYBRIS_compat
export VK_LOADER_DEBUG=error
export WSI_X11_FORCE_SHM=1 DISABLE_GAMESCOPE_WSI=1
. "$DROIDDECK_QUALCOMM_ROOT/mesa/qualcomm-gl.sh"
fi
reap_orphans() {
local round p stat pid left
for round in 1 2 3 4 5; do
@@ -382,6 +395,7 @@ case $mode in
steam_x64=0
[ "${BL_STEAM_CLIENT_ARCH:-}" = x86_64 ] && steam_x64=1
steam_cef_gpu=1
[ "${BL_STEAM_CEF_SOFTWARE:-0}" != 1 ] || steam_cef_gpu=0
if [ "$steam_x64" = 1 ]; then
step "checking the Steam client's arm64 parts (first run downloads them, ~1-2 min)"
# droiddeck-steam-install removes the repair request: read it first so Repair Steam covers both clients.
@@ -856,6 +870,11 @@ BUSCONF
# A containerized client re-executes itself through pressure-vessel-wrap (bwrap) unless told it is already inside.
export STEAM_STEAMRT_RECURSION_GUARD=1
export LD_LIBRARY_PATH=$steam_root/steamrtarm64:$steam_root/steamrtarm64/panorama${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
bl_steam_path=$PATH
bl_steam_helper=$XDG_DATA_HOME/Steam/steamrtarm64/steamwebhelper
if [ "${DROIDDECK_SYSTEM_QUALCOMM:-0}" = 1 ]; then
bl_steam_path="/usr/local/libexec/droiddeck-steam:$PATH"
fi
export SDL_VIDEO_X11_DGAMOUSE=0
decky_loader=$HOME/homebrew/services/PluginLoader
if [ -f "$HOME/.droiddeck-decky-enabled" ] && [ -x "$decky_loader" ]; then
@@ -1267,6 +1286,7 @@ BUSCONF
desktop_ui_pid=$!
fi
steam_started=$SECONDS
PATH="$bl_steam_path" BL_STEAM_WEBHELPER="$bl_steam_helper" \
"${steam_client[@]}" "${_bl_ui[@]}" "${_bl_cdp[@]}" "${_bl_lang[@]}" -clientbeta "$steam_channel" \
-no-cef-sandbox -cef-ozone-platform=x11 "${_bl_cef[@]}" "$@"
rc=$?
@@ -0,0 +1,16 @@
#!/bin/bash
set -u
if [ "$#" -ge 2 ] && [[ "$1" =~ ^(0[xX])?[0-9a-fA-F]+$ ]] &&
[ -n "${BL_STEAM_WEBHELPER:-}" ] && [ "$2" -ef "$BL_STEAM_WEBHELPER" ]; then
mask=$1
shift
/usr/bin/taskset -p "$mask" "$$" >/dev/null 2>&1 || true
if [ "${DROIDDECK_SYSTEM_QUALCOMM:-0}" = 1 ]; then
# SDL's accelerated window-surface setup stalls on this X11 SHM presentation path.
export SDL_FRAMEBUFFER_ACCELERATION=0
# Valve's helper disables Kopper; Zink needs it to reach the managed X11 WSI layer.
unset LIBGL_KOPPER_DISABLE
fi
exec -- "$@"
fi
exec /usr/bin/taskset "$@"