feat(kvm): DRM/KMS scanout capture via gbm readback (VA-104 part 2) #108
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VA-104-drm-egl-readback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second increment of #VA-104: the capture half. Together with the merged input backend (#106), this is the complete consent-free, unattended Wayland desktop for KWin / GNOME.
What
drm_kms.rs+drm_gbm.rs: read the active CRTC's scanout framebuffer straight off/dev/drias root (drmModeGetFB2-> DMA-BUF export), then read the pixels back through libgbm (gbm_bo_import+gbm_bo_map), which has the GPU driver blit the VRAM/tiled buffer into a CPU-visible linear region. No portal, no consent, no compositor cooperation - the path grim (wlr-screencopy) and the portal can't provide on KWin/GNOME.2:10:10:10scanout formats.wayland::capture_rgb, ahead of grim then the portal, with a process-wide unavailable latch for non-root / headless hosts.libgbmisdlopen'd (like libpipewire) so the binary carries no hard link and still runs headless;libloadingis now a base crate dependency.drm_probeexample +just drm-probe/just deploy-localrecipes for the on-host dev loop.Verified live
On an AMD Ryzen iGPU + KWin Wayland host (the dev machine): the probe captures a correct 3840x2160 ABGR2101010 screenshot with no consent prompt (verified real content, not garbage - 249/256 distinct byte values, varied regions). The full agent builds, deploys, and runs with this path selected. Unit tests cover the pixel-format conversion;
just pre-commitgreen.Result
A root system agent now drives a logged-in KWin Wayland desktop end-to-end with zero interactive consent - the requirement that motivated VA-104.