CLAUDE.md: record the direct-scanout consumer and its contract
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 19s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 17s
build / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 20s
build / docs (push) Failing after 3s
build / obs (clang) (push) Failing after 20s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s

This commit is contained in:
donny committed 2026-07-28 09:09:46 +00:00
1 parent 5e2fd18b5c
commit 23b8236e21
1 file changed
+17
+17
View File
@@ -105,6 +105,23 @@ Deliberate decisions — **understand before changing**:
invent one. `lgDisplaysPack` picks a minimum-area layout;
`lgDisplaysRepack` does CPU copies; `lgDisplaysRectToAtlas` translates
damage. All unit tested — extend the tests when changing them.
- **Every display's atlas offset is aligned for direct scanout**
(`LG_DISPLAY_ALIGN_PIXELS`). This exists so a consumer can point display
hardware straight at one display's region of the frame instead of copying
it. Do not drop it to save a few pixels of padding; a unit test enforces it.
### Downstream consumer
The user is building a custom Wayland compositor (Smithay) that consumes this
frame directly — importing the shared memory as a dmabuf and page-flipping
each display's region independently, so guest pixels never pass through an
extra copy. That is why the alignment guarantee and the damage-in-atlas-space
semantics matter beyond the Looking Glass client itself.
The contract that consumer relies on is written up under "Consuming frames
directly" in `doc/multimonitor.rst` — layout, alignment, frame lifetime
(two-deep queue, one second subscriber timeout) and damage. **Treat it as an
interface**: changing it breaks a separate codebase.
## Gotchas