feat(kvm): DRM/KMS scanout enumeration + capture probe (VA-104) #107

Merged
David merged 1 commit from fix/VA-104-drm-kms-capture into main 2026-07-04 01:01:46 +02:00
Owner

Foundation for consent-free Wayland capture: read the active CRTC's scanout framebuffer off /dev/dri as root, the compositor-agnostic path that works on KWin/GNOME where wlr-screencopy (grim) and the consent-gated portal do not. Enumerates cards/CRTCs, resolves the primary framebuffer (directly or via its plane), exports the plane's DMA-BUF, and reads a LINEAR buffer via mmap into packed RGB. Adds a drm_probe example plus just drm-probe / just deploy-local recipes for the on-host dev loop.

Confirmed on an AMD KWin host: the scanout is 3840x2160 ABGR2101010, reported linear but resident in VRAM, so a CPU mmap is denied (EPERM). The GPU readback path (EGL/gbm DMA-BUF import) that handles VRAM and tiled buffers is the next increment; this lands the enumeration, format/modifier probe, and the linear read that covers software / UMA-linear scanout.

Not yet wired into wayland::capture_rgb; the module and probe stand alone until the GPU readback lands.

#VA-104

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Foundation for consent-free Wayland capture: read the active CRTC's scanout framebuffer off /dev/dri as root, the compositor-agnostic path that works on KWin/GNOME where wlr-screencopy (grim) and the consent-gated portal do not. Enumerates cards/CRTCs, resolves the primary framebuffer (directly or via its plane), exports the plane's DMA-BUF, and reads a LINEAR buffer via mmap into packed RGB. Adds a drm_probe example plus `just drm-probe` / `just deploy-local` recipes for the on-host dev loop. Confirmed on an AMD KWin host: the scanout is 3840x2160 ABGR2101010, reported linear but resident in VRAM, so a CPU mmap is denied (EPERM). The GPU readback path (EGL/gbm DMA-BUF import) that handles VRAM and tiled buffers is the next increment; this lands the enumeration, format/modifier probe, and the linear read that covers software / UMA-linear scanout. Not yet wired into wayland::capture_rgb; the module and probe stand alone until the GPU readback lands. #VA-104 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(kvm): DRM/KMS scanout enumeration + capture probe (VA-104)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 4m7s
Create release / Create release from merged PR (pull_request) Has been skipped
2db3417739
Foundation for consent-free Wayland capture: read the active CRTC's scanout framebuffer off /dev/dri as root, the compositor-agnostic path that works on KWin/GNOME where wlr-screencopy (grim) and the consent-gated portal do not. Enumerates cards/CRTCs, resolves the primary framebuffer (directly or via its plane), exports the plane's DMA-BUF, and reads a LINEAR buffer via mmap into packed RGB. Adds a drm_probe example plus `just drm-probe` / `just deploy-local` recipes for the on-host dev loop.

Confirmed on an AMD KWin host: the scanout is 3840x2160 ABGR2101010, reported linear but resident in VRAM, so a CPU mmap is denied (EPERM). The GPU readback path (EGL/gbm DMA-BUF import) that handles VRAM and tiled buffers is the next increment; this lands the enumeration, format/modifier probe, and the linear read that covers software / UMA-linear scanout.

Not yet wired into wayland::capture_rgb; the module and probe stand alone until the GPU readback lands.

#VA-104

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
David scheduled this pull request to auto merge when all checks succeed 2026-07-04 00:57:38 +02:00
David merged commit 2cc0d6b63b into main 2026-07-04 01:01:46 +02:00
David deleted branch fix/VA-104-drm-kms-capture 2026-07-04 01:01:47 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-agent!107
No description provided.