Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Default project license: GPL-2.0-or-later (LICENSE).
Omarchy shell: David Heinemeier Hansson, MIT (desktop/shell/LICENSE).
m1n1: boot/m1n1/LICENSE.
PongoOS and its components (pongo.bin, built by OrchardLinux/orchard): boot/pongo/LICENSE.md.
Vulkan driver for the Apple A10 GPU (vulkan-powervr-orchard): Mesa, MIT; built from https://github.com/OrchardLinux/mesa, license in the package.
Vulkan driver for the Apple PowerVR GPUs (vulkan-powervr-orchard): Mesa, MIT; built from https://github.com/OrchardLinux/mesa, license in the package. The GPU probe in the same package is this repository's, MIT.
libva-v4l2_request (desktop/arm64/inputs/libva-v4l2_request-*.tar.gz): Ondrej Jirman and contributors, GPL-3.0; COPYING in the archive and the package.
Omacalc package licenses: embedded usr/share/licenses/omacalc/LICENSE and OFL.txt in desktop/arm64/inputs/omacalc.pkg.tar.zst.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ anything. Today the iPad 6 Wi-Fi (`iPad7,5`, J71b) is supported; the others
are experimental. See orchard's
[devices](https://github.com/OrchardLinux/orchard/tree/main/devices).

The desktop finds the hardware at login. On the iPad 6 and iPad 7 (A10) it
draws on the GPU, and Firefox plays H.264 video, YouTube included, through the
hardware video decoder. On every other device it draws in software, as before.
To start an A10 device on the software desktop once, boot with
`modprobe.blacklist=powervr`.
The desktop finds the hardware at login. Where orchard's kernel runs the GPU
(the iPad 6 and iPad 7, A10; the iPad 5, A9, once its GPU support has landed
in orchard and in the Mesa fork), the login first draws one test frame on the
GPU, within 10 s at most. If that works the desktop draws on the GPU; if not,
and on every other device, it draws in software, as before.
`journalctl -t omarchy-gpu-probe` shows what a login decided and why. To start
such a device on the software desktop once, boot with
`modprobe.blacklist=powervr`. On the iPad 6 and iPad 7 Firefox plays H.264
video, YouTube included, through the hardware video decoder.

Firefox reaches the video decoder only with its media decoding sandbox
switched off (`MOZ_DISABLE_RDD_SANDBOX=1`, set by the login session on those
Expand Down
6 changes: 3 additions & 3 deletions desktop/arm64/sources.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"mesa": {
"version": "27.0.0-devel",
"commit": "7446eebebec5722cbdc6d3670e834c08d6ea9607",
"commit": "2c1aa767d8d8836739260177144716271e05f686",
"urls": [
"https://github.com/OrchardLinux/mesa/archive/7446eebebec5722cbdc6d3670e834c08d6ea9607.tar.gz"
"https://github.com/OrchardLinux/mesa/archive/2c1aa767d8d8836739260177144716271e05f686.tar.gz"
],
"sha256": "7aa55f09aae7be33399136311a5b507c0846fb777dc6a1d36ded66d7546480f2"
"sha256": "e6a6481bcbe736342146b8000725e739ebf389384d3a9fe3ae36def2e4c6cd2a"
}
}
2 changes: 1 addition & 1 deletion desktop/build
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FILES = {
'omafox_xpi': INPUTS / '@omafox.xpi',
'libva_v4l2_request_source': INPUTS / 'libva-v4l2_request-1.2-2-gcac6ece.tar.gz',
}
# Source-built on 64-bit boards only: the A10 GPU's Vulkan driver and the VA-API video bridge.
# Source-built on 64-bit boards only: the GPU's Vulkan driver (with the GPU probe) and the VA-API video bridge.
HARDWARE_PACKAGES = {'vulkan-powervr-orchard.pkg.tar.zst': ('gpu_recipe_sha256', 'packages/vulkan-powervr-orchard'),
'libva-v4l2-request.pkg.tar.zst': ('video_bridge_recipe_sha256', 'packages/libva-v4l2-request')}
# Prebuilt on 64-bit boards: packages published by their own repositories,
Expand Down
4 changes: 2 additions & 2 deletions desktop/build-sources
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ package=$(ls "$build"/result/libva-v4l2-request-*-$OMARCHY_ARCH.pkg.tar.zst)
bsdtar -tf "$package" usr/lib/dri/v4l2_request_drv_video.so >/dev/null
cp "$package" "$ORCHARD_WORK/result/libva-v4l2-request.pkg.tar.zst"
echo 'Building the GPU Vulkan driver (several minutes)...'
cp "$ORCHARD_RECIPE/packages/vulkan-powervr-orchard/PKGBUILD" "$ORCHARD_WORK"/sources/mesa-*.tar.gz "$build/gpu/"
cp "$ORCHARD_RECIPE"/packages/vulkan-powervr-orchard/{PKGBUILD,gpu-probe.c} "$ORCHARD_WORK"/sources/mesa-*.tar.gz "$build/gpu/"
cd "$build/gpu"
PKGDEST="$build/result" PKGEXT='.pkg.tar.zst' makepkg --noconfirm --nodeps > "$build/gpu.log" 2>&1 || { tail -60 "$build/gpu.log"; exit 1; }
package=$(ls "$build"/result/vulkan-powervr-orchard-*-$OMARCHY_ARCH.pkg.tar.zst)
bsdtar -tf "$package" usr/lib/libvulkan_powervr_mesa.so usr/share/vulkan/icd.d/powervr_mesa_icd.json >/dev/null
bsdtar -tf "$package" usr/lib/libvulkan_powervr_mesa.so usr/share/vulkan/icd.d/powervr_mesa_icd.json usr/lib/omarchy-a/gpu-probe >/dev/null
cp "$package" "$ORCHARD_WORK/result/vulkan-powervr-orchard.pkg.tar.zst"
'''
buildenv.run(image, ['bash', '-euc', script],
Expand Down
57 changes: 47 additions & 10 deletions desktop/configuration/login-session
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,62 @@ export WLR_RENDERER=pixman QT_QUICK_BACKEND=software QT_QPA_PLATFORM=wayland
export QT_QPA_PLATFORMTHEME=gtk3
export OMARCHY_TOUCH_MODE=1
export LIBGL_ALWAYS_SOFTWARE=1 LIBSEAT_BACKEND=seatd MOZ_ENABLE_WAYLAND=1
# A board with a GPU this image has a Vulkan driver for (the A10's, kernel
# driver powervr): Labwc draws on wlroots' GLES2 renderer and applications on
# OpenGL, both through Zink on that driver. Every other board, and a boot with
# modprobe.blacklist=powervr, keeps the software desktop above. The shell stays
# on Qt's software renderer either way; the apps it starts don't (uwsm-app).
# A board with a GPU this image has a Vulkan driver for (kernel driver powervr,
# the A10's and the A9's): Labwc draws on wlroots' GLES2 renderer and
# applications on OpenGL, both through Zink on that driver, once gpu-probe has
# drawn a frame that way in this boot and the display took its buffer. Every
# other board, a boot with modprobe.blacklist=powervr and a boot whose probe
# fails or does not finish keep the software desktop above; the journal says
# which (journalctl -t omarchy-gpu-probe). The shell stays on Qt's software
# renderer either way; the apps it starts don't (uwsm-app).
gpu=
for node in /sys/class/drm/renderD*; do
if [[ $(basename "$(readlink -f "$node/device/driver")") == powervr ]]; then gpu=$node; fi
done
if [[ -n $gpu && -e /usr/share/vulkan/icd.d/powervr_mesa_icd.json ]]; then
export WLR_RENDERER=gles2 WLR_RENDER_DRM_DEVICE=/dev/dri/${gpu##*/}
export MESA_LOADER_DRIVER_OVERRIDE=zink PVR_I_WANT_A_BROKEN_VULKAN_DRIVER=1
unset LIBGL_ALWAYS_SOFTWARE
if [[ -n $gpu ]]; then
gpu_probe=/usr/lib/omarchy-a/gpu-probe
gpu_log=$XDG_RUNTIME_DIR/omarchy-gpu-probe.log
# The GPU has no display outputs: Labwc must open the display's card only.
display=
for card in /sys/class/drm/card*; do
if [[ ${card##*/} =~ ^card[0-9]+$ && $(readlink -f "$card/device") != "$(readlink -f "$gpu/device")" ]]; then
export WLR_DRM_DEVICES=/dev/dri/${card##*/}
display=/dev/dri/${card##*/}
fi
done
gpu_desktop=(WLR_RENDERER=gles2 "WLR_RENDER_DRM_DEVICE=/dev/dri/${gpu##*/}"
MESA_LOADER_DRIVER_OVERRIDE=zink PVR_I_WANT_A_BROKEN_VULKAN_DRIVER=1)
if [[ -n $display ]]; then gpu_desktop+=("WLR_DRM_DEVICES=$display"); fi
if [[ ! -e /usr/share/vulkan/icd.d/powervr_mesa_icd.json ]]; then
gpu_verdict='software desktop: this image has no Vulkan driver for the GPU'
elif [[ -z $display || ! -x $gpu_probe ]]; then
gpu_verdict='software desktop: no display card or no gpu-probe to test the GPU with'
else
# The probe runs with the environment the desktop would get. The login
# waits for it 10 s at most and does not depend on it ending: a probe
# stuck in the kernel is left behind.
env -u LIBGL_ALWAYS_SOFTWARE "${gpu_desktop[@]}" "$gpu_probe" "/dev/dri/${gpu##*/}" "$display" \
>"$gpu_log" 2>&1 </dev/null &
gpu_pid=$!
gpu_ended=
gpu_verdict='software desktop: the GPU probe did not finish within 10 s'
for ((tick = 0; tick < 100; tick++)); do
if ! kill -0 "$gpu_pid" 2>/dev/null; then
gpu_detail=$(grep -m 1 GPU-PROBE "$gpu_log" 2>/dev/null || tail -n 1 "$gpu_log" 2>/dev/null || true)
gpu_ended=1
if wait "$gpu_pid"; then
gpu_verdict="GPU desktop after $((tick / 10)).$((tick % 10)) s: $gpu_detail"
export "${gpu_desktop[@]}"
unset LIBGL_ALWAYS_SOFTWARE
else
gpu_verdict="software desktop: ${gpu_detail:-the GPU probe failed}"
fi
break
fi
sleep 0.1
done
if [[ -z $gpu_ended ]]; then kill -KILL "$gpu_pid" 2>/dev/null || true; fi
fi
logger -t omarchy-gpu-probe -- "$gpu_verdict" 2>/dev/null || true
fi
# A hardware video decoder (kernel driver apple-vxd, H.264): VA-API
# applications reach it through libva-v4l2-request. Firefox uses it only when
Expand Down
28 changes: 17 additions & 11 deletions desktop/packages/vulkan-powervr-orchard/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# omarchy-a: the Vulkan driver for the Apple A10 GPU (iPad 6, iPad 7) from
# OrchardLinux's Mesa fork, and only that driver: EGL, GBM and Zink stay
# Arch's own Mesa and draw through it. The kernel side is orchard's.
# omarchy-a: the Vulkan driver for the Apple PowerVR GPUs orchard's powervr
# kernel driver runs, from OrchardLinux's Mesa fork, and only that driver: EGL,
# GBM and Zink stay Arch's own Mesa and draw through it. With it gpu-probe, the
# login session's test that this stack draws on the board it runs on, linked
# to Arch's Mesa. The kernel side is orchard's.

pkgname=vulkan-powervr-orchard
_commit=7446eebebec5722cbdc6d3670e834c08d6ea9607
pkgver=27.0.0.dev.7446eebebec
_commit=2c1aa767d8d8836739260177144716271e05f686
pkgver=27.0.0.dev.2c1aa767d8d
pkgrel=1
pkgdesc="Vulkan driver for the Apple A10 GPU, from the OrchardLinux Mesa fork"
pkgdesc="Vulkan driver for the Apple PowerVR GPUs, from the OrchardLinux Mesa fork, and the desktop's GPU probe"
url="https://github.com/OrchardLinux/mesa"
license=('MIT')
arch=('aarch64')
options=('!lto' '!debug')
depends=('expat' 'gcc-libs' 'glibc' 'libdisplay-info' 'libdrm' 'spirv-tools' 'systemd-libs' 'vulkan-icd-loader'
'wayland' 'zlib' 'zstd')
depends=('expat' 'gcc-libs' 'glibc' 'libdisplay-info' 'libdrm' 'libglvnd' 'mesa' 'spirv-tools' 'systemd-libs'
'vulkan-icd-loader' 'wayland' 'zlib' 'zstd')
# LLVM, Clang and libclc compile the driver's internal shaders at build time only.
makedepends=('bison' 'clang' 'flex' 'glslang' 'libclc' 'libdisplay-info' 'libelf' 'libxkbcommon' 'llvm' 'meson'
'ninja' 'python-mako' 'python-packaging' 'python-ply' 'python-yaml' 'spirv-llvm-translator'
'ninja' 'pkgconf' 'python-mako' 'python-packaging' 'python-ply' 'python-yaml' 'spirv-llvm-translator'
'spirv-tools' 'vulkan-headers' 'wayland-protocols')
provides=('vulkan-driver')
conflicts=('vulkan-powervr')
source=("mesa-${_commit}.tar.gz::${url}/archive/${_commit}.tar.gz")
sha256sums=('7aa55f09aae7be33399136311a5b507c0846fb777dc6a1d36ded66d7546480f2')
source=("mesa-${_commit}.tar.gz::${url}/archive/${_commit}.tar.gz" gpu-probe.c)
sha256sums=('e6a6481bcbe736342146b8000725e739ebf389384d3a9fe3ae36def2e4c6cd2a'
'85a82faaf046de658e139df0f185793a9aca857129a7c90c76aaf98d74152633')

build() {
# Not arch-meson: its --auto-features=enabled turns on Mesa features that
Expand All @@ -31,6 +34,8 @@ build() {
-Dopengl=false -Degl=disabled -Dgbm=disabled -Dglx=disabled -Dgles1=disabled \
-Dgles2=disabled -Dllvm=enabled -Dvideo-codecs= -Dtools= -Dvulkan-layers=
ninja -C build
# The system's EGL, GLES, GBM and libdrm: the ones the desktop draws through.
cc ${CFLAGS} -Wall -Wextra gpu-probe.c -o gpu-probe ${LDFLAGS} $(pkg-config --cflags --libs egl glesv2 gbm libdrm)
}

package() {
Expand All @@ -41,5 +46,6 @@ package() {
build/src/imagination/vulkan/powervr_mesa_icd.*.json > powervr_mesa_icd.json
grep -q '"library_path": "/usr/lib/libvulkan_powervr_mesa.so"' powervr_mesa_icd.json
install -Dm 644 powervr_mesa_icd.json "${pkgdir}/usr/share/vulkan/icd.d/powervr_mesa_icd.json"
install -Dm 755 gpu-probe "${pkgdir}/usr/lib/omarchy-a/gpu-probe"
install -Dm 644 "mesa-${_commit}/docs/license.rst" "${pkgdir}/usr/share/licenses/${pkgname}/license.rst"
}
Loading
Loading