| Filename | Latest commit message | Latest commit date |
|---|---|---|
`SimpleCrtcMapper` keeps a `connector -> crtc` reservation map and, on each `map()` call, releases the reservation of any connector it is told about that is no longer connected:
```rust
for connector in connectors
.clone()
.filter(|conn| conn.state() != connector::State::Connected)
{
self.crtcs.remove(&connector.handle());
}
```
This only releases connectors that are still present in the resource list and reported as disconnected. A connector whose handle disappears from the resource list entirely is never passed to `map()` again, so its reservation is never released and leaks for the lifetime of the mapper.
This happens routinely with DP-MST: the sink connectors behind an MST hub are dynamically created and destroyed, so unplugging a USB-C/Thunderbolt dock — or suspending and resuming while docked, where the connectors are torn down and recreated under fresh handles while the compositor isn't scanning — makes the old handles vanish rather than transition to `Disconnected`. Each such event leaks one reservation per vanished connector. Because a leaked reservation still counts as "taken", the reservations accumulate across cycles until every CRTC is reserved by a ghost handle. At that point `pick_next_available_for_connector` can no longer find a free CRTC for a genuinely connected connector, so `crtc_for_connector` returns `None` for it and the compositor silently never brings up that output. The only recovery is recreating the `DrmScanner`.
This was observed in niri as external monitors on a dock going missing after a number of suspend/resume cycles, getting progressively more likely over time, and only recoverable by restarting the compositor.
Fix it by releasing the reservation of every connector that is not currently connected, including connectors that are no longer present at all. At the start of `map()`, collect the set of currently connected connector handles and retain only reservations whose handle is in that set. The previously handled case (a connector present but reported as disconnected) is still covered, since such a connector is excluded from the connected set.
|
||
| .. | ||
| examples | ||
| src | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
Smithay DRM Extras
This crate contains some extra abstractions and helpers over DRM
display_infomodule is responsible for extraction of information from DRM connectors (modelandmanufacturer)drm_scannermodule contains helpers for detecting connector connected and disconnected events as well as mapping crtc to them.ConnectorScanneris responsible for tracking connected/disconnected events.CrtcMappertrait andSimpleCrtcMapperare meant for mapping crtc to connector.DrmScanner<CrtcMapper>combines two above into single abstraction. If it does not fit your needs you can always drop down to usingConnectScanneralone.