drm-extras: report late CRTC mappings - #2125
Open
johnrichardrinehart wants to merge 1 commit into
Open
Conversation
DrmScanner can report a connected connector without a CRTC when every compatible CRTC is occupied. If another connector disconnects later, the mapper assigns the released CRTC, but ConnectorScanner has no state transition to report. Consumers can then miss the mapping and leave the output inactive. Record mappings before CrtcMapper::map() and report a Connected event when a connected connector changes from unmapped to mapped. Avoid a duplicate event for connectors that became connected in the same scan. Add a focused mapping-transition test and document the event semantics. This contribution was developed with assistance from OpenAI Codex. Signed-off-by: John Rinehart <johnrichardrinehart@gmail.com>
johnrichardrinehart
added a commit
to johnrichardrinehart/nixosModules
that referenced
this pull request
Aug 8, 2026
Niri's Smithay revision predates the fix that releases CRTC reservations for vanished DP-MST connectors. Smithay also fails to report when an already-connected connector receives a CRTC on a later scan, which can leave Niri unaware of the usable mapping. Pin only smithay-drm-extras to the commit behind Smithay PR #2125. The commit includes the merged stale-reservation fix and the tested late-mapping event fix while leaving Niri's core Smithay dependency unchanged. Regenerate the Cargo vendor tree and document why the pin is required. Link: Smithay/smithay#2125 Link: Smithay/smithay#2076
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DrmScannercan report a connected connector withcrtc: Nonewhen every compatible CRTC is occupied. If another connector later disconnects,CrtcMapper::map()can assign the released CRTC without a connector state or mode change. The scan then reports only the disconnection, so consumers do not learn that the previously unusable connector is now mapped.This change snapshots mappings before
CrtcMapper::map()and reportsConnectedagain for a connected connector whose mapping changes fromNonetoSome. It suppresses the extra event whenConnectorScanneralready reported the connector as newly connected in the same scan.This differs from #1923: that change reports mode-list updates through
Changed; this change reports CRTC availability when the connector metadata did not change. Keeping the existingConnectedvariant avoids an API-breaking enum addition and works with consumers that register outputs fromConnected { crtc: Some(_) }.A focused unit test covers the transition and verifies that existing mappings, same-scan connection events, and connectors that remain unmapped are not reported.
Related: #2075 and #2076.
This contribution was developed with assistance from OpenAI Codex, as disclosed in the commit message.
Verification
cargo fmt --all -- --checkcargo clippy --manifest-path smithay-drm-extras/Cargo.toml --no-deps -- -D warningscargo test --manifest-path smithay-drm-extras/Cargo.tomlChecklist