Reconcile Blackwell physical-window allocation with validated layer usage - #1338
Open
zaclanzon wants to merge 6 commits into
Open
Reconcile Blackwell physical-window allocation with validated layer usage#1338zaclanzon wants to merge 6 commits into
zaclanzon wants to merge 6 commits into
Conversation
Retry the failed head after reclaiming scaler-capable tiles instead of advancing to the next tile type with an incomplete assignment. Return failure if the retry cannot satisfy the request. Use a 64-bit intermediate when constructing the physical-window mask, avoiding an undefined 32-bit shift at the capability format's limit. Add exhaustive allocation and boundary checks, and expand the ownership test harness into readable C following the surrounding source style. Validation: 2,359,296 allocation configurations, boundary checks and the existing 16 checks pass under ASan/UBSan; 610.57.04 modeset build passes. These changes have not been installed or hardware-tested.
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.
My RTX 5090 could not drive the following four-display configuration on Ubuntu with overlay layers enabled. The same configuration works in Windows, and disabling overlay layers at Linux driver initialization also made it work. This patch makes it work with overlays enabled.
Reproduction
nvidia-modeset.enable_overlay_layers=1).enable_overlay_layers=0) allows the same target configuration. With this patch, the target works with overlays enabled.The patch also preserves transitions back to modes where overlay resources are available; that behavior is exercised separately by the active-overlay test below.
Cause and change
These modes require six hardware tiles. Reserving two layers per tile requires twelve physical windows on a device with eight, even when validated usage marks the extra layers unusable.
The patch allocates physical windows according to validated layer usage and reconciles hardware window ownership with those assignments. It preserves exposed overlay planes and software mappings. Assignment and ownership changes use the head-shutdown path before reprogramming; the flip/core split decision moves after PreUpdate so it includes changes discovered there. Existing usage validation prevents ordinary flips from activating a released layer.
I reached this implementation after testing and rolling back earlier allocation and sequencing changes that produced black screens and Xid 56. Tracking hardware ownership alongside physical assignments led to the working combination. The subsequent review added allocation, sequencing, ownership, and queued-initialization regressions.
Two additional allocator defects are fixed in a separate hardening commit:
Validation
Tested on Ubuntu with NVIDIA 610.43.02, kernel 7.0.0-30-generic, and overlay layers enabled. The production changes apply to that driver version; the PR is based on 610.57.04.
The overlay tests exercise release and reacquisition; they do not claim simultaneous active overlays at maximum modes where validation makes those layers unavailable. Broader hardware coverage, extended use, and suspend/resume remain unvalidated. A recurring platform startup issue also prevents claiming warm-reboot reliability.
Tested source:
5077cded3506880f3146c1dd1643efe361da7564· loaded module build ID:cba99c0c70d11b5ef2097934c433dfc31c65efe1.The standalone regression harness and run instructions are preserved on a separate fork branch as supporting evidence. This PR changes only the two production source files.
This replaces the earlier, closed upstream PR #1337.
Earlier diagnostic work is preserved in fork PR #1.
Developed and tested through a joint investigation with GPT-6 Astra.