Repository navigation
Desktop: GPU or software per boot, decided by a test frame, on every board - #54
Merged
Merged
Conversation
A small program the login session can run before it starts Labwc on the GPU: it opens EGL on the GPU's render node, draws into a buffer and reads it back, and exits 0 only if that worked. Taken from the probe of omarchy-a PR #44 (commit 3c13c74, "Desktop: matched G5P Vulkan and GL, hardware desktop after a probe", desktop/packages/mesa-g5p-orchard/gpu-probe.c) and adapted to the one GPU path every board takes, the system Mesa with Zink on the powervr Vulkan driver: - It follows that path's buffer flow: the output buffer is allocated on the GPU and handed to the display controller (prime import, AddFB2), as wlroots does, and has the panel's size instead of 32x32, because the display controller's import depends on how the memory is laid out. The original allocated on the display card and imported into the GPU, the flow of the separate Mesa in /opt. - EGL is opened as wlroots opens it (the EGL device of the render node, then GBM), with no EGL config. - It draws a quad through a shader after the clear, and refuses a software renderer by name instead of requiring "PowerVR". - It gives up DRM master on the display card at once, so that a stuck probe cannot keep Labwc from the display. - It lives next to the Vulkan driver's recipe; nothing builds it yet. Compiled in the desktop builder image; not run on a GPU. Assisted-by: LLM
…board The login session chose the GPU desktop wherever the powervr kernel driver had a render node and the image had the Vulkan driver. That was safe while only the A10 had the kernel driver. With the A9 in the same kernel driver (orchard PR #138) a bound driver no longer says that the desktop can draw: Mesa has to speak the chip's job format and the display controller has to take the GPU's buffers. The session now runs gpu-probe first, with the environment the desktop would get (Zink on the powervr Vulkan driver, the system Mesa). If the probe draws its frame, the session exports exactly what it exported before; an A10 board ends up as it did. If the probe fails, crashes or has not ended after 10 s, the desktop starts in software. The session polls the probe instead of waiting on it, so a probe stuck in the kernel cannot hold the login. One line per login goes to the journal (journalctl -t omarchy-gpu-probe): the decision and the probe's reason. There is no board or chip name in this: the A9 takes the A10's path as soon as kernel and Mesa carry it. A board without a powervr render node runs no probe and logs nothing. The probe is built and shipped with the Vulkan driver package (/usr/lib/omarchy-a/gpu-probe), one binary for all boards, linked to the system's EGL, GLES, GBM and libdrm. Tested: the session's decisions with a mocked probe (pass, fail, crash, never ending, no probe, no display card); the probe compiles with the package's flags in the desktop builder image and refuses llvmpipe there. Not built as a package, not run on a GPU. Assisted-by: LLM
Mesa fork 2c1aa767d8d (OrchardLinux/mesa #8): Berkay Kösebay's A9 driver on the powervr kernel interface (orchard #138), next to the A10 one. The iPad 6/7 path is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At every login the desktop now draws one test frame on the GPU before it decides how to draw. If the frame comes out right, the desktop runs on the GPU; if not, it runs in software, as on a board without a GPU. There is no board or chip name in the decision, so the iPad 5 (A9) takes the same path as the iPad 6/7 (A10): the system Mesa, Zink on the powervr Vulkan driver.
Not run on any tablet. Per Henrik's decision this is merged untested; Berkay tests
mainon his iPad 5 afterwards.What changes
iPad 6 / iPad 7 (A10). The desktop draws on the GPU as before, with the same settings as before. New: the login first spends the time of the test frame (expected well under a second or two; not measured), and a boot in which the GPU does not draw ends on the software desktop instead of a desktop that does not come up.
iPad 5 (A9). Nothing yet with today's kernel and Mesa: no GPU device, software desktop, no test frame. Once orchard#138 (the A9 in the powervr kernel driver) is merged, the kernel offers a GPU, the login tries the test frame, and:
Boards without a GPU driver (everything else, and any board booted with
modprobe.blacklist=powervr): unchanged. No test frame is run, nothing is logged, the login takes as long as before.USB serial and SSH are not touched; the decision happens only in the graphical login on the tablet's own screen.
The test frame
gpu-probedoes for one frame what Labwc does: it opens EGL on the GPU, allocates a buffer of the panel's size on the GPU, clears it, draws a quad through a shader, reads a pixel back, and hands the buffer to the display controller as a framebuffer (no mode is set, the screen is not touched). It refuses a software renderer, so a silent fallback to llvmpipe counts as a failure.The login waits at most 10 s. It polls the probe rather than waiting for it to end, so a probe stuck inside the kernel is left behind and the login goes on in software. A probe that crashes counts as failed.
Each login on a board with a GPU driver writes one line to the journal, the decision and the reason:
The probe's full output of the last login is in
$XDG_RUNTIME_DIR/omarchy-gpu-probe.log.Where it is
desktop/configuration/login-session: the decision (the block "A board with a GPU ...").desktop/packages/vulkan-powervr-orchard/gpu-probe.c: the probe, built and shipped with the Vulkan driver package as/usr/lib/omarchy-a/gpu-probe. One binary for all boards, linked to the system's EGL, GLES, GBM and libdrm.tests/test_gpu_video_session.py: the decisions with a mocked probe.Provenance
The probe is Berkay Kösebay's, from omarchy-a PR #44 (commit 3c13c74,
desktop/packages/mesa-g5p-orchard/gpu-probe.c), committed here under his authorship and adapted: #44 ran it for a separate Mesa in/opt/orchard/g5p; here it tests the one system Mesa path. The adaptations are listed in that commit's message. The separate Mesa, theLD_LIBRARY_PATHswitch and the other parts of #44 are not in this PR.Mesa pin
The pin is unchanged (OrchardLinux/mesa 7446eebebec). The A9 port (
a9-powervrin OrchardLinux/mesa) did not exist when this was written. The iPad 5 draws on the GPU only after a follow-up moves the pin (desktop/arm64/sources.jsonand the PKGBUILD's_commitand checksum) to the merged Mesa commit. Order: orchard#138 and the Mesa PR, then the pin. This PR can merge before or after them; until all three are in, the iPad 5 stays on the software desktop.Tested
tests/test_gpu_video_session.py(10 tests, macOS bash 3.2 and Arch bash 5.3): probe passes, fails with a reason, crashes, never ends, is missing; no display card; no Vulkan driver; boards without the GPU driver run no probe; video decoder settings follow the decision.Not proven
No changelog entry in this PR.
Assisted-by: LLM