feat: replace the LXQt desktop with SteamOS-style KDE Plasma (#473)

* feat: replace the LXQt desktop with SteamOS-style KDE Plasma

* feat: leaving the KDE desktop logs out through Plasma and returns to gaming mode

* feat: DroidDeck logo wallpaper as the KDE desktop default

* feat: build the KDE wallpaper from the DroidDeck mark artwork

* ci: keep the built desktop package as a short-lived artifact for device testing

* fix: the desktop loading screen no longer promises Steam on the desktop

* docs: the output resize comments name the desktop's KWin

* fix: the desktop package verifies every package's Arch Linux ARM signature and never replaces a published tag

* fix: programs sent to the GPU from the desktop drop its software rendering overrides

* fix: an interrupted desktop install no longer counts as installed

* feat: pin the desktop package to its DroidDeck-Components release instead of the catalog
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-09 10:39:50 -04:00
1 parent 79880d1502
commit fe71084f23
94 files changed
+1904 -1182

No files matched your search

+3 -13
View File
@@ -39,9 +39,9 @@ for tool in curl tar zstd shasum unzip; do
exit 1
fi
done
if [[ -f "${repo_root}/tools/gamescope/release.env" || -f "${repo_root}/tools/wlroots/release.env" \
if [[ -f "${repo_root}/tools/gamescope/release.env" \
|| -f "${repo_root}/tools/droiddeck-esync/release.env" ]] && ! command -v gh >/dev/null 2>&1; then
echo "GitHub CLI is required to download the pinned Gamescope, wlroots and droiddeck-esync release assets." >&2
echo "GitHub CLI is required to download the pinned Gamescope and droiddeck-esync release assets." >&2
exit 1
fi
@@ -138,9 +138,7 @@ docker run --rm --platform linux/amd64 \
install -Dm644 tools/linuxfs/desktop/droiddeck-desktop "$d/usr/local/bin/droiddeck-desktop"
install -Dm644 tools/linuxfs/desktop/droiddeck-gpu "$d/usr/local/bin/droiddeck-gpu"
install -Dm644 tools/linuxfs/desktop/droiddeck-desktop-gpu "$d/usr/local/bin/droiddeck-desktop-gpu"
install -Dm644 tools/linuxfs/desktop/autostart "$d/etc/xdg/labwc/autostart"
install -Dm644 tools/linuxfs/desktop/rc.xml "$d/etc/xdg/labwc/rc.xml"
install -Dm644 tools/linuxfs/desktop/panel.conf "$d/etc/xdg/lxqt/panel.conf"
install -Dm644 tools/linuxfs/desktop/kwin_wayland_wrapper "$d/usr/local/bin/kwin_wayland_wrapper"
install -Dm644 tools/linuxfs/desktop/firefox-droiddeck.js \
"$d/usr/lib/firefox/defaults/pref/droiddeck.js"
@@ -225,14 +223,6 @@ if [[ -f "${repo_root}/tools/gamescope/release.env" ]]; then
test -f "${linuxfs_dir}/usr/local/bin/gamescope"
fi
if [[ -f "${repo_root}/tools/wlroots/release.env" ]]; then
. "${repo_root}/tools/wlroots/release.env"
wlroots_archive=$(cached "${WLROOTS_SHA256}" wlroots.tzst \
bash -c 'gh release download "$0" -R "$1" -p wlroots.tzst -O "$out"' "${WLROOTS_TAG}" "${github_repo}")
zstd -dc "${wlroots_archive}" | tar -xf - -C "${linuxfs_dir}"
test -f "${linuxfs_dir}/usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so"
fi
. "${repo_root}/tools/linuxfs/uruntime.env"
uruntime_binary=$(cached "${URUNTIME_SHA256}" "${URUNTIME_ASSET}" \
bash -c 'curl -fsSL --retry 3 -o "$out" "$0"' "https://github.com/VHSgunzo/uruntime/releases/download/${URUNTIME_VERSION}/${URUNTIME_ASSET}")
+23
View File
@@ -0,0 +1,23 @@
# The desktop package (KDE Plasma)
The desktop the app installs into its Linux runtime the first time the desktop is opened: KDE Plasma
set up as SteamOS's desktop mode, with Valve's Vapor theme, the Steam Deck wallpaper and launcher
icon, Plasma's default bottom panel, and "Return to Gaming Mode" and Steam on the desktop.
- `seeds.txt`: the packages asked for. `build.sh` takes their closure over Arch Linux ARM's
repositories (`closure.py`) and drops what the runtime already has.
- `runtime-packages.txt`: the runtime's own packages, `name version` from its pacman database
(`ls /var/lib/pacman/local` in the rootfs). Refresh it when the runtime is rebuilt.
- `overlay/`: our files on top - system-wide KDE defaults in `/etc/xdg`, the Vapor theme and its
layout script, the menu entries Steam and Return to Gaming Mode use.
`.github/workflows/build-desktop-kde.yml` builds it and, run with a new tag, publishes it as a
release in Droid-Deck/DroidDeck-Components. `release.env` pins the tag, sha256 and size the apk
installs (`DesktopCatalog.desktopEntry`); a published tag is never replaced, so a changed package
is a new tag and a `release.env` update.
At run time the desktop is started by `tools/linuxfs/desktop/droiddeck-desktop` (the app stages it
at every session): Plasma's own `startplasma-wayland`, with KWin nested in the app's compositor
through `kwin_wayland_wrapper`. KWin composites in software (QPainter) - the Adreno node is not a
DRM device - so games and emulators from the menu go through `droiddeck-gpu`, and Steam goes back
to the app as a Steam session.
Binary file not shown.
+73
View File
@@ -0,0 +1,73 @@
#!/bin/bash
# Builds the KDE Plasma desktop package for the Linux runtime: the closure of seeds.txt over Arch
# Linux ARM's aarch64 repositories, minus what the runtime image already carries, plus overlay/,
# as a zstd tarball that extracts over the rootfs (DesktopCatalog's "tar" kind).
#
# tools/desktop-kde/build.sh <out dir>
#
# The runtime's own packages (runtime-packages.txt, "name version" from its pacman db) are not
# shipped again, except where something in the closure asks for a version of one the runtime does
# not have (a versioned dependency on it, or on a library it provides): then the repository's
# build comes along and replaces it. Nothing is deleted on extraction, so a library whose soname
# moved keeps its old file for what the runtime linked against it.
#
# Every package is fetched over HTTPS and must carry a valid signature by the Arch Linux ARM Build
# System key (archlinuxarm-builder.gpg; primary fingerprint pinned below, as archlinuxarm.org
# publishes it and archlinuxarm-keyring trusts it) and match the sha256 the repository database
# gives for it; anything else stops the build. The repository databases themselves are not signed
# by Arch Linux ARM, so they decide only which signed packages are taken. desktop-kde.packages.txt
# lists every package taken, with its sha256: what a release was built from.
#
# Needs curl, gpgv, tar, xz, zstd, python3.
set -euo pipefail
out=${1:?out dir}
here=$(cd "$(dirname "$0")" && pwd)
mirror=${ALARM_MIRROR:-https://fl.us.mirror.archlinuxarm.org/aarch64}
case $mirror in https://*) ;; *) echo "ALARM_MIRROR must be https" >&2; exit 1 ;; esac
builder=68B3537F39A313B3E574D06777193F152BDBE6A6
fetch() { curl -fsSL --proto '=https' --proto-redir '=https' --retry 6 --retry-delay 5 --retry-all-errors -o "$1" "$2"; }
work=$(mktemp -d); mkdir -p "$out" "$work/db" "$work/root"
# PKG_CACHE keeps the downloaded packages between builds (a local rebuild after an overlay change).
pkgs=${PKG_CACHE:-$work/pkgs}; mkdir -p "$pkgs"
trap 'rm -rf "$work"' EXIT
for repo in core extra alarm; do
fetch "$work/db/$repo.db" "$mirror/$repo/$repo.db"
mkdir -p "$work/db/x_$repo" && tar -xzf "$work/db/$repo.db" -C "$work/db/x_$repo"
done
python3 "$here/closure.py" "$work/db" "$here/runtime-packages.txt" "$here/seeds.txt" > "$work/pkglist.txt"
echo "kde: $(wc -l < "$work/pkglist.txt") packages beyond the runtime's own"
while read -r entry sum; do
file=${entry#*/}
[ -s "$pkgs/$file" ] || fetch "$pkgs/$file" "$mirror/$entry"
fetch "$work/pkg.sig" "$mirror/$entry.sig"
if ! gpgv --status-fd 1 --keyring "$here/archlinuxarm-builder.gpg" "$work/pkg.sig" "$pkgs/$file" 2>/dev/null \
| grep -Eq "^\[GNUPG:\] VALIDSIG .* $builder\$"; then
echo "$file: no valid Arch Linux ARM Build System signature" >&2; rm -f "$pkgs/$file"; exit 1
fi
if [ "$(sha256sum "$pkgs/$file" | cut -d' ' -f1)" != "$sum" ]; then
echo "$file: sha256 differs from the repository database's" >&2; rm -f "$pkgs/$file"; exit 1
fi
tar -xf "$pkgs/$file" -C "$work/root" --no-same-owner --no-same-permissions \
--exclude=.PKGINFO --exclude=.MTREE --exclude=.INSTALL --exclude=.BUILDINFO --exclude=.CHANGELOG
done < "$work/pkglist.txt"
cp -a "$here/overlay/." "$work/root/"
# Weight that no desktop on a phone reads.
rm -rf "$work/root/usr/share/doc" "$work/root/usr/share/man" "$work/root/usr/share/info" \
"$work/root/usr/share/gtk-doc" "$work/root/usr/include" "$work/root/usr/lib/pkgconfig" \
"$work/root/usr/lib/cmake" "$work/root/usr/share/help"
# English only, on purpose: the desktop session runs in C.UTF-8 and nothing hands the app's language
# to KDE, so other translations would be weight no one sees. They come back with localizing the
# desktop itself (LANGUAGE from the app's language at session start).
find "$work/root/usr/share/locale" -mindepth 1 -maxdepth 1 -type d ! -name 'en*' -exec rm -rf {} + 2>/dev/null || true
find "$work/root/usr/lib" -name '*.a' -delete
chmod -R u+rwX "$work/root"
sed 's#^[a-z]*/##' "$work/pkglist.txt" > "$out/desktop-kde.packages.txt" # "file sha256", each verified above
tar -C "$work/root" --zstd -cf "$out/desktop-kde.tar.zst" .
sha256sum "$out/desktop-kde.tar.zst" | awk '{print $1}' > "$out/desktop-kde.sha256"
ls -l "$out/desktop-kde.tar.zst"
+153
View File
@@ -0,0 +1,153 @@
#!/usr/bin/env python3
"""The packages the KDE desktop package ships: the dependency closure of the seeds over Arch Linux
ARM's extracted repository databases, minus what the runtime already has at a version that serves.
closure.py <db dir with x_core, x_extra, x_alarm> <runtime-packages.txt> <seeds.txt>
Prints one "repo/filename sha256" per package to ship (the sha256 the repository database gives).
"""
import collections
import os
import re
import sys
REPOS = ("core", "extra", "alarm")
def vercmp_part(a, b):
# rpmvercmp, as pacman compares version strings.
if a == b:
return 0
sa = re.findall(r"\d+|[a-zA-Z]+", a)
sb = re.findall(r"\d+|[a-zA-Z]+", b)
for x, y in zip(sa, sb):
if x.isdigit() and y.isdigit():
x, y = int(x), int(y)
if x != y:
return 1 if x > y else -1
elif x.isdigit():
return 1
elif y.isdigit():
return -1
elif x != y:
return 1 if x > y else -1
if len(sa) == len(sb):
return 0
return 1 if len(sa) > len(sb) else -1
def vercmp(a, b):
def split(v):
epoch, _, rest = v.rpartition(":") if ":" in v else ("0", "", v)
ver, _, rel = rest.partition("-")
return int(epoch or 0), ver, rel
ea, va, ra = split(a)
eb, vb, rb = split(b)
if ea != eb:
return 1 if ea > eb else -1
c = vercmp_part(va, vb)
if c or not ra or not rb:
return c
return vercmp_part(ra, rb)
def parse_dep(d):
m = re.match(r"^([^<>=]+)(>=|<=|=|>|<)?(.*)$", d)
return m.group(1), m.group(2), m.group(3)
def satisfies(version, op, want):
if not op:
return True
c = vercmp(version, want)
return {"=": c == 0, ">=": c >= 0, "<=": c <= 0, ">": c > 0, "<": c < 0}[op]
def main():
dbdir, runtime_file, seeds_file = sys.argv[1:4]
runtime = {}
for line in open(runtime_file):
parts = line.split()
if len(parts) == 2:
runtime[parts[0]] = parts[1]
seeds = [l.strip() for l in open(seeds_file) if l.strip() and not l.lstrip().startswith("#")]
pkgs, providers = {}, collections.defaultdict(list)
for repo in REPOS:
root = os.path.join(dbdir, "x_" + repo)
for entry in sorted(os.listdir(root)):
fields, key = {}, None
for fname in ("desc", "depends"):
path = os.path.join(root, entry, fname)
if not os.path.exists(path):
continue
for line in open(path, encoding="utf-8", errors="replace"):
line = line.rstrip("\n")
if line.startswith("%") and line.endswith("%"):
key = line.strip("%")
fields[key] = []
elif line == "":
key = None
elif key:
fields[key].append(line)
name = fields.get("NAME", [None])[0]
if not name or name in pkgs:
continue
provides = [parse_dep(p) for p in fields.get("PROVIDES", [])]
pkgs[name] = {"repo": repo, "file": fields["FILENAME"][0], "version": fields["VERSION"][0],
"sha256": fields.get("SHA256SUM", [""])[0],
"depends": fields.get("DEPENDS", []), "provides": provides}
providers[name].append((name, pkgs[name]["version"]))
for pname, _, pver in provides:
providers[pname].append((name, pver or pkgs[name]["version"]))
def resolve(dep):
"""The package to take for a dependency string, and whether the runtime's copy serves."""
name, op, want = parse_dep(dep)
# A runtime package that is the dependency or provides it, at a version that serves.
if name in runtime and satisfies(runtime[name], op, want):
return name, True
candidates = providers.get(name, [])
for real, _ in candidates:
if real in runtime:
# A provided name (a soname, mostly): the runtime's build serves as long as it is
# the repository's own, or nothing asks for a particular version.
if not op or runtime[real] == pkgs[real]["version"]:
return real, True
if satisfies_provider(real, name, op, want):
return real, False
for real, pver in candidates:
if satisfies(pver, op, want):
return real, False
return None, False
def satisfies_provider(real, name, op, want):
if real == name:
return satisfies(pkgs[real]["version"], op, want)
return any(p == name and satisfies(v or pkgs[real]["version"], op, want) for p, _, v in pkgs[real]["provides"])
ship, seen, missing = [], set(), []
queue = list(seeds)
while queue:
dep = queue.pop()
real, served = resolve(dep)
if real is None:
missing.append(dep)
continue
if served or real in seen:
continue
seen.add(real)
ship.append(real)
queue.extend(pkgs[real]["depends"])
if missing:
sys.exit("unresolved: " + " ".join(sorted(set(missing))))
upgraded = sorted(n for n in ship if n in runtime)
if upgraded:
print("replacing runtime packages: " + " ".join(f"{n} {runtime[n]} -> {pkgs[n]['version']}" for n in upgraded),
file=sys.stderr)
for name in sorted(ship):
print(pkgs[name]["repo"] + "/" + pkgs[name]["file"], pkgs[name]["sha256"])
if __name__ == "__main__":
main()
@@ -0,0 +1,2 @@
[Basic Settings]
Indexing-Enabled=false
@@ -0,0 +1,5 @@
[Settings]
gtk-theme-name=Breeze-Dark
gtk-icon-theme-name=breeze-dark
gtk-font-name=Noto Sans 11
gtk-application-prefer-dark-theme=true
@@ -0,0 +1,5 @@
[Mouse]
cursorTheme=breeze_cursors
[Libinput][Defaults]
PointerAccelerationProfile=1
@@ -0,0 +1,24 @@
[KDE]
LookAndFeelPackage=com.valve.vapor.desktop
SingleClick=false
widgetStyle=Breeze
[General]
ColorScheme=Vapor
font=Noto Sans,11,-1,5,50,0,0,0,0,0
menuFont=Noto Sans,11,-1,5,50,0,0,0,0,0
smallestReadableFont=Noto Sans,9,-1,5,50,0,0,0,0,0
toolBarFont=Noto Sans,11,-1,5,50,0,0,0,0,0
fixed=Noto Sans Mono,11,-1,5,50,0,0,0,0,0
[Icons]
Theme=breeze-dark
[KDE Action Restrictions][$i]
action/switch_user=false
action/start_new_session=false
action/lock_screen=false
[KDE Control Module Restrictions][$i]
kcm_sddm.desktop=false
kcm_plymouth.desktop=false
@@ -0,0 +1,2 @@
[Desktop Entry]
DefaultProfile=Vapor.profile
@@ -0,0 +1,3 @@
[Daemon]
Autolock=false
LockOnResume=false
@@ -0,0 +1,2 @@
[General]
loginMode=emptySession
@@ -0,0 +1,3 @@
[KSplash]
Engine=none
Theme=None
@@ -0,0 +1,3 @@
[Wallet]
Enabled=false
First Use=false
+12
View File
@@ -0,0 +1,12 @@
[org.kde.kdecoration2]
library=org.kde.breeze
[WindowSwitcher]
LayoutName=org.kde.breeze.desktop
[DesktopSwitcher]
LayoutName=org.kde.breeze.desktop
[Plugins]
blurEnabled=false
contrastEnabled=false
@@ -0,0 +1,32 @@
[$Version]
update_info=kwinrules.upd:replace-placement-string-to-enum,kwinrules.upd:use-virtual-desktop-ids
[1]
Description=Window settings for Steam Keyboard
above=true
aboverule=2
skiptaskbar=true
skiptaskbarrule=2
title=Steam Keyboard
titlematch=2
type=16
typerule=2
wmclass=steam
wmclasscomplete=true
wmclassmatch=2
[9bd6e503-ac60-4e7b-9131-0b10c84b37eb]
Description=Window settings for Steam Keyboard
above=true
aboverule=2
title=Steam Keyboard
titlematch=2
type=16
typerule=2
wmclass=steam
wmclasscomplete=true
wmclassmatch=2
[General]
count=1
rules=1
@@ -0,0 +1,2 @@
[Theme]
name=Vapor
@@ -0,0 +1,2 @@
[General]
systemdBoot=false
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Return to Gaming Mode
Comment=Log out of the desktop and go back to Steam
Exec=dbus-send --session --type=method_call --dest=org.kde.Shutdown /Shutdown org.kde.Shutdown.logout
Icon=steamdeck-gaming-return
Terminal=false
Type=Application
StartupNotify=false
NoDisplay=true
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=Steam Big Picture
Comment=The Steam client, full screen with a controller
Exec=/usr/local/bin/steamdeck-steam bigpicture
Icon=steam
Terminal=false
Categories=Game;
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=Steam
Comment=The Steam client, in a window
Exec=/usr/local/bin/steamdeck-steam desktop
Icon=steam
Terminal=false
Categories=Game;
@@ -0,0 +1,119 @@
[ColorEffects:Disabled]
Color=56,56,56
ColorAmount=0
ColorEffect=0
ContrastAmount=0.65
ContrastEffect=1
IntensityAmount=0.1
IntensityEffect=2
[ColorEffects:Inactive]
ChangeSelectionColor=true
Color=112,111,110
ColorAmount=0.025
ColorEffect=2
ContrastAmount=0.1
ContrastEffect=2
Enable=false
IntensityAmount=0
IntensityEffect=0
[Colors:Button]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=239,240,241
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:Complementary]
BackgroundAlternate=59,64,69
BackgroundNormal=49,54,59
DecorationFocus=30,146,255
DecorationHover=61,174,230
ForegroundActive=246,116,0
ForegroundInactive=175,176,179
ForegroundLink=61,174,230
ForegroundNegative=237,21,21
ForegroundNeutral=201,206,59
ForegroundNormal=239,240,241
ForegroundPositive=17,209,22
ForegroundVisited=61,174,230
[Colors:Selection]
BackgroundAlternate=29,153,243
BackgroundNormal=86,159,204
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=252,252,252
ForegroundInactive=239,240,241
ForegroundLink=253,188,75
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=31,31,38
ForegroundPositive=126,166,75
ForegroundVisited=189,195,199
[Colors:Tooltip]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=239,240,241
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:View]
BackgroundAlternate=26,33,42
BackgroundNormal=21,28,35
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=239,240,241
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:Window]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=241,241,242
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[General]
ColorScheme=Breeze Dark
Name=Vapor
shadeSortColumn=true
[KDE]
contrast=4
[WM]
activeBackground=36,39,47
activeBlend=255,255,255
activeForeground=239,240,241
inactiveBackground=36,39,44
inactiveBlend=74,83,101
inactiveForeground=127,140,141
@@ -0,0 +1,7 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg2" height="64" style="" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" sodipodi:docname="deck_icon.svg" inkscape:version="1.2-dev (d2dd25d878, 2022-02-01, custom)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
<path id="path42220" d="m 32 4 v 10 a 18 18 0 0 1 18 18 a 18 18 0 0 1 -18 18 v 10 a 28 28 0 0 0 28 -28 a 28 28 0 0 0 -28 -28 z" style="fill:#fff;fill-rule:evenodd"/>
<circle id="path43518" cx="32" cy="32" r="14" style="fill:#1a9fff;fill-rule:evenodd"/>
<path id="path52048" d="m 32 22 a 2 2 0 0 0 -1.4140625 .5859375 l -8 8 a 2.0002 2.0002 0 0 0 0 2.828125 l 8 8 a 2 2 0 0 0 2.828125 0 a 2 2 0 0 0 0 -2.828125 l -4.5859375 -4.5859375 h 11.171875 a 2 2 0 0 0 2 -2 a 2 2 0 0 0 -2 -2 h -11.171875 l 4.5859375 -4.5859375 a 2 2 0 0 0 0 -2.828125 a 2 2 0 0 0 -1.4140625 -.5859375 z" style="fill:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0"/>
<g id="path89696" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" version="1.1">
<circle style="opacity:0.2" cx="32" cy="33" r="28"/>
<path style="fill:#1955aa" d="M 60,32 C 60,47.463973 47.463973,60 32,60 18.913155,60 7.9232734,51.021833 4.853777,38.888922 4.2962258,36.685069 6.0625889,38.217811 6.0625889,35.840683 6.0625889,35.576732 4.0036523,31.472952 4.010909,31.210755 4.4288017,16.111731 16.799978,4 32,4 47.463973,4 60,16.536027 60,32 Z"/>
<path style="opacity:0.2" d="M 40,16 A 11,11 0 0 0 29,27 11,11 0 0 0 29.011719,27.246094 L 23.753906,36.009766 A 8.5,8.5 0 0 0 23.5,36 8.5,8.5 0 0 0 17.837891,38.171875 L 4.046875,32.078125 A 28,28 0 0 0 4,33 28,28 0 0 0 4.9375,40.123047 L 15.003906,44.572266 A 8.5,8.5 0 0 0 23.5,53 8.5,8.5 0 0 0 32,44.5 8.5,8.5 0 0 0 31.966797,43.849609 L 41.373047,37.904297 A 11,11 0 0 0 51,27 11,11 0 0 0 40,16 Z M 40,20 A 7,7 0 0 1 47,27 7,7 0 0 1 40,34 7,7 0 0 1 33,27 7,7 0 0 1 40,20 Z M 40,22 A 5,5 0 0 0 35,27 5,5 0 0 0 40,32 5,5 0 0 0 45,27 5,5 0 0 0 40,22 Z M 23.5,39 A 5.5,5.5 0 0 1 29,44.5 5.5,5.5 0 0 1 23.5,50 5.5,5.5 0 0 1 18.207031,45.986328 L 22.085938,47.701172 A 3.50035,3.50035 0 1 0 24.914062,41.298828 L 21.035156,39.583984 A 5.5,5.5 0 0 1 23.5,39 Z"/>
<path style="fill:#ffffff" d="M 30.6,23.6 34.8,33.4 44.7,34.8 29.2,44.6 V 37.6 H 22.2 Z"/>
<path style="fill:#ffffff" d="M 40 15 A 11 11 0 0 0 29 26 A 11 11 0 0 0 40 37 A 11 11 0 0 0 51 26 A 11 11 0 0 0 40 15 z M 40 19 A 7 7 0 0 1 47 26 A 7 7 0 0 1 40 33 A 7 7 0 0 1 33 26 A 7 7 0 0 1 40 19 z"/>
<path style="fill:#ffffff" d="M 23.5 35 A 8.5 8.5 0 0 0 15 43.5 A 8.5 8.5 0 0 0 23.5 52 A 8.5 8.5 0 0 0 32 43.5 A 8.5 8.5 0 0 0 23.5 35 z M 23.5 38 A 5.5 5.5 0 0 1 29 43.5 A 5.5 5.5 0 0 1 23.5 49 A 5.5 5.5 0 0 1 18 43.5 A 5.5 5.5 0 0 1 23.5 38 z"/>
<circle style="fill:#ffffff" cx="40" cy="26" r="5"/>
<path style="fill:#ffffff" d="M 4.046875 31.078125 A 28 28 0 0 0 4 32 A 28 28 0 0 0 4.9375 39.123047 L 22.085938 46.701172 A 3.50035 3.50035 0 1 0 24.914062 40.298828 L 4.046875 31.078125 z"/>
<path style="opacity:0.1;fill:#ffffff" d="M 32,4 C 17.100366,4 4.9180811,15.636956 4.0488281,30.318359 4.0459379,30.367175 4.08106,30.473412 4.1113281,30.572266 5.3425337,16.245714 17.354447,5 32,5 47.296335,5 59.718596,17.267575 59.986328,32.5 59.989262,32.333062 60,32.167638 60,32 60,16.536027 47.463973,4 32,4 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@@ -0,0 +1,13 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg2" height="64" style="" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" sodipodi:docname="start.svg" inkscape:version="1.2-dev (d2dd25d878, 2022-02-01, custom)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#ffffff;
}
</style>
<g id="start-here-kde">
<rect style="fill:#808080;fill-rule:evenodd;opacity:0.000001" id="rect1101" width="64" height="64" x="0" y="0" />
<path id="path42220" d="m 32 4 v 10 a 18 18 0 0 1 18 18 a 18 18 0 0 1 -18 18 v 10 a 28 28 0 0 0 28 -28 a 28 28 0 0 0 -28 -28 z" style="fill:currentColor;fill-rule:evenodd" class="ColorScheme-Text" />
<circle id="path43518" cx="32" cy="32" r="14" style="fill:#1a9fff;fill-rule:evenodd" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1020 B

@@ -0,0 +1,94 @@
[Background]
Color=21,27,33
[BackgroundFaint]
Color=22,32,45
[BackgroundIntense]
Color=19,46,69
[Color0]
Color=21,27,33
[Color0Faint]
Color=49,54,59
[Color0Intense]
Color=127,140,141
[Color1]
Color=237,21,21
[Color1Faint]
Color=120,50,40
[Color1Intense]
Color=192,57,43
[Color2]
Color=71,146,176
[Color2Faint]
Color=52,108,146
[Color2Intense]
Color=171,207,228
[Color3]
Color=246,116,0
[Color3Faint]
Color=182,86,25
[Color3Intense]
Color=253,188,75
[Color4]
Color=29,153,243
[Color4Faint]
Color=27,102,143
[Color4Intense]
Color=61,174,233
[Color5]
Color=155,89,182
[Color5Faint]
Color=97,74,115
[Color5Intense]
Color=142,68,173
[Color6]
Color=227,255,194
[Color6Faint]
Color=91,118,56
[Color6Intense]
Color=141,189,85
[Color7]
Color=239,240,241
[Color7Faint]
Color=99,104,109
[Color7Intense]
Color=252,252,252
[Foreground]
Color=239,240,241
[ForegroundFaint]
Color=220,230,231
[ForegroundIntense]
Color=252,252,252
[General]
Description=SteamOS
Opacity=0.9
Wallpaper=
@@ -0,0 +1,6 @@
[Appearance]
ColorScheme=Vapor
[General]
Name=Vapor
Parent=FALLBACK/
@@ -0,0 +1,12 @@
Third-party files in DroidDeck's KDE desktop package (tools/desktop-kde/overlay):
- Vapor (color scheme, Plasma theme, look-and-feel package, Konsole profile and color scheme) and the
steamdeck-gaming-return / distributor-logo-steamdeck icons: Valve's steamdeck-kde-presets
(https://github.com/Jovian-Experiments/steamdeck-kde-presets), GPL-2.0-or-later (look-and-feel)
and GPL-3.0 (Plasma theme), as their metadata states. The look-and-feel package's defaults, setup
scripts and layout were adapted for DroidDeck; its Plasma 5 splash screen was left out.
- steam.svg: Papirus icon theme (https://github.com/PapirusDevelopmentTeam/papirus-icon-theme),
GPL-3.0.
Everything else in the package is Arch Linux ARM's own packages, under their own licenses
(/usr/share/licenses).
@@ -0,0 +1,147 @@
[ColorEffects:Disabled]
Color=56,56,56
ColorAmount=0
ColorEffect=0
ContrastAmount=0.65
ContrastEffect=1
IntensityAmount=0.1
IntensityEffect=2
[ColorEffects:Inactive]
ChangeSelectionColor=true
Color=112,111,110
ColorAmount=0.025
ColorEffect=2
ContrastAmount=0.1
ContrastEffect=2
Enable=false
IntensityAmount=0
IntensityEffect=0
[Colors:Button]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=239,240,241
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:Complementary]
BackgroundAlternate=59,64,69
BackgroundNormal=49,54,59
DecorationFocus=30,146,255
DecorationHover=61,174,230
ForegroundActive=246,116,0
ForegroundInactive=175,176,179
ForegroundLink=61,174,230
ForegroundNegative=237,21,21
ForegroundNeutral=201,206,59
ForegroundNormal=239,240,241
ForegroundPositive=17,209,22
ForegroundVisited=61,174,230
[Colors:Selection]
BackgroundAlternate=29,153,243
BackgroundNormal=86,159,204
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=252,252,252
ForegroundInactive=239,240,241
ForegroundLink=253,188,75
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=31,31,38
ForegroundPositive=126,166,75
ForegroundVisited=189,195,199
[Colors:Tooltip]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=239,240,241
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:View]
BackgroundAlternate=26,33,42
BackgroundNormal=21,28,35
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=239,240,241
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:Window]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=241,241,242
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:Header]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=241,241,242
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[Colors:Header][Inactive]
BackgroundAlternate=77,77,77
BackgroundNormal=36,39,44
DecorationFocus=52,108,146
DecorationHover=85,161,205
ForegroundActive=61,174,233
ForegroundInactive=189,195,199
ForegroundLink=41,128,185
ForegroundNegative=218,68,83
ForegroundNeutral=199,130,61
ForegroundNormal=241,241,242
ForegroundPositive=126,166,75
ForegroundVisited=127,140,141
[General]
ColorScheme=Vapor
Name=Vapor
shadeSortColumn=true
[KDE]
contrast=4
[WM]
activeBackground=36,39,47
activeBlend=255,255,255
activeForeground=239,240,241
inactiveBackground=36,39,44
inactiveBlend=74,83,101
inactiveForeground=127,140,141
@@ -0,0 +1,13 @@
{
"KPlugin": {
"Authors": [{ "Name": "Valve" }],
"Category": "Plasma Theme",
"Description": "Vapor - SteamOS Theme based on KDE Breeze and Breath",
"EnabledByDefault": true,
"Id": "Vapor",
"License": "GPL-3.0",
"Name": "Vapor",
"Version": "0.0.17"
},
"X-Plasma-API": "5.0"
}
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg id="svg2" version="1.1" viewBox="0 0 173 56.000004" sodipodi:docname="plasmoidheading.svg" inkscape:version="1.2-dev (3978b257e3, 2021-12-14, custom)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs50" />
<sodipodi:namedview id="namedview48" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" showgrid="true" inkscape:zoom="7.5562581" inkscape:cx="71.265432" inkscape:cy="14.292789" inkscape:window-width="1920" inkscape:window-height="1007" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg2" inkscape:blackoutopacity="0.0">
<inkscape:grid type="xygrid" id="grid4266" />
</sodipodi:namedview>
<style id="current-color-scheme" type="text/css">
.ColorScheme-Text {
color:#232629;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-ViewBackground {
color:#ffffff;
}
</style>
<path id="hint-stretch-borders" d="m-7-7h5v5h-5z" opacity=".6" />
<g id="header-topleft">
<path id="path1780" class="ColorScheme-Background" fill="currentColor" d="M 16 6 C 14.338 6 13 7.338 13 9 L 13 12 L 19 12 L 19 6 L 16 6 z " opacity=".75" />
<path id="rect20523-3" class="ColorScheme-ViewBackground" style="fill:currentColor;fill-rule:evenodd;fill-opacity:.5" d="M 16 6 C 14.3774542034 6 13.0653658941 7.27584226003 13.00390625 8.8828125 C 13.0641327208 7.82972546125 13.9313095588 7 15 7 L 19 7 L 19 6 L 16 6 z " />
<path id="rect20523-3" style="fill:#fff;fill-rule:evenodd;fill-opacity:.15" d="M 16 6 C 14.3774542034 6 13.0653658941 7.27584226003 13.00390625 8.8828125 C 13.0641327208 7.82972546125 13.9313095588 7 15 7 L 19 7 L 19 6 L 16 6 z " />
</g>
<g id="header-top">
<path id="path1066" class="ColorScheme-Background" transform="rotate(-90)" d="m-12 19h6v32h-6z" fill="currentColor" opacity=".75" />
<rect id="rect934" x="19" y="6" width="32" height="1" ry="0" class="ColorScheme-ViewBackground" style="fill:currentColor;fill-rule:evenodd;fill-opacity:.5" />
<rect id="rect934" x="19" y="6" width="32" height="1" ry="0" style="fill:#fff;fill-rule:evenodd;fill-opacity:.15" />
</g>
<g id="header-topright">
<path id="path1785" class="ColorScheme-Background" fill="currentColor" d="M 51 6 L 51 12 L 57 12 L 57 9 C 57 7.338 55.662 6 54 6 L 51 6 z " opacity=".75" />
<path id="rect20523-3-7" class="ColorScheme-ViewBackground" style="fill:currentColor;fill-rule:evenodd;fill-opacity:.5" d="m 54,6 c 1.6225457966,0 2.9346341059,1.27584226003 2.99609375,2.8828125 C 56.9358672792,7.82972546125 56.0686904412,7 55,7 H 51 V 6 Z" />
<path id="rect20523-3-7" style="fill:#fff;fill-opacity:.15;fill-rule:evenodd" d="m 54,6 c 1.6225457966,0 2.9346341059,1.27584226003 2.99609375,2.8828125 C 56.9358672792,7.82972546125 56.0686904412,7 55,7 H 51 V 6 Z" />
</g>
<path id="header-left" class="ColorScheme-Background" transform="scale(-1)" d="m-19-44h6v32h-6z" fill="currentColor" opacity=".75" />
<path id="header-center" class="ColorScheme-Background" d="m19 12h32v32h-32z" fill="currentColor" opacity=".75" />
<path id="header-right" class="ColorScheme-Background" d="m51 12h6v32h-6z" fill="currentColor" opacity=".75" />
<g id="header-bottomleft" fill="currentColor">
<path id="path3182" class="ColorScheme-Background" d="m 19,50 v -6 h -6 v 6 z" opacity="0.75" fill="currentColor" sodipodi:nodetypes="ccccc" />
<path id="path3184" class="ColorScheme-Text" d="m19 50v-1h-4l-2-2e-5v1l2 2e-5h1z" fill-rule="evenodd" opacity=".15" fill="currentColor" />
</g>
<g id="header-bottom" fill="currentColor">
<path id="rect3152" class="ColorScheme-Background" transform="rotate(90)" d="m44-51h6v32h-6z" opacity=".75" fill="currentColor" />
<path id="rect3154" class="ColorScheme-Text" transform="rotate(90)" d="m49-51h1v32h-1z" opacity=".15" fill="currentColor" />
</g>
<g id="header-bottomright" fill="currentColor">
<path id="path3176" class="ColorScheme-Background" d="m 57,44 h -6 v 6 h 6 z" opacity="0.75" fill="currentColor" sodipodi:nodetypes="ccccc" />
<path id="path3178" class="ColorScheme-Text" d="m57 49h-6v1h6c0-1-2e-5 0 0-1z" fill-rule="evenodd" opacity=".15" fill="currentColor" />
</g>
<g id="footer-topleft" fill="currentColor">
<path id="path3182-1" class="ColorScheme-Background" d="m 67,6 v 6 H 61 V 6 Z" opacity="0.75" fill="currentColor" sodipodi:nodetypes="ccccc" />
<path id="path3184-8" class="ColorScheme-Text" d="m67 6v1h-4l-2 2e-5v-1l2-2e-5h1z" fill-rule="evenodd" opacity=".15" fill="currentColor" />
</g>
<g id="footer-top" fill="currentColor">
<path id="rect3152-0" class="ColorScheme-Background" transform="matrix(0 -1 -1 0 0 0)" d="m-12-99h6v32h-6z" opacity=".75" fill="currentColor" />
<path id="rect3154-9" class="ColorScheme-Text" transform="matrix(0 -1 -1 0 0 0)" d="m-7-99h1v32h-1z" opacity=".15" fill="currentColor" />
</g>
<g id="footer-topright" fill="currentColor">
<path id="path3176-6" class="ColorScheme-Background" d="M 105,12 H 99 V 6 h 6 z" opacity="0.75" fill="currentColor" sodipodi:nodetypes="ccccc" />
<path id="path3178-2" class="ColorScheme-Text" d="m105 7h-6v-1h6c0 1-2e-5 0 0 1z" fill-rule="evenodd" opacity=".15" fill="currentColor" />
</g>
<path id="footer-left" class="ColorScheme-Background" transform="scale(-1 1)" d="m-67 12h6v32h-6z" fill="currentColor" opacity=".75" />
<path id="footer-center" class="ColorScheme-Background" transform="scale(1 -1)" d="m67-44h32v32h-32z" fill="currentColor" opacity=".75" />
<path id="footer-right" class="ColorScheme-Background" transform="scale(1 -1)" d="m99-44h6v32h-6z" fill="currentColor" opacity=".75" />
<path id="footer-bottomleft" opacity=".75" class="ColorScheme-Background" fill="currentColor" d="M 61 44 L 61 47 C 61 48.662 62.338 50 64 50 L 67 50 L 67 44 L 61 44 z " />
<path id="footer-bottom" class="ColorScheme-Background" transform="matrix(0 1 1 0 0 0)" d="m44 67h6v32h-6z" fill="currentColor" opacity=".75" />
<path id="footer-bottomright" class="ColorScheme-Background" fill="currentColor" d="M 99 44 L 99 50 L 102 50 C 103.662 50 105 48.662 105 47 L 105 44 L 99 44 z " opacity=".75" />
<path id="hint-top-margin" d="m33 12h4v6h-4z" fill="#f0f" />
<path id="hint-bottom-margin" d="m33 38h4v6h-4z" fill="#f0f" />
<path id="hint-right-margin" transform="rotate(90)" d="m26-51h4v6h-4z" fill="#f0f" />
<path id="hint-left-margin" transform="rotate(90)" d="m26-25h4v6h-4z" fill="#f0f" />
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

@@ -0,0 +1,27 @@
[kdeglobals][KDE]
widgetStyle=Breeze
[kdeglobals][General]
ColorScheme=Vapor
[kdeglobals][Icons]
Theme=breeze-dark
[plasmarc][Theme]
name=Vapor
[kcminputrc][Mouse]
cursorTheme=breeze_cursors
[kwinrc][WindowSwitcher]
LayoutName=org.kde.breeze.desktop
[kwinrc][DesktopSwitcher]
LayoutName=org.kde.breeze.desktop
[kwinrc][org.kde.kdecoration2]
library=org.kde.breeze
[KSplash]
Engine=none
Theme=None
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

@@ -0,0 +1,43 @@
// The first desktop: DroidDeck's wallpaper, and SteamOS's Plasma's default bottom panel with the Steam Deck
// launcher icon, Steam, the file manager, the browser and Konsole pinned to the task manager.
var desktops = desktopsForActivity(currentActivity());
for (var i = 0; i < desktops.length; i++) {
desktops[i].wallpaperPlugin = "org.kde.image";
desktops[i].currentConfigGroup = ["Wallpaper", "org.kde.image", "General"];
desktops[i].writeConfig("Image", "file:///usr/share/wallpapers/DroidDeck");
}
var panel = new Panel;
panel.location = "bottom";
panel.height = 2 * Math.ceil(gridUnit * 2.5 / 2);
var kickoff = panel.addWidget("org.kde.plasma.kickoff");
kickoff.currentConfigGroup = ["Shortcuts"];
kickoff.writeConfig("global", "Alt+F1");
kickoff.currentConfigGroup = ["General"];
kickoff.writeConfig("icon", "distributor-logo-steamdeck");
panel.addWidget("org.kde.plasma.pager");
var tasks = panel.addWidget("org.kde.plasma.icontasks");
tasks.currentConfigGroup = ["General"];
tasks.writeConfig("launchers", [
"applications:steamdeck-steam.desktop",
"preferred://filemanager",
"preferred://browser",
"applications:org.kde.konsole.desktop",
]);
panel.addWidget("org.kde.plasma.marginsseparator");
var tray = panel.addWidget("org.kde.plasma.systemtray");
var trayId = tray.readConfig("SystrayContainmentId");
if (trayId) {
var trayContainment = desktopById(trayId);
trayContainment.currentConfigGroup = ["General"];
trayContainment.writeConfig("scaleIconsToFit", true);
}
// The runtime has no locale of its own (C.UTF-8), whose short date reads "9 10 2026".
var clock = panel.addWidget("org.kde.plasma.digitalclock");
clock.currentConfigGroup = ["Appearance"];
clock.writeConfig("dateFormat", "isoDate");
panel.addWidget("org.kde.plasma.showdesktop");
@@ -0,0 +1,4 @@
applet.wallpaperPlugin = 'org.kde.image'
applet.currentConfigGroup = ["Wallpaper", "org.kde.image", "General"]
applet.writeConfig("Image", "file:///usr/share/wallpapers/DroidDeck")
applet.reloadConfig()
@@ -0,0 +1,3 @@
applet.currentConfigGroup = ["General"]
applet.writeConfig("icon", "distributor-logo-steamdeck")
applet.reloadConfig()
@@ -0,0 +1,6 @@
systemtrayId = applet.readConfig("SystrayContainmentId");
if (systemtrayId) {
const systrayContainer = desktopById(systemtrayId);
systrayContainer.currentConfigGroup = ["General"];
systrayContainer.writeConfig("scaleIconsToFit", true);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

@@ -0,0 +1,22 @@
{
"KPlugin": {
"Authors": [
{
"Email": "",
"Name": "Valve"
}
],
"Category": "",
"Description": "Vapor - SteamOS theme variant of KDE BreezeDark",
"Id": "com.valve.vapor.desktop",
"License": "GPLv2+",
"Name": "Vapor",
"ServiceTypes": [
"Plasma/LookAndFeel"
],
"Version": "0.01",
"Website": ""
},
"X-KDE-ParentApp": "",
"X-Plasma-MainScript": "defaults"
}
@@ -0,0 +1,26 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080">
<!-- DroidDeck's desktop wallpaper: the mark (artwork/droiddeck-mark.svg) on deep navy. -->
<defs>
<radialGradient id="bg" cx="960" cy="540" r="1150" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#14213a"/>
<stop offset="0.5" stop-color="#0a1120"/>
<stop offset="1" stop-color="#04060b"/>
</radialGradient>
<radialGradient id="glow" cx="947.21" cy="540.00" r="420" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#1A9FFF" stop-opacity="0.22"/>
<stop offset="1" stop-color="#1A9FFF" stop-opacity="0"/>
</radialGradient>
<mask id="negative-space" maskUnits="userSpaceOnUse" x="-31.98" y="0" width="207.92" height="223.72">
<rect x="-31.98" y="0" width="207.92" height="223.72" fill="#fff"/>
<circle cx="63.98" cy="111.86" r="71.81" fill="#000"/>
<rect x="56.055" y="0" width="15.83" height="45" fill="#000"/>
<rect x="56.055" y="178.72" width="15.83" height="45" fill="#000"/>
</mask>
</defs>
<rect width="1920" height="1080" fill="url(#bg)"/>
<circle cx="947.21" cy="540.00" r="420" fill="url(#glow)"/>
<g transform="translate(844.84 361.02) scale(1.6)">
<path fill="#FFFFFF" mask="url(#negative-space)" d="M-31.98 0H63.97c61.84 0 111.96 50.08 111.96 111.86S125.81 223.72 63.97 223.72H-31.98V0Z"/>
<circle cx="63.98" cy="111.86" r="55.98" fill="#1A9FFF"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,8 @@
{
"KPlugin": {
"Authors": [{ "Name": "DroidDeck" }],
"Id": "DroidDeck",
"License": "GPL-3.0-or-later",
"Name": "DroidDeck"
}
}
+4
View File
@@ -0,0 +1,4 @@
DESKTOP_KDE_REPO=Droid-Deck/DroidDeck-Components
DESKTOP_KDE_TAG=desktop-kde-r1
DESKTOP_KDE_SHA256=55747e75d0ec055ab7ea1e92a757f3be227cc3205bb9101f5b53cadef6318579
DESKTOP_KDE_SIZE=846370256
+165
View File
@@ -0,0 +1,165 @@
acl 2.4.0-1
archlinux-keyring 20260727-1
archlinuxarm-keyring 20240419-2
attr 2.6.0-1
audit 4.2.1-1
base 3-3
bash 5.3.15-1
binutils 2.46+r70+g155188ea10a7-1
brotli 1.2.0-1
bzip2 1.0.8-6
ca-certificates 20240618-1
ca-certificates-mozilla 3.126-1
ca-certificates-utils 20240618-1
coreutils 9.11-2
cryptsetup 2.8.7-1
curl 8.21.0-1
dbus 1.16.2-1
dbus-broker 37-3
dbus-broker-units 37-3
dbus-units 37-3
device-mapper 2.03.41-1
dhcpcd 10.3.2-1
diffutils 3.12-2
e2fsprogs 1.47.4-1
ex-vi-compat 3-1
expat 2.8.2-1
file 5.48-1
filesystem 2025.10.12-1
findutils 4.11.0-1
gawk 5.4.1-1
gcc-libs 16.1.1+r12+g301eb08fa2c5-1
gdbm 1.26-2
gettext 1.0-2
glib2 2.88.3-1
glibc 2.43+r22+g8362e8ce10b2-2
gmp 6.3.0-3
gnulib-l10n 20241231-1
gnupg 2.4.9-2
gnutls 3.8.13-2
gpgme 2.1.2-1
gpm 1.20.7.r38.ge82d1a6-6
grep 3.12-2
gzip 1.14-2
hwdata 0.410-1
iana-etc 20260530-1
icu 78.3-1
iproute2 7.1.0-1
iptables 1:1.8.13-1
iputils 20250605-1
jansson 2.15.0-1
json-c 0.19-1
kbd 2.10.0-1
keyutils 1.6.3-4
kmod 34.2-1
krb5 1.22.2-1
leancrypto 1.8.0-1
libarchive 3.8.9-1
libasan 16.1.1+r12+g301eb08fa2c5-1
libassuan 3.0.0-1
libatomic 16.1.1+r12+g301eb08fa2c5-1
libbpf 1.7.0-1
libcap 2.78-1
libcap-ng 0.9.3-1
libedit 20260512_3.1-1
libelf 0.195-1
libevent 2.1.13-2
libffi 3.7.1-1
libgcc 16.1.1+r12+g301eb08fa2c5-1
libgcrypt 1.12.2-1
libgfortran 16.1.1+r12+g301eb08fa2c5-1
libgomp 16.1.1+r12+g301eb08fa2c5-1
libgpg-error 1.61-1
libidn2 2.3.8-1
libksba 1.8.0-1
libldap 2.6.13-1
liblsan 16.1.1+r12+g301eb08fa2c5-1
libmakepkg-dropins 20-1
libmnl 1.0.5-2
libnetfilter_conntrack 1.1.1-1
libnfnetlink 1.0.2-2
libnftnl 1.3.1-1
libnghttp2 1.70.0-1
libnghttp3 1.18.0-1
libngtcp2 1.25.0-1
libnl 3.12.0-1
libnsl 2.0.1-2
libobjc 16.1.1+r12+g301eb08fa2c5-1
libp11-kit 0.26.4-1
libpcap 1.10.6-1
libpsl 0.21.5-2
libquadmath 16.1.1+r12+g301eb08fa2c5-1
libsasl 2.1.28-5
libseccomp 2.6.0-1
libsecret 0.21.7-1
libssh2 1.11.1-7
libstdc++ 16.1.1+r12+g301eb08fa2c5-1
libsysprof-capture 50.0-4
libtasn1 4.21.0-1
libtirpc 1.3.7-1
libtsan 16.1.1+r12+g301eb08fa2c5-1
libubsan 16.1.1+r12+g301eb08fa2c5-1
libunistring 1.4.2-1
libusb 1.0.30-1
libverto 0.3.2-6
libxcrypt 4.5.2-1
libxml2 2.15.3-1
licenses 20240728-1
linux-aarch64 7.1.6-1
linux-api-headers 7.1-1
linux-firmware 20260622-1
linux-firmware-amdgpu 20260622-1
linux-firmware-atheros 20260622-1
linux-firmware-broadcom 20260622-1
linux-firmware-cirrus 20260622-1
linux-firmware-intel 20260622-1
linux-firmware-mediatek 20260622-1
linux-firmware-nvidia 20260622-1
linux-firmware-other 20260622-1
linux-firmware-radeon 20260622-1
linux-firmware-realtek 20260622-1
linux-firmware-whence 20260622-1
lmdb 0.9.35-1
lz4 1:1.10.0-2
mkinitcpio 41-4
mkinitcpio-busybox 1.36.1-1
mpfr 4.2.2-1
nano 9.1-1
ncurses 6.6-2
net-tools 2.10-3
netctl 1.29-2
nettle 4.0-1
nftables 1:1.1.6-3
npth 1.8-1
openssh 10.4p1-3
openssl 3.6.3-1
p11-kit 0.26.4-1
pacman 7.1.0.r9.g54d9411-2
pacman-mirrorlist 20260411-2
pam 1.7.2-2
pambase 20260616-1
pciutils 3.15.0-1
pcre2 10.47-1
pinentry 1.3.3-1
popt 1.19-2
procps-ng 4.0.6-3
psmisc 23.7-2
readline 8.3.003-1
sed 4.10-1
shadow 4.20.0.arch1-1
sqlite 3.53.4-1
systemd 261.2-1
systemd-libs 261.2-1
systemd-resolvconf 261.2-1
systemd-sysvcompat 261.2-1
tar 1.35-2
tpm2-tss 4.1.3-1
tzdata 2026c-1
util-linux 2.42.2-1
util-linux-libs 2.42.2-1
vim 9.2.0849-1
vim-runtime 9.2.0849-1
which 2.25-1
xz 5.8.3-1
zlib 1:1.3.2-3
zstd 1.5.7-3
+31
View File
@@ -0,0 +1,31 @@
# The desktop: KDE Plasma, as SteamOS's desktop mode has it - KWin nested as a client of the app's
# compositor, Plasma's shell on it, and the apps SteamOS puts on its desktop. One package name per
# line; build.sh takes the closure over Arch Linux ARM at build time, minus what the runtime has.
kwin
plasma-workspace
plasma-desktop
plasma-integration
plasma-pa
kscreen
breeze
breeze-gtk
kde-gtk-config
breeze-icons
systemsettings
kde-cli-tools
kinfocenter
dolphin
konsole
kate
ark
gwenview
spectacle
xdg-desktop-portal-kde
xorg-xwayland
qt6-wayland
wayland-utils
noto-fonts
noto-fonts-emoji
xdg-utils
firefox
mpv
-57
View File
@@ -1,57 +0,0 @@
# What the desktop is made of, started once labwc is up. Everything logs into the session log.
# With ~/.droiddeck-desktop-debug present, the panel and the file manager also log what they
# say to the compositor about their windows (shell, layer, output), capped so it stays readable.
run() {
local tag=$1; shift
if [ -f "$HOME/.droiddeck-desktop-debug" ]; then
# Everything it says goes to ~/.cache/droiddeck/<tag>.log; the window-related protocol
# traffic also goes into the session log, capped.
mkdir -p "$HOME/.cache/droiddeck"
WAYLAND_DEBUG=1 "$@" 2>&1 | tee "$HOME/.cache/droiddeck/$tag.log" | awk -v t="[$tag]" '!/^\[[0-9:.]+\] +\{/ || (c<120 && /layer_s|xdg_toplevel|fullscreen|wl_output|xdg_output|configure\(/) {print t, $0; c++; fflush()}' &
else
"$@" 2>&1 | sed "s/^/[$tag] /" &
fi
}
# The output at the app's real size, in case rc.xml's mode did not take.
[ -n "${BL_WIDTH:-}" ] && wlr-randr --output WL-1 --custom-mode "${BL_WIDTH}x${BL_HEIGHT}" 2>&1 | sed 's/^/[wlr-randr] /'
# In debug runs, ground truth on the network from inside the session: name lookup, then a
# fetch over IPv4 and over IPv6, so a browser's "no internet" can be placed.
if [ -f "$HOME/.droiddeck-desktop-debug" ]; then
(
echo "[net] getent: $(getent hosts example.com 2>&1 | head -2 | tr '\n' ' ')"
for f in 4 6; do
echo "[net] curl -$f: $(curl -$f -sS -m 8 -o /dev/null -w '%{http_code} %{remote_ip}' https://example.com 2>&1)"
done
) &
fi
# In debug runs Firefox (started from the panel or the menu, so it inherits this) writes its
# own network log: name lookups, connects, HTTP transactions, the link/offline decisions.
if [ -f "$HOME/.droiddeck-desktop-debug" ]; then
mkdir -p "$HOME/.cache/droiddeck"
export MOZ_LOG="nsHttp:3,nsSocketTransport:3,nsHostResolver:4,NetworkLinkService:5,NetworkConnectivityService:5,nsIOService:5"
export MOZ_LOG_FILE="$HOME/.cache/droiddeck/firefox-net.log"
fi
swaybg -m fill -i /usr/share/backgrounds/steamdeck.png &
# Desktop icons (pcmanfm-qt manages the desktop surface) and the panel with the app menu.
run pcmanfm-qt pcmanfm-qt --desktop --profile lxqt
run lxqt-panel lxqt-panel
/usr/lib/xdg-desktop-portal-wlr >/dev/null 2>&1 &
# The desktop was asked for with Steam in it (the front end's "Steam Desktop UI", Big Picture's
# "Switch to Desktop"): the client's desktop UI, as the menu's Steam entry opens it. A running
# client just gets the request; on a software desktop it goes back to the app as a Steam session.
[ "${BL_DESKTOP_STEAM:-0}" = 1 ] && run steam /usr/local/bin/droiddeck-steam-launch desktop
# Remote runs, for driving the desktop from a debugger: with ~/.droiddeck-remote-run present (only
# the app or root can create it), each script dropped into ~/.cache/droiddeck/run/ is run once,
# inside the session with its environment, its output tagged into the desktop log.
if [ -f "$HOME/.droiddeck-remote-run" ]; then
mkdir -p "$HOME/.cache/droiddeck/run"
(
while sleep 1; do
for f in "$HOME"/.cache/droiddeck/run/*.sh; do
[ -f "$f" ] || continue
mv -f "$f" "$f.running" || continue
( echo "[run] $(basename "$f") started"; bash "$f.running" 2>&1 | sed "s/^/[run] /"; echo "[run] $(basename "$f") exited"; rm -f "$f.running" ) &
done
done
) &
fi
+89 -142
View File
@@ -1,15 +1,24 @@
#!/bin/bash
# The desktop session: labwc nested as a client of the app's compositor, with LXQt's panel and
# file manager started from its autostart, and Xwayland for the X11 programs (the Steam client,
# most emulators). Run by droiddeck-session in place of gamescope for mode "lxqt".
# The desktop session: KDE Plasma, set up as SteamOS's desktop mode - KWin nested as a client of the
# app's compositor, Plasma's shell on it, and Xwayland for the X11 programs (the Steam client, most
# emulators). Run by droiddeck-session in place of gamescope for mode "lxqt" (the mode's name from
# the LXQt desktop this replaced; it is what the app and its preferences use).
# Staged by the app over the desktop package's copy on every launch, so a fix here reaches an
# installed desktop without re-downloading the package.
set -u
export XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=LXQt XDG_SESSION_DESKTOP=lxqt
export XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=KDE XDG_SESSION_DESKTOP=KDE DESKTOP_SESSION=plasma
export KDE_FULL_SESSION=true KDE_SESSION_VERSION=6 KDE_APPLICATIONS_AS_SCOPE=0
# Qt tries Wayland and falls back to X11 (Xwayland): an AppImage that bundles only Qt's xcb
# plugin - melonDS - exits at once on a plain "wayland" ("Could not find the Qt platform plugin").
export QT_QPA_PLATFORM="wayland;xcb" GDK_BACKEND=wayland,x11 SDL_VIDEODRIVER=wayland,x11
export QT_QPA_PLATFORMTHEME=lxqt
unset QT_QPA_PLATFORMTHEME
# KDE's programs log through Qt, which writes to the journal when stderr is not a terminal; there is
# no journal here, so their messages go to the desktop log with everything else.
export QT_FORCE_STDERR_LOGGING=1
# SteamOS's /etc/profile.d/kde.sh.
export MOZ_ENABLE_WAYLAND=1 MOZ_USE_XINPUT2=1
# Konsole's profile starts the login shell, which it finds here.
export SHELL=/bin/bash
# Firefox's child processes sandbox themselves with seccomp and namespaces, neither of which
# behaves under proot: the content process ends up unable to read the font files its parent can,
# reports "no fonts" and dies - the tab crash, with the chrome around it still drawing text.
@@ -21,77 +30,34 @@ export MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1 MOZ_DISABLE_UTILITY_SANDBOX=1
# ("Shared memory PlatformHandle is not safe to map") and dies on signal 11 - every page. Firefox's
# own switch skips the seals. (#280; the line went missing in the fontconfig move of #252.)
export MOZ_SHM_NO_SEALS=1
# pixman composites in software and gives programs shm buffers only, so a Vulkan program on it
# fails at its swapchain. vulkan (or gles2) composite on the GPU and give programs DMA-BUFs, but
# stock wlroots allocates through gbm on a real DRM node and the KGSL stand-in is not one ("unable
# to create allocator"): they need the app's patched wlroots (tools/wlroots), whose Vulkan
# allocator exports the buffers instead. BL_WLR_RENDERER picks; see the fallback at the end.
export WLR_RENDERER=${BL_WLR_RENDERER:-vulkan}
WLROOTS_DIR=/usr/local/lib/droiddeck-wlroots
BASE_LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}
use_renderer() {
export WLR_RENDERER=$1
if [ "$1" != pixman ] && [ -f "$WLROOTS_DIR/libwlroots-0.20.so" ]; then
export LD_LIBRARY_PATH=$WLROOTS_DIR${BASE_LD_LIBRARY_PATH:+:$BASE_LD_LIBRARY_PATH}
elif [ -n "$BASE_LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH=$BASE_LD_LIBRARY_PATH
else
unset LD_LIBRARY_PATH
fi
}
use_renderer "$WLR_RENDERER"
# A GPU renderer that failed to start here is not tried again on every desktop start (each try costs
# up to 20 s): the failure is kept with what it failed on - the renderer, the patched wlroots and the
# Linux driver - so an app update or a different driver retries, and so does picking a renderer
# again in the app's settings (which deletes the file).
FAILED_FILE=$HOME/.droiddeck-renderer-failed
renderer_key() {
echo "$WLR_RENDERER $(md5sum "$WLROOTS_DIR/libwlroots-0.20.so" 2>/dev/null | cut -d' ' -f1) ${BL_VK_DRIVER:-runtime}"
}
if [ "$WLR_RENDERER" != pixman ] && [ "$(cat "$FAILED_FILE" 2>/dev/null)" = "$(renderer_key)" ]; then
echo "== droiddeck-desktop: $WLR_RENDERER failed to start here before; using pixman (choose a renderer in the settings to retry)"
use_renderer pixman
fi
# The desktop's own log, beside the session's, so labwc and the programs on it can be read apart
# KWin composites in software (QPainter): its GPU path allocates through gbm on a DRM render node,
# and the KGSL stand-in is not one. Its windows get shm buffers only, so GL programs on it draw with
# Mesa's software rasterizer, Plasma's own Qt Quick draws with Qt's software renderer (plasmashell
# crashes on llvmpipe here), and a Vulkan program cannot draw at all: games and emulators from the
# menu run through droiddeck-gpu (their own gamescope on the app's compositor), and Steam goes back
# to the app as a Steam session - SteamOS's "Return to Gaming Mode". The session's own GL choice
# (zink on Turnip, for the Steam client) is put back by droiddeck-gpu.
export KWIN_COMPOSE=Q QT_QUICK_BACKEND=software LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe
export DROIDDECK_GLTHREAD=${mesa_glthread:-}
unset MESA_LOADER_DRIVER_OVERRIDE LIBGL_KOPPER_DRI2 mesa_glthread
# The desktop's own log, beside the session's, so KWin and the programs on it can be read apart
# from the session that started them. The session log keeps the milestones either way.
if [ -n "${BL_DEBUG_DIR:-}" ]; then
mkdir -p "$BL_DEBUG_DIR" 2>/dev/null || true
exec >>"$BL_DEBUG_DIR/desktop.log" 2>&1
echo "== droiddeck-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') renderer=$WLR_RENDERER"
echo "== droiddeck-desktop $(date -u '+%Y-%m-%d %H:%M:%S UTC') ${BL_WIDTH:-1280}x${BL_HEIGHT:-720}"
fi
export WLR_BACKENDS=wayland
# The cursor goes to the app's compositor as a wl_pointer cursor surface ("hardware" cursor on the
# wayland backend), which the app draws as its pointer. Drawn into the desktop's own frames instead
# (WLR_NO_HARDWARE_CURSORS=1), it cost every frame a full-screen composite: a software cursor
# rules out direct scan-out, so a full-screen game was never handed to the app as it is.
mkdir -p "$HOME/.config/labwc" "$HOME/.config/lxqt"
# Our defaults for labwc and the panel, refreshed every session. What a user changes in the
# panel's own settings lands in panel.conf and is kept; only rc.xml and autostart are ours.
# The nested output takes the app's surface size; left alone, wlroots' Wayland backend opens
# a 1280x720 window and the whole desktop is upscaled from that.
sed "s/@MODE@/${BL_WIDTH:-1280}x${BL_HEIGHT:-720}/" /etc/xdg/labwc/rc.xml > "$HOME/.config/labwc/rc.xml"
cp -f /etc/xdg/labwc/autostart "$HOME/.config/labwc/autostart"
# panel.conf is the user's once the panel has written it, except the one our first package
# shipped: it never named its panel ([General] panels=), so lxqt-panel built an empty default
# one. That file is replaced; one that names its panels is kept.
if ! grep -q '^panels=' "$HOME/.config/lxqt/panel.conf" 2>/dev/null; then
cp -f /etc/xdg/lxqt/panel.conf "$HOME/.config/lxqt/panel.conf"
fi
[ -f "$HOME/.config/lxqt/lxqt.conf" ] || cp /etc/xdg/lxqt/lxqt.conf "$HOME/.config/lxqt/lxqt.conf"
# pcmanfm-qt paints the desktop; left unconfigured it paints it black, over swaybg's wallpaper.
if [ ! -f "$HOME/.config/pcmanfm-qt/lxqt/settings.conf" ]; then
mkdir -p "$HOME/.config/pcmanfm-qt/lxqt"
printf '[Desktop]\nWallpaper=/usr/share/backgrounds/steamdeck.png\nWallpaperMode=zoom\nBgColor=#1b1030\nShowHidden=false\n' \
> "$HOME/.config/pcmanfm-qt/lxqt/settings.conf"
fi
# The runtime directory outlives a session. lxqt-panel and pcmanfm-qt are single-instance
# programs that leave a lock and a socket there; finding last session's, they decide they are
# already running and exit without a word - a desktop with a wallpaper and nothing on it.
# Only the app's own compositor socket (wayland-0) is kept.
# The runtime directory outlives a session. KDE's daemons are single-instance programs that leave a
# lock and a socket there; finding last session's, they decide they are already running and exit
# without a word. Only the app's own compositor socket (wayland-0) is kept.
find "$XDG_RUNTIME_DIR" -mindepth 1 -maxdepth 1 ! -name 'wayland-0*' ! -name 'keymap.xkb' -exec rm -rf {} + 2>/dev/null
chmod 700 "$XDG_RUNTIME_DIR" 2>/dev/null
# KWin will not start Xwayland when its socket directory is not sticky, as a shared /tmp would be,
# and Plasma's session manager cannot listen at all without the ICE directory, which only root may
# create for it.
mkdir -p /tmp/.X11-unix /tmp/.ICE-unix && chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix 2>/dev/null
# Fontconfig defaults and Android language fallbacks are set up by droiddeck-session before this
# script or any desktop program starts. The generated defaults live in conf.d, leaving local.conf
# available for the user's own final overrides.
# script or any desktop program starts.
# The menu's "Steam" / "Steam Big Picture" entries and one entry per installed game: all of them
# hand off to the app (droiddeck-steam-launch), since the client cannot draw on this desktop.
export BL_DESKTOP=1
@@ -103,81 +69,62 @@ python3 /usr/local/bin/droiddeck-desktop-games 2>&1 | sed 's/^/[games] /'
# given the controller for its next start without waiting for the next desktop.
python3 /usr/local/bin/droiddeck-pad-defaults 2>&1 | sed 's/^/[pads] /'
( while sleep 30; do python3 /usr/local/bin/droiddeck-pad-defaults 2>&1 | sed 's/^/[pads] /'; done ) &
# Games and emulators from the menu run through droiddeck-gpu (their own gamescope on the app's
# compositor) while the desktop is on pixman, where they could not draw with the GPU.
# BL_DESKTOP_GPU=on/off overrides; each entry keeps "Run in a desktop window" either way.
gpu_entries() { python3 /usr/local/bin/droiddeck-desktop-gpu 2>&1 | sed 's/^/[gpu] /'; }
gpu_entries
# ~/.droiddeck-desktop-debug: labwc's own debug log (views and layer surfaces mapping) too. The GPU
# renderers are experimental and always log in full, so a desktop that does not come up says why.
DEBUG=; { [ -f "$HOME/.droiddeck-desktop-debug" ] || [ "$WLR_RENDERER" != pixman ]; } && DEBUG=-d
run_labwc() {
echo "== droiddeck-desktop: labwc ($WLR_RENDERER${LD_LIBRARY_PATH:+, wlroots from $WLROOTS_DIR}) on $WAYLAND_DISPLAY"
# A session bus: the panel's menus, the file manager and the portal all expect one.
if command -v dbus-run-session >/dev/null 2>&1; then
dbus-run-session -- labwc $DEBUG -C "$HOME/.config/labwc"
else
labwc $DEBUG -C "$HOME/.config/labwc"
fi
}
pids_named() {
local p
for p in /proc/[0-9]*; do
[ "$(cat "$p/comm" 2>/dev/null)" = "$1" ] && echo "${p#/proc/}"
done
}
# labwc answers on its own socket (the one beside the app's wayland-0) once its event loop runs; a
# labwc stuck on the GPU never does.
labwc_answers() {
local sock
for sock in "$XDG_RUNTIME_DIR"/wayland-*; do
case $sock in *.lock|*/wayland-0) continue ;; esac
[ -S "$sock" ] || continue
WAYLAND_DISPLAY=${sock##*/} timeout 3 wayland-info >/dev/null 2>&1 && return 0
done
return 1
}
if [ "$WLR_RENDERER" = pixman ]; then
run_labwc
exit $?
# Games and emulators from the menu run through droiddeck-gpu; BL_DESKTOP_GPU=on/off overrides,
# and each entry keeps "Run in a desktop window" either way.
python3 /usr/local/bin/droiddeck-desktop-gpu 2>&1 | sed 's/^/[gpu] /'
# SteamOS's desktop icons: Return to Gaming Mode and Steam, put there once - what the user moves
# or deletes stays that way.
desktop_dir=$(xdg-user-dir DESKTOP 2>/dev/null); [ -n "$desktop_dir" ] && [ "$desktop_dir" != "$HOME" ] || desktop_dir=$HOME/Desktop
if [ ! -e "$HOME/.config/droiddeck-desktop-icons" ]; then
mkdir -p "$desktop_dir" "$HOME/.config"
cp -f /usr/share/applications/droiddeck-return-gaming.desktop "$desktop_dir/Return.desktop" 2>/dev/null
cp -f /usr/share/applications/steamdeck-steam.desktop "$desktop_dir/steam.desktop" 2>/dev/null
chmod +x "$desktop_dir"/*.desktop 2>/dev/null
touch "$HOME/.config/droiddeck-desktop-icons"
fi
# A GPU renderer this device cannot start either ends the desktop at once or leaves it hanging on
# the loading screen. Either way the desktop comes up on pixman instead, and the log says why.
started=$(date +%s)
run_labwc &
labwc_job=$!
answered=
while kill -0 "$labwc_job" 2>/dev/null; do
if labwc_answers; then answered=1; break; fi
[ $(( $(date +%s) - started )) -ge 20 ] && break
sleep 1
done
if [ -n "$answered" ]; then
echo "== droiddeck-desktop: labwc on $WLR_RENDERER is up after $(( $(date +%s) - started )) s"
wait "$labwc_job"
exit $?
# A Return icon still there is kept current with the package's entry (what it runs has changed).
[ -f "$desktop_dir/Return.desktop" ] && cp -f /usr/share/applications/droiddeck-return-gaming.desktop "$desktop_dir/Return.desktop" 2>/dev/null
# Plasma's caches of the menu, the icons and the MIME types, which a package install never ran.
update-mime-database /usr/share/mime >/dev/null 2>&1 &
[ -f /usr/share/icons/hicolor/icon-theme.cache ] || gtk-update-icon-cache -q -t /usr/share/icons/hicolor 2>/dev/null &
[ -f /usr/share/glib-2.0/schemas/gschemas.compiled ] || glib-compile-schemas /usr/share/glib-2.0/schemas 2>/dev/null
# In debug runs Firefox (started from the panel or the menu, so it inherits this) writes its
# own network log: name lookups, connects, HTTP transactions, the link/offline decisions.
if [ -f "$HOME/.droiddeck-desktop-debug" ]; then
mkdir -p "$HOME/.cache/droiddeck"
export MOZ_LOG="nsHttp:3,nsSocketTransport:3,nsHostResolver:4,NetworkLinkService:5,NetworkConnectivityService:5,nsIOService:5"
export MOZ_LOG_FILE="$HOME/.cache/droiddeck/firefox-net.log"
export QT_LOGGING_RULES="kwin_*.debug=true"
fi
if kill -0 "$labwc_job" 2>/dev/null; then
echo "== droiddeck-desktop: labwc on $WLR_RENDERER did not answer in 20 s; stopping it"
kill -TERM $(pids_named labwc) 2>/dev/null
sleep 2
kill -KILL $(pids_named labwc) 2>/dev/null
for prog in lxqt-panel pcmanfm-qt swaybg Xwayland; do kill -KILL $(pids_named "$prog") 2>/dev/null; done
wait "$labwc_job" 2>/dev/null
rc=124
else
wait "$labwc_job"
rc=$?
# Remote runs, for driving the desktop from a debugger: with ~/.droiddeck-remote-run present (only
# the app or root can create it), each script dropped into ~/.cache/droiddeck/run/ is run once,
# inside the session with its environment, its output tagged into the desktop log.
if [ -f "$HOME/.droiddeck-remote-run" ]; then
mkdir -p "$HOME/.cache/droiddeck/run"
(
while sleep 1; do
for f in "$HOME"/.cache/droiddeck/run/*.sh; do
[ -f "$f" ] || continue
mv -f "$f" "$f.running" || continue
( echo "[run] $(basename "$f") started"; WAYLAND_DISPLAY=wayland-1 DISPLAY=:1 bash "$f.running" 2>&1 | sed "s/^/[run] /"; echo "[run] $(basename "$f") exited"; rm -f "$f.running" ) &
done
done
) &
fi
if [ "$rc" -ne 0 ] && [ $(( $(date +%s) - started )) -lt 40 ]; then
echo "== droiddeck-desktop: labwc on $WLR_RENDERER failed at start (exit $rc); starting on pixman instead"
renderer_key > "$FAILED_FILE"
use_renderer pixman
DEBUG=; [ -f "$HOME/.droiddeck-desktop-debug" ] && DEBUG=-d
find "$XDG_RUNTIME_DIR" -mindepth 1 -maxdepth 1 ! -name 'wayland-0*' ! -name 'keymap.xkb' -exec rm -rf {} + 2>/dev/null
gpu_entries
run_labwc
rc=$?
# Plasma as its own login starts it: startplasma-wayland sets up the session's environment and runs
# plasma_session, which starts KWin (through kwin_wayland_wrapper, ours first on PATH) as a client of
# the app's compositor with its own Xwayland, then Plasma's daemons, shell and autostart entries on
# it. The session bus is ours: Plasma, the file manager and the portal all expect one.
echo "== droiddeck-desktop: Plasma on $WAYLAND_DISPLAY"
dbus-run-session -- startplasma-wayland
rc=$?
echo "== droiddeck-desktop: Plasma ended ($rc)"
# Plasma logged out - Log Out, or Return to Gaming Mode, which logs out the same way, so open windows
# are asked to close (and to save) first. As on SteamOS, leaving the desktop goes to Gaming Mode: the
# app is asked for a Steam session, and it ends this one to start it. A desktop the app stops never
# gets here; a Plasma that failed does not count as a logout.
if [ "$rc" -eq 0 ]; then
/usr/local/bin/droiddeck-steam-launch bigpicture
sleep 30
fi
exit $rc
+2 -7
View File
@@ -6,7 +6,7 @@
# a desktop window". Run at every desktop start; copies whose original is gone, or all of them when
# the switch is off, are removed.
#
# BL_DESKTOP_GPU=auto (default: on while the desktop is composited by pixman) | on | off
# BL_DESKTOP_GPU=on (default: the desktop composites in software) | off
import os
import re
@@ -23,12 +23,7 @@ SKIP = re.compile(r"^(steam|droiddeck-game-|droiddeck-steam|steamdeck-)", re.I)
def enabled():
mode = os.environ.get("BL_DESKTOP_GPU", "auto").strip().lower()
if mode in ("on", "1", "yes", "true"):
return True
if mode in ("off", "0", "no", "false"):
return False
return os.environ.get("WLR_RENDERER", "pixman") == "pixman"
return os.environ.get("BL_DESKTOP_GPU", "on").strip().lower() not in ("off", "0", "no", "false")
def main_group(text):
+8 -3
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# Runs a program from the desktop on the GPU: in a gamescope of its own that draws straight into
# the app's compositor (wayland-0), not inside labwc. The desktop is composited by pixman, and
# pixman gives its windows no DMA-BUFs - a Vulkan program there fails at its swapchain
# the app's compositor (wayland-0), not inside the desktop's KWin. KWin composites in software, and
# gives its windows no DMA-BUFs - a Vulkan program there fails at its swapchain
# (VK_ERROR_SURFACE_LOST, RPCS3's error). Here it gets the same path as a program started from the
# app's rail: full screen over the desktop until it exits, then the desktop is back.
# droiddeck-gpu <program> [args...]
@@ -20,10 +20,15 @@ elif [ "${BL_REFRESH:-0}" -gt 0 ]; then
fi
[ "${BL_HDR:-0}" = 1 ] && args+=(--hdr-enabled)
echo "== droiddeck-gpu $(date -u +%H:%M:%S): $* (gamescope ${width}x${height} on wayland-0)"
# gamescope is a client of the app's compositor, beside labwc; the program inside it reaches it
# gamescope is a client of the app's compositor, beside the desktop's KWin; the program inside it reaches it
# through gamescope's own Xwayland, as in a Steam session.
export WAYLAND_DISPLAY=wayland-0
export GDK_BACKEND=x11 QT_QPA_PLATFORM=xcb SDL_VIDEODRIVER=x11
# GL on the GPU again (zink on Turnip, as the session sets it): the desktop itself draws GL in software.
# Qt Quick back on its GPU renderer and KWin's software compositing not passed on, too.
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
# AppImages cannot mount under proot; the menu entries already say so, a hand-typed one may not.
export APPIMAGE_EXTRACT_AND_RUN=1
gamescope "${args[@]}" -- "$@"
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
# KWin for the desktop. Plasma's session (plasma_session) starts KWin through kwin_wayland_wrapper as
# found on PATH; this one, first on it, has KWin draw into the app's compositor (wayland-0) and serve
# its own clients on wayland-1 - by default it takes wayland-0 and finds the app's lock on it - with
# its nested output at the app's surface size (left alone, a 1024x768 window the desktop is scaled
# from), and without the lock screen, which the app's own suspend stands in for. Anything else (a KWin
# started outside DroidDeck's desktop) gets the real wrapper as it is.
if [ "${BL_DESKTOP:-}" = 1 ]; then
set -- --wayland-display wayland-0 --socket wayland-1 --width "${BL_WIDTH:-1280}" --height "${BL_HEIGHT:-720}" --no-lockscreen "$@"
fi
exec /usr/bin/kwin_wayland_wrapper "$@"
-55
View File
@@ -1,55 +0,0 @@
[General]
__userfile__=true
iconTheme=Papirus-Dark
panels=panel1
panels=panel1
[panel1]
alignment=-1
animation-duration=0
background-color=@Variant(\0\0\0\x43\x1\xff\xff\x1c\x1c\x1c\x1c\x1c\x1c\0\0)
background-image=
font-color=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0)
hidable=false
iconSize=28
lineCount=1
lockPanel=false
opacity=90
panelSize=40
plugins=mainmenu, quicklaunch, taskbar, spacer, tray, worldclock, showdesktop
position=Bottom
reserve-space=true
show-delay=0
width=100
width-percent=true
[mainmenu]
type=mainmenu
icon=/usr/share/icons/Papirus-Dark/32x32/apps/steam.svg
showText=false
[quicklaunch]
type=quicklaunch
apps\1\desktop=/usr/share/applications/steamdeck-steam.desktop
apps\2\desktop=/usr/share/applications/steamdeck-bigpicture.desktop
apps\3\desktop=/usr/share/applications/pcmanfm-qt.desktop
apps\4\desktop=/usr/share/applications/qterminal.desktop
apps\size=4
[taskbar]
type=taskbar
buttonStyle=IconAndText
groupingEnabled=false
showGroupOnHover=true
[spacer]
type=spacer
[tray]
type=tray
[worldclock]
type=worldclock
[showdesktop]
type=showdesktop
-31
View File
@@ -1,31 +0,0 @@
<?xml version="1.0"?>
<!-- labwc for a handheld: a plain theme, large enough to hit with a finger, and the keybinds a
desktop expects. Refreshed from here every session. -->
<labwc_config>
<core><gap>0</gap><reuseOutputMode>yes</reuseOutputMode></core>
<theme>
<name>Clearlooks</name>
<cornerRadius>6</cornerRadius>
<font place="ActiveWindow"><name>DejaVu Sans</name><size>11</size></font>
</theme>
<output name="WL-1" mode="@MODE@"/>
<placement><policy>center</policy></placement>
<windowSwitcher><osd show="yes" preview="yes"/></windowSwitcher>
<keyboard>
<keybind key="A-Tab"><action name="NextWindow"/></keybind>
<keybind key="A-F4"><action name="Close"/></keybind>
<keybind key="W-Return"><action name="Execute"><command>qterminal</command></action></keybind>
<keybind key="W-e"><action name="Execute"><command>pcmanfm-qt</command></action></keybind>
<keybind key="W-d"><action name="ToggleMaximize"/></keybind>
</keyboard>
<mouse><doubleClickTime>500</doubleClickTime></mouse>
<!-- Programs opened on the desktop at a size that suits it. melonDS remembers a 1x window for the
front end's full-screen toggle (droiddeck-pad-defaults), too small for a desktop: here it
opens at 800x600, centred (AutoPlace alone kept the top-left corner). Only the desktop reads this file, so the front end is unaffected. -->
<windowRules>
<windowRule title="melonDS*">
<action name="ResizeTo" width="800" height="600"/>
<action name="AutoPlace" policy="center"/>
</windowRule>
</windowRules>
</labwc_config>
@@ -4,7 +4,7 @@
# droiddeck-session desktop the file manager
# droiddeck-session run <path> a Linux program (AppImage, script or ELF)
# droiddeck-session steam [steam-url] the native Steam client
# droiddeck-session lxqt the LXQt/labwc desktop (DroidDeck's desktop package)
# droiddeck-session lxqt the KDE Plasma desktop (DroidDeck's desktop package)
# BL_WIDTH / BL_HEIGHT size the output, BL_FPS limits it, BL_LOG collects everything said here.
set -u
export HOME=${HOME:-/root}
@@ -173,7 +173,7 @@ if [ -z "${BL_INSIDE:-}" ]; then
wayland-info >/dev/null 2>&1 && break
sleep 0.1
done
# The desktop (DroidDeck's hosted package) is its own nested compositor, labwc, drawing straight
# The desktop (DroidDeck's hosted package) is its own nested compositor, KWin, drawing straight
# into the app's: no gamescope in between.
if [ "$mode" = lxqt ]; then
step "starting the desktop"
@@ -4,15 +4,10 @@
# droiddeck-steam-launch desktop [appid|steam-url] Steam's desktop UI, optionally a game
# droiddeck-steam-launch bigpicture [appid|steam-url] Big Picture
#
# On a desktop that draws with the GPU (labwc on vulkan or gles2 - the default since the GPU
# desktop) the client runs right there: a window on the desktop, through the desktop's Xwayland,
# with the same set-up a Steam session gives it (droiddeck-session steam, minus gamescope), and
# its games open in windows of their own. A client already running there gets the request instead
# of a second one being started.
#
# On a software desktop (pixman: the GPU renderers failed on this device) there is no dma-buf, so a
# game - or the client's own Vulkan window - would die at its first frame. There the request goes
# to the app, which ends the desktop and starts a Steam session under gamescope in its place.
# The desktop (KDE Plasma) composites in software and has no dma-buf, so the client's own Vulkan
# window - and any game it starts - would die at its first frame there. The request goes to the app
# instead, which ends the desktop and starts a Steam session under gamescope in its place, as
# SteamOS's desktop hands Steam back to Gaming Mode.
set -u
ui=${1:-desktop}
target=${2:-}
@@ -25,29 +20,7 @@ case $target in
*) url=steam://rungameid/$target ;;
esac
steam_root=${XDG_DATA_HOME:-${HOME:-/root}/.local/share}/Steam
client=$steam_root/steamrtarm64/steam
if [ "${BL_DESKTOP:-}" = 1 ] && [ -n "${WLR_RENDERER:-}" ] && [ "$WLR_RENDERER" != pixman ]; then
log=${BL_DEBUG_DIR:-$HOME/.cache/droiddeck}/steam-desktop.log
mkdir -p "$(dirname "$log")" 2>/dev/null
if pgrep -f 'steamrtarm64/steam( |$)' >/dev/null 2>&1 && [ -x "$client" ]; then
# One client at a time: the running one takes the request (a second start hands its command
# line over and exits). No game asked for = switch it to the UI that was clicked.
[ -n "$url" ] || { [ "$ui" = bigpicture ] && url=steam://open/bigpicture || url=steam://open/main; }
echo "droiddeck-steam-launch: the client is running on the desktop; handing it $url" | tee -a "$log"
exec "$client" "$url"
fi
echo "droiddeck-steam-launch: starting the Steam client on the desktop ($ui${url:+, $url}); log: $log"
# BL_INSIDE: the session script's Steam start-up without gamescope in front of it. The desktop UI
# unless Big Picture was asked for; never Deck mode (its Quick Access Menu needs gamescope).
export BL_INSIDE=1 BL_STEAMDECK=0
if [ "$ui" = desktop ]; then export BL_STEAM_UI=desktop; else unset BL_STEAM_UI; fi
setsid /usr/local/bin/droiddeck-session steam ${url:+"$url"} >>"$log" 2>&1 < /dev/null &
exit 0
fi
# The software desktop, or outside the desktop: ask the app for a Steam session.
# Ask the app for a Steam session.
dir=${BL_LAUNCH_DIR:-}
if [ -z "$dir" ] || [ ! -d "$dir" ]; then
echo "droiddeck-steam-launch: not inside a DroidDeck session (BL_LAUNCH_DIR unset)" >&2
+10 -6
View File
@@ -768,17 +768,17 @@ ONE_PATH(rmdir, REMOVED, IN_DELETE, next_rmdir(path))
ONE_PATH(unlink, REMOVED, IN_DELETE, next_unlink(path))
ONE_PATH(remove, REMOVED, IN_DELETE, next_remove(path))
#define TWO_PATHS(name, gone, event) \
#define TWO_PATHS(name, gone, event, call) \
int name(const char *from, const char *to) { \
NEXT(name); \
struct side a, b; \
int track_a = gone && watching(from) && split(from, &a), track_b = watching(to) && split(to, &b); \
if (!track_a && !track_b) return next_##name(from, to); \
if (!track_a && !track_b) return call(from, to); \
pthread_mutex_lock(&oplock); \
begin(); \
if (track_a) before(&a); \
if (track_b) before(&b); \
int r = next_##name(from, to); \
int r = call(from, to); \
int saved = errno; \
struct expect x[2]; \
int nx = 0; \
@@ -795,9 +795,13 @@ ONE_PATH(remove, REMOVED, IN_DELETE, next_remove(path))
return r; \
}
TWO_PATHS(rename, 1, IN_MOVED_TO)
TWO_PATHS(link, 0, IN_CREATE)
TWO_PATHS(symlink, 0, IN_CREATE)
/* A refused hard link to a lock file is taken as a symlink (links.c). */
int bl_link_lock(const char *oldpath, const char *newpath, int result) __attribute__((visibility("hidden")));
static int link_or_lock(const char *from, const char *to) { return bl_link_lock(from, to, next_link(from, to)); }
TWO_PATHS(rename, 1, IN_MOVED_TO, next_rename)
TWO_PATHS(link, 0, IN_CREATE, link_or_lock)
TWO_PATHS(symlink, 0, IN_CREATE, next_symlink)
#else
+56
View File
@@ -0,0 +1,56 @@
/*
* Lock files taken by hard link, which Android denies apps.
*
* libICE and libXau lock an authority file the classic way: create "<file>-c", then link() it to
* "<file>-l" - the link either appears or fails because the other holder's is there. Android's
* SELinux policy refuses hard links in an app's data, so the link fails for everyone, the lock is
* never taken, and Plasma's session manager gives up at "Could not lock ICEAuthority file". With
* no session manager there is no Plasma desktop.
*
* Only that convention is answered here: when the real link is refused and the new name ends in
* "-l", a symlink stands in. Creating a symlink fails on an existing name just as a link does, so
* the lock excludes as before, and the holder removes both names when it is done. Every other
* link keeps the real answer: a program that links a file into place and then deletes the
* original would be left with a dangling symlink.
*/
#define _GNU_SOURCE
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
static int refused(int error) { return error == EPERM || error == EACCES; }
static int lock_name(const char *path) {
size_t n = path ? strlen(path) : 0;
return n > 2 && strcmp(path + n - 2, "-l") == 0;
}
/* The answer to link(oldpath, newpath), given the real call's: a refused lock link becomes a symlink. */
__attribute__((visibility("hidden"))) int bl_link_lock(const char *oldpath, const char *newpath, int result) {
/* libc's own symlink: dircache.c's wrapper may be holding its lock around this call. */
static int (*real_symlink)(const char *, const char *);
if (result == 0 || !refused(errno) || !lock_name(newpath)) return result;
if (real_symlink == NULL) real_symlink = dlsym(RTLD_NEXT, "symlink");
return real_symlink(oldpath, newpath);
}
/* 64-bit builds wrap link() in dircache.c, which hands its result to bl_link_lock. */
#if __SIZEOF_POINTER__ != 8
int link(const char *oldpath, const char *newpath) {
static int (*real_link)(const char *, const char *);
if (real_link == NULL) real_link = dlsym(RTLD_NEXT, "link");
return bl_link_lock(oldpath, newpath, real_link(oldpath, newpath));
}
#endif
int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags) {
static int (*real_linkat)(int, const char *, int, const char *, int);
if (real_linkat == NULL) real_linkat = dlsym(RTLD_NEXT, "linkat");
int result = real_linkat(olddirfd, oldpath, newdirfd, newpath, flags);
/* A relative old name would resolve against the new name's directory as a symlink's target. */
if (result != 0 && refused(errno) && lock_name(newpath) && oldpath[0] == '/' && flags == 0)
return symlinkat(oldpath, newdirfd, newpath);
return result;
}
+1 -1
View File
@@ -288,7 +288,7 @@ def main_commit(release: dict) -> str | None:
def stable_app_release(releases: list[dict]) -> dict | None:
"""The newest published app release. The repo also publishes gamescope and wlroots
"""The newest published app release. The repo also publishes gamescope and desktop-package
releases that GitHub may mark latest, so an app release is one shipping DroidDeck-<tag>.apk."""
apps = [
r for r in releases
-58
View File
@@ -1,58 +0,0 @@
#!/usr/bin/bash
# Runs INSIDE an Arch Linux ARM container (menci/archlinuxarm:base-devel) on an arm64 runner.
# Builds Arch's own wlroots0.20 package - the wlroots the desktop package's labwc links - with the
# patches in ./patches added, keeps only the library, and packs it as wlroots.tzst
# (usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so) for the apk to stage. The desktop launcher
# puts that directory first on labwc's library path for the GPU renderers only.
set -euxo pipefail
VERSION=${WLROOTS_VERSION:-0.20.2}
WORK=/work
cd "$WORK"
# Same container workarounds as tools/gamescope/build-in-arch.sh.
grep -q '^DisableSandbox' /etc/pacman.conf || sed -i 's/^\[options\]/[options]\nDisableSandbox/' /etc/pacman.conf
{ for m in https://ca.us.mirror.archlinuxarm.org https://fl.us.mirror.archlinuxarm.org https://de3.mirror.archlinuxarm.org https://nl.mirror.archlinuxarm.org; do echo "Server = $m/\$arch/\$repo"; done; cat /etc/pacman.d/mirrorlist; } > /etc/pacman.d/mirrorlist.new
mv /etc/pacman.d/mirrorlist.new /etc/pacman.d/mirrorlist
pacman -Syu --noconfirm --needed git sudo zstd binutils
id builder >/dev/null 2>&1 || useradd -m builder
echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder
rm -rf pkg && mkdir pkg && cp -r tools/wlroots/patches pkg/ && chown -R builder pkg
sudo -u builder bash -c "
set -euxo pipefail
cd pkg
for rel in 1 2 3 4; do
if git clone -q --depth 1 --branch ${VERSION}-\$rel https://gitlab.archlinux.org/archlinux/packaging/packages/wlroots0.20.git arch 2>/dev/null; then break; fi
done
test -f arch/PKGBUILD
cd arch
grep -q '^pkgver=${VERSION}$' PKGBUILD
cp ../patches/*.patch .
PATCHES=\$(ls *.patch | sort)
{ echo; echo 'source+=('; for p in \$PATCHES; do echo \" \$p\"; done; echo ')'; for p in \$PATCHES; do echo \"sha256sums+=('SKIP')\"; done; } >> PKGBUILD
# Arch's PKGBUILD has no prepare(); ours applies the patches to the checkout.
cat >> PKGBUILD <<'PREP'
prepare() {
cd \"\$srcdir/\$pkgname\"
for p in \$(ls \"\$srcdir\"/*.patch | sort); do
echo \"applying \$(basename \"\$p\")\"
patch -p1 --no-backup-if-mismatch < \"\$p\"
done
}
PREP
makepkg -A -s --noconfirm --skipchecksums --skippgpcheck
ls -l *.pkg.tar.*
"
cd "$WORK"
rm -rf out && mkdir -p out/usr/local/lib/droiddeck-wlroots
PKG=$(ls pkg/arch/wlroots0.20-*.pkg.tar.* | grep -v -- '-debug-' | head -1)
mkdir -p x && tar --use-compress-program=unzstd -xf "$PKG" -C x
SO=x/usr/lib/libwlroots-0.20.so
test -f "$SO"
cp -L "$SO" out/usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so
strip --strip-unneeded out/usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so || true
# The patch is in: the allocator's symbol and its log line.
grep -q 'Created Vulkan DMA-BUF allocator' out/usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so
readelf -d out/usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so | grep -E 'NEEDED|SONAME'
(cd out && tar --use-compress-program='zstd -19' -cf ../wlroots.tzst usr)
sha256sum wlroots.tzst | tee wlroots.tzst.sha256
ls -l wlroots.tzst out/usr/local/lib/droiddeck-wlroots/
@@ -1,549 +0,0 @@
diff --git a/include/render/vulkan.h b/include/render/vulkan.h
index f96619f2..9f945f87 100644
--- a/include/render/vulkan.h
+++ b/include/render/vulkan.h
@@ -461,6 +461,10 @@ struct wlr_vk_descriptor_pool *vulkan_alloc_blend_ds(
// Frees the given descriptor set from the pool its pool.
void vulkan_free_ds(struct wlr_vk_renderer *renderer,
struct wlr_vk_descriptor_pool *pool, VkDescriptorSet ds);
+// A DMA-BUF allocator on a Vulkan device of its own, for a DRM fd gbm cannot use (see
+// render/vulkan/allocator.c).
+struct wlr_allocator *vulkan_allocator_create(int drm_fd);
+
struct wlr_vk_format_props *vulkan_format_props_from_drm(
struct wlr_vk_device *dev, uint32_t drm_format);
struct wlr_vk_renderer *vulkan_get_renderer(struct wlr_renderer *r);
diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c
index b7dbf3d6..f3162d47 100644
--- a/render/allocator/allocator.c
+++ b/render/allocator/allocator.c
@@ -1,6 +1,7 @@
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <wlr/backend.h>
#include <wlr/config.h>
@@ -13,6 +14,10 @@
#include "render/allocator/shm.h"
#include "render/wlr_renderer.h"
+#if WLR_HAS_VULKAN_RENDERER
+#include "render/vulkan.h"
+#endif
+
#if WLR_HAS_GBM_ALLOCATOR
#include "render/allocator/gbm.h"
#endif
@@ -32,6 +37,29 @@ void wlr_allocator_init(struct wlr_allocator *alloc,
wl_signal_init(&alloc->events.destroy);
}
+/* Whether the fd is a DRM device at all. The GPU node on Android (KGSL, for Adreno) stands in for
+ * a render node so that Vulkan and libdrm's device lookup can name the GPU, but it answers no DRM
+ * ioctl: drmIsMaster() takes that for mastership, and gbm cannot allocate on it. */
+static bool is_drm_device(int fd) {
+ drmVersion *version = drmGetVersion(fd);
+ if (version == NULL) {
+ return false;
+ }
+ drmFreeVersion(version);
+ return true;
+}
+
+#if WLR_HAS_VULKAN_RENDERER
+static struct wlr_allocator *try_vulkan_allocator(int drm_fd) {
+ wlr_log(WLR_DEBUG, "Trying to create Vulkan allocator");
+ struct wlr_allocator *alloc = vulkan_allocator_create(drm_fd);
+ if (alloc == NULL) {
+ wlr_log(WLR_DEBUG, "Failed to create Vulkan allocator");
+ }
+ return alloc;
+}
+#endif
+
/* Re-open the DRM node to avoid GEM handle ref'counting issues. See:
* https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
*/
@@ -109,8 +137,20 @@ struct wlr_allocator *wlr_allocator_autocreate(struct wlr_backend *backend,
struct wlr_allocator *alloc = NULL;
uint32_t gbm_caps = WLR_BUFFER_CAP_DMABUF;
+ bool drm_device = drm_fd >= 0 && is_drm_device(drm_fd);
+ const char *forced = getenv("WLR_ALLOCATOR");
+ bool vk_first = forced != NULL && strcmp(forced, "vulkan") == 0;
+#if WLR_HAS_VULKAN_RENDERER
+ // A GPU node that is not a DRM device (and WLR_ALLOCATOR=vulkan): buffers come from Vulkan.
+ if ((backend_caps & gbm_caps) && (renderer_caps & gbm_caps) && drm_fd >= 0
+ && (vk_first || !drm_device)) {
+ if ((alloc = try_vulkan_allocator(drm_fd)) != NULL) {
+ return alloc;
+ }
+ }
+#endif
if ((backend_caps & gbm_caps) && (renderer_caps & gbm_caps)
- && drm_fd >= 0) {
+ && drm_fd >= 0 && drm_device) {
#if WLR_HAS_GBM_ALLOCATOR
wlr_log(WLR_DEBUG, "Trying to create gbm allocator");
int gbm_fd = reopen_drm_node(drm_fd, true);
@@ -124,6 +164,11 @@ struct wlr_allocator *wlr_allocator_autocreate(struct wlr_backend *backend,
wlr_log(WLR_DEBUG, "Failed to create gbm allocator");
#else
wlr_log(WLR_DEBUG, "Skipping gbm allocator: disabled at compile-time");
+#endif
+#if WLR_HAS_VULKAN_RENDERER
+ if (!vk_first && (alloc = try_vulkan_allocator(drm_fd)) != NULL) {
+ return alloc;
+ }
#endif
}
@@ -138,7 +183,7 @@ struct wlr_allocator *wlr_allocator_autocreate(struct wlr_backend *backend,
uint32_t drm_caps = WLR_BUFFER_CAP_DMABUF | WLR_BUFFER_CAP_DATA_PTR;
if ((backend_caps & drm_caps) && (renderer_caps & drm_caps)
- && drm_fd >= 0 && drmIsMaster(drm_fd)) {
+ && drm_fd >= 0 && drm_device && drmIsMaster(drm_fd)) {
wlr_log(WLR_DEBUG, "Trying to create drm dumb allocator");
int dumb_fd = reopen_drm_node(drm_fd, false);
if (dumb_fd < 0) {
diff --git a/render/vulkan/allocator.c b/render/vulkan/allocator.c
new file mode 100644
index 00000000..4c00d361
--- /dev/null
+++ b/render/vulkan/allocator.c
@@ -0,0 +1,392 @@
+#include <assert.h>
+#include <drm_fourcc.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <wlr/interfaces/wlr_buffer.h>
+#include <wlr/render/allocator.h>
+#include <wlr/render/drm_format_set.h>
+#include <wlr/util/log.h>
+#include "render/vulkan.h"
+
+/*
+ * DMA-BUFs allocated by Vulkan, for a GPU whose device node is not a DRM device and so cannot be
+ * given to gbm - Adreno through KGSL on Android, where the node Turnip opens stands in for a
+ * render node. Each buffer is an exportable image with an explicit DRM format modifier, created
+ * the way vulkan_import_dmabuf() imports one for rendering, so the renderer and the parent
+ * compositor see the same layout. The device is our own, on the physical device the DRM fd names:
+ * this works under the gles2 renderer too, as long as its EGL can import the result.
+ */
+
+struct wlr_vk_allocator {
+ struct wlr_allocator base;
+ struct wlr_vk_device *dev;
+ PFN_vkGetMemoryFdKHR get_memory_fd;
+ PFN_vkGetImageDrmFormatModifierPropertiesEXT get_modifier_props;
+ struct wl_list buffers; // wlr_vk_allocator_buffer.link
+};
+
+struct wlr_vk_allocator_buffer {
+ struct wlr_buffer base;
+ struct wlr_vk_allocator *alloc; // NULL once the allocator is gone
+ struct wl_list link;
+ VkImage image;
+ VkDeviceMemory memory;
+ struct wlr_dmabuf_attributes dmabuf;
+};
+
+static const struct wlr_buffer_impl buffer_impl;
+
+static struct wlr_vk_allocator_buffer *buffer_from_buffer(struct wlr_buffer *wlr_buffer) {
+ assert(wlr_buffer->impl == &buffer_impl);
+ struct wlr_vk_allocator_buffer *buffer = wl_container_of(wlr_buffer, buffer, base);
+ return buffer;
+}
+
+static void buffer_release_vk(struct wlr_vk_allocator_buffer *buffer) {
+ if (buffer->alloc == NULL) {
+ return;
+ }
+ VkDevice dev = buffer->alloc->dev->dev;
+ // The exported DMA-BUF keeps the memory alive for whoever imported it.
+ if (buffer->image != VK_NULL_HANDLE) {
+ vkDestroyImage(dev, buffer->image, NULL);
+ }
+ if (buffer->memory != VK_NULL_HANDLE) {
+ vkFreeMemory(dev, buffer->memory, NULL);
+ }
+ buffer->image = VK_NULL_HANDLE;
+ buffer->memory = VK_NULL_HANDLE;
+ wl_list_remove(&buffer->link);
+ buffer->alloc = NULL;
+}
+
+static void buffer_destroy(struct wlr_buffer *wlr_buffer) {
+ struct wlr_vk_allocator_buffer *buffer = buffer_from_buffer(wlr_buffer);
+ wlr_buffer_finish(wlr_buffer);
+ buffer_release_vk(buffer);
+ wlr_dmabuf_attributes_finish(&buffer->dmabuf);
+ free(buffer);
+}
+
+static bool buffer_get_dmabuf(struct wlr_buffer *wlr_buffer,
+ struct wlr_dmabuf_attributes *dmabuf) {
+ struct wlr_vk_allocator_buffer *buffer = buffer_from_buffer(wlr_buffer);
+ *dmabuf = buffer->dmabuf;
+ return true;
+}
+
+static const struct wlr_buffer_impl buffer_impl = {
+ .destroy = buffer_destroy,
+ .get_dmabuf = buffer_get_dmabuf,
+};
+
+// One vkCreateImage over the modifiers that share the same mutable-sRGB setting, the one thing
+// in the import that depends on the modifier. The driver picks the modifier.
+static VkImage create_image(struct wlr_vk_allocator *alloc,
+ const struct wlr_vk_format_props *props, int width, int height,
+ const uint64_t *mods, uint32_t mods_len, bool mutable_srgb) {
+ VkImageCreateInfo img_info = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+ .imageType = VK_IMAGE_TYPE_2D,
+ .format = props->format.vk,
+ .mipLevels = 1,
+ .arrayLayers = 1,
+ .samples = VK_SAMPLE_COUNT_1_BIT,
+ .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
+ .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+ .extent = (VkExtent3D){ width, height, 1 },
+ .usage = vulkan_render_usage,
+ .tiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT,
+ };
+ if (mutable_srgb) {
+ img_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
+ }
+
+ VkExternalMemoryImageCreateInfo eimg = {
+ .sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
+ .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
+ };
+ img_info.pNext = &eimg;
+
+ VkImageDrmFormatModifierListCreateInfoEXT mod_list = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT,
+ .drmFormatModifierCount = mods_len,
+ .pDrmFormatModifiers = mods,
+ };
+ eimg.pNext = &mod_list;
+
+ VkFormat view_formats[] = {
+ props->format.vk,
+ props->format.vk_srgb,
+ };
+ VkImageFormatListCreateInfoKHR list_info = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR,
+ .pViewFormats = view_formats,
+ .viewFormatCount = sizeof(view_formats) / sizeof(view_formats[0]),
+ };
+ if (mutable_srgb) {
+ mod_list.pNext = &list_info;
+ }
+
+ VkImage image = VK_NULL_HANDLE;
+ VkResult res = vkCreateImage(alloc->dev->dev, &img_info, NULL, &image);
+ if (res != VK_SUCCESS) {
+ wlr_vk_error("vkCreateImage", res);
+ return VK_NULL_HANDLE;
+ }
+ return image;
+}
+
+static struct wlr_buffer *allocator_create_buffer(struct wlr_allocator *wlr_allocator,
+ int width, int height, const struct wlr_drm_format *format) {
+ struct wlr_vk_allocator *alloc = wl_container_of(wlr_allocator, alloc, base);
+ VkDevice dev = alloc->dev->dev;
+
+ const struct wlr_vk_format_props *props =
+ vulkan_format_props_from_drm(alloc->dev, format->format);
+ if (props == NULL) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: format 0x%08"PRIX32" not supported",
+ format->format);
+ return NULL;
+ }
+
+ // The modifiers asked for that this device can render to at this size, split by whether the
+ // import will make the image mutable-format. INVALID (implicit) is not something Vulkan can
+ // allocate; LINEAR stands in for it when it is all there is.
+ uint64_t *mutable_mods = calloc(format->len + 1, sizeof(uint64_t));
+ uint64_t *plain_mods = calloc(format->len + 1, sizeof(uint64_t));
+ if (mutable_mods == NULL || plain_mods == NULL) {
+ free(mutable_mods);
+ free(plain_mods);
+ return NULL;
+ }
+ uint32_t mutable_len = 0, plain_len = 0;
+ bool implicit_only = format->len > 0;
+ for (size_t i = 0; i <= format->len; i++) {
+ uint64_t mod;
+ if (i < format->len) {
+ mod = format->modifiers[i];
+ if (mod == DRM_FORMAT_MOD_INVALID) {
+ continue;
+ }
+ implicit_only = false;
+ } else if (implicit_only) {
+ mod = DRM_FORMAT_MOD_LINEAR;
+ } else {
+ break;
+ }
+ const struct wlr_vk_format_modifier_props *mp =
+ vulkan_format_props_find_modifier(props, mod, true);
+ if (mp == NULL || (uint32_t)width > mp->max_extent.width ||
+ (uint32_t)height > mp->max_extent.height) {
+ continue;
+ }
+ if (mp->has_mutable_srgb) {
+ mutable_mods[mutable_len++] = mod;
+ } else {
+ plain_mods[plain_len++] = mod;
+ }
+ }
+
+ VkImage image = VK_NULL_HANDLE;
+ if (mutable_len > 0) {
+ image = create_image(alloc, props, width, height, mutable_mods, mutable_len, true);
+ }
+ if (image == VK_NULL_HANDLE && plain_len > 0) {
+ image = create_image(alloc, props, width, height, plain_mods, plain_len, false);
+ }
+ free(mutable_mods);
+ free(plain_mods);
+ if (image == VK_NULL_HANDLE) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: no usable modifier for %dx%d format 0x%08"PRIX32,
+ width, height, format->format);
+ return NULL;
+ }
+
+ struct wlr_vk_allocator_buffer *buffer = calloc(1, sizeof(*buffer));
+ if (buffer == NULL) {
+ vkDestroyImage(dev, image, NULL);
+ return NULL;
+ }
+ wlr_buffer_init(&buffer->base, &buffer_impl, width, height);
+ buffer->alloc = alloc;
+ buffer->image = image;
+ wl_list_insert(&alloc->buffers, &buffer->link);
+ for (int i = 0; i < WLR_DMABUF_MAX_PLANES; i++) {
+ buffer->dmabuf.fd[i] = -1;
+ }
+
+ VkMemoryRequirements reqs;
+ vkGetImageMemoryRequirements(dev, image, &reqs);
+ int mem_type = vulkan_find_mem_type(alloc->dev,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, reqs.memoryTypeBits);
+ if (mem_type < 0) {
+ mem_type = vulkan_find_mem_type(alloc->dev, 0, reqs.memoryTypeBits);
+ }
+ if (mem_type < 0) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: no memory type for the image");
+ goto error;
+ }
+
+ VkMemoryDedicatedAllocateInfo dedicated = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
+ .image = image,
+ };
+ VkExportMemoryAllocateInfo export = {
+ .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
+ .pNext = &dedicated,
+ .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
+ };
+ VkMemoryAllocateInfo mem_info = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ .pNext = &export,
+ .allocationSize = reqs.size,
+ .memoryTypeIndex = mem_type,
+ };
+ VkResult res = vkAllocateMemory(dev, &mem_info, NULL, &buffer->memory);
+ if (res != VK_SUCCESS) {
+ wlr_vk_error("vkAllocateMemory", res);
+ goto error;
+ }
+ res = vkBindImageMemory(dev, image, buffer->memory, 0);
+ if (res != VK_SUCCESS) {
+ wlr_vk_error("vkBindImageMemory", res);
+ goto error;
+ }
+
+ VkImageDrmFormatModifierPropertiesEXT mod_props = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT,
+ };
+ res = alloc->get_modifier_props(dev, image, &mod_props);
+ if (res != VK_SUCCESS) {
+ wlr_vk_error("vkGetImageDrmFormatModifierPropertiesEXT", res);
+ goto error;
+ }
+ const struct wlr_vk_format_modifier_props *mp =
+ vulkan_format_props_find_modifier(props, mod_props.drmFormatModifier, true);
+ if (mp == NULL) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: driver chose modifier 0x%016"PRIX64
+ " which it cannot render to", mod_props.drmFormatModifier);
+ goto error;
+ }
+ uint32_t n_planes = mp->props.drmFormatModifierPlaneCount;
+ if (n_planes == 0 || n_planes > WLR_DMABUF_MAX_PLANES) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: %"PRIu32" memory planes", n_planes);
+ goto error;
+ }
+
+ VkMemoryGetFdInfoKHR fd_info = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
+ .memory = buffer->memory,
+ .handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
+ };
+ int fd = -1;
+ res = alloc->get_memory_fd(dev, &fd_info, &fd);
+ if (res != VK_SUCCESS || fd < 0) {
+ wlr_vk_error("vkGetMemoryFdKHR", res);
+ goto error;
+ }
+
+ buffer->dmabuf = (struct wlr_dmabuf_attributes){
+ .width = width,
+ .height = height,
+ .format = format->format,
+ .modifier = mod_props.drmFormatModifier,
+ .n_planes = n_planes,
+ };
+ for (int i = 0; i < WLR_DMABUF_MAX_PLANES; i++) {
+ buffer->dmabuf.fd[i] = -1;
+ }
+ static const VkImageAspectFlagBits plane_aspects[] = {
+ VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT,
+ };
+ for (uint32_t i = 0; i < n_planes; i++) {
+ VkImageSubresource sub = { .aspectMask = plane_aspects[i] };
+ VkSubresourceLayout layout;
+ vkGetImageSubresourceLayout(dev, image, &sub, &layout);
+ buffer->dmabuf.offset[i] = layout.offset;
+ buffer->dmabuf.stride[i] = layout.rowPitch;
+ // Every plane lives in the one allocation; each gets its own fd, as
+ // wlr_dmabuf_attributes_finish() closes them one by one.
+ buffer->dmabuf.fd[i] = i == 0 ? fd : fcntl(fd, F_DUPFD_CLOEXEC, 0);
+ if (buffer->dmabuf.fd[i] < 0) {
+ wlr_log_errno(WLR_ERROR, "Vulkan allocator: dup failed");
+ goto error;
+ }
+ }
+
+ wlr_log(WLR_DEBUG, "Vulkan allocator: %dx%d format 0x%08"PRIX32" modifier 0x%016"PRIX64
+ ", %"PRIu32" plane(s)", width, height, format->format, mod_props.drmFormatModifier, n_planes);
+ return &buffer->base;
+
+error:
+ buffer_destroy(&buffer->base);
+ return NULL;
+}
+
+static void allocator_destroy(struct wlr_allocator *wlr_allocator) {
+ struct wlr_vk_allocator *alloc = wl_container_of(wlr_allocator, alloc, base);
+ // Buffers may outlive their allocator; their DMA-BUF fds stay valid without the device.
+ struct wlr_vk_allocator_buffer *buffer, *tmp;
+ wl_list_for_each_safe(buffer, tmp, &alloc->buffers, link) {
+ buffer_release_vk(buffer);
+ }
+ struct wlr_vk_instance *ini = alloc->dev->instance;
+ vulkan_device_destroy(alloc->dev);
+ vulkan_instance_destroy(ini);
+ free(alloc);
+}
+
+static const struct wlr_allocator_interface allocator_impl = {
+ .destroy = allocator_destroy,
+ .create_buffer = allocator_create_buffer,
+};
+
+struct wlr_allocator *vulkan_allocator_create(int drm_fd) {
+ struct wlr_vk_instance *ini = vulkan_instance_create(false);
+ if (ini == NULL) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: could not create an instance");
+ return NULL;
+ }
+ VkPhysicalDevice phdev = vulkan_find_drm_phdev(ini, drm_fd);
+ if (phdev == VK_NULL_HANDLE) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: no Vulkan device for the DRM fd");
+ vulkan_instance_destroy(ini);
+ return NULL;
+ }
+ struct wlr_vk_device *dev = vulkan_device_create(ini, phdev);
+ if (dev == NULL) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: could not create a device");
+ vulkan_instance_destroy(ini);
+ return NULL;
+ }
+
+ struct wlr_vk_allocator *alloc = calloc(1, sizeof(*alloc));
+ if (alloc == NULL) {
+ vulkan_device_destroy(dev);
+ vulkan_instance_destroy(ini);
+ return NULL;
+ }
+ alloc->dev = dev;
+ wl_list_init(&alloc->buffers);
+ alloc->get_memory_fd = (PFN_vkGetMemoryFdKHR)
+ vkGetDeviceProcAddr(dev->dev, "vkGetMemoryFdKHR");
+ alloc->get_modifier_props = (PFN_vkGetImageDrmFormatModifierPropertiesEXT)
+ vkGetDeviceProcAddr(dev->dev, "vkGetImageDrmFormatModifierPropertiesEXT");
+ if (alloc->get_memory_fd == NULL || alloc->get_modifier_props == NULL) {
+ wlr_log(WLR_ERROR, "Vulkan allocator: the device lacks DMA-BUF export");
+ free(alloc);
+ vulkan_device_destroy(dev);
+ vulkan_instance_destroy(ini);
+ return NULL;
+ }
+
+ wlr_allocator_init(&alloc->base, &allocator_impl, WLR_BUFFER_CAP_DMABUF);
+ wlr_log(WLR_INFO, "Created Vulkan DMA-BUF allocator");
+ return &alloc->base;
+}
diff --git a/render/vulkan/meson.build b/render/vulkan/meson.build
index 36a822f9..abeb5337 100644
--- a/render/vulkan/meson.build
+++ b/render/vulkan/meson.build
@@ -37,6 +37,7 @@ glslang_version_info = run_command(glslang, '--version', check: true).stdout()
glslang_version = glslang_version_info.split('\n')[0].split(':')[-1]
wlr_files += files(
+ 'allocator.c',
'pass.c',
'renderer.c',
'texture.c',
diff --git a/types/wlr_linux_dmabuf_v1.c b/types/wlr_linux_dmabuf_v1.c
index 3165e880..a7fe060c 100644
--- a/types/wlr_linux_dmabuf_v1.c
+++ b/types/wlr_linux_dmabuf_v1.c
@@ -901,11 +901,22 @@ static bool set_default_feedback(struct wlr_linux_dmabuf_v1 *linux_dmabuf,
if (device->available_nodes & (1 << DRM_NODE_RENDER)) {
const char *name = device->nodes[DRM_NODE_RENDER];
main_device_fd = open(name, O_RDWR | O_CLOEXEC);
- drmFreeDevice(&device);
if (main_device_fd < 0) {
wlr_log_errno(WLR_ERROR, "Failed to open DRM device %s", name);
+ drmFreeDevice(&device);
goto error_compiled;
}
+ // A GPU node that stands in for a render node without being a DRM device (KGSL on
+ // Android) cannot import a buffer as a GEM handle; every client's would be refused.
+ drmVersion *version = drmGetVersion(main_device_fd);
+ if (version == NULL) {
+ wlr_log(WLR_INFO, "%s is not a DRM device, skipping DMA-BUF import checks", name);
+ close(main_device_fd);
+ main_device_fd = -1;
+ } else {
+ drmFreeVersion(version);
+ }
+ drmFreeDevice(&device);
} else {
// Likely a split display/render setup. Unfortunately we have no way to
// get back the proper render node used by the renderer under-the-hood.
-2
View File
@@ -1,2 +0,0 @@
WLROOTS_TAG=wlroots-0.20.2-p1
WLROOTS_SHA256=b4dcb08b46e69dbfaa004597844e843cdf938591ba5dbc7079b91626cdd4591d