fix(kvm): route no-modifier DRM scanout through gbm, not raw mmap (VA-106) #110
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VA-106-drm-scanout-modifier-none-tiled"
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?
Problem
With the VA-105 backpressure fix live (
0.3.0-16-g16fa2bb), remote Wayland viewers now receive the keyframe over the data channel - but desktop-03 renders a horizontally-sheared / streaked image instead of the desktop, while desktop-02 renders correctly.Root cause is the capture read-path selection, not the pixel math (
convert_to_rgbis proven by desktop-02 + unit tests).is_linear(modifier)treated a missing modifier (None) the same as an explicitDrmModifier::Linear, socapture_rgbtook the raw-mmapfast path for either. ButdrmModeGetFB2only reports a modifier when the framebuffer was added withDRM_MODE_FB_MODIFIERS; many drivers scan out of an implicitly-tiled buffer and reportNone. Reading a tiled buffer row-by-row as if it were linear shears it into horizontal streaks. desktop-02 (AMD, explicit tiling modifier) already went through the gbm readback and rendered correctly; desktop-03 (no modifier reported) took the raw mmap and sheared.Fix
mmap(read_linear_rgb) only when the modifier is explicitlyLinear(newis_explicit_linear). RouteNoneand any tiled modifier throughdrm_gbm::read_scanout_rgb, which has the driver blit the tiled / VRAM scanout into a CPU-linear buffer. gbm handles genuinely-linear buffers too, so this is safe for the linear case.mmapfallback for a headless / VM host with no usable gbm whose scanout is nonetheless plain linear, surfacing the gbm error if that also fails.log_scanout_once: every host emits its selected scanoutwidth/height/fourcc/modifier/pitch/offset/explicit_linearonce to the journal, so a distorted or black capture is diagnosable without a separate probe run.Testing
just pre-commit(fmt + clippy--deny warnings+ build +test --lib) green in Docker.DRM/KMS scanout selected ...journal line will confirm each host's actual modifier.Not covered
desktop-01's black screen is the X11 greeter path (x11rb), not DRM - tracked separately.
Fixes VA-106.