From 23b8236e21a26ddc85427c800b399cbcae75c33d Mon Sep 17 00:00:00 2001 From: Angel Mankel Date: Tue, 28 Jul 2026 09:09:46 +0000 Subject: [PATCH] CLAUDE.md: record the direct-scanout consumer and its contract --- CLAUDE.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index c473c457..c0e1bfab 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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