Repository navigation
feat(nvidia): captured the graphics engine's golden context at bring-up - #602
Merged
Merged
Conversation
Every graphics channel's context starts from the golden context, which the firmware captures from the first channel given a 3D object. Capturing it at bring-up, on a channel of its own in a split address space since the firmware refuses the golden context's promotion in one only the kernel maps, gives every graphics queue the same starting state.
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.
Summary
Every graphics channel's context starts from the golden context, which the firmware captures from the first channel given a 3D object, so the NVIDIA backend captures it at bring-up, on a channel of its own, before the GPU registers with the GPU core.
Changes
engines::bring_up_graphics, which the driver task runs betweenbring_upand registration, allocates the graphics engine's global context buffers and captures the golden context on a channel of its own: it maps the channel's own buffers and the global ones into the channel's address space, hands them to the firmware (the promotion), then gives the channel a 3D object and frees it. The global buffers, about 10 MiB on the RTX 3080, stay allocated for the graphics channels that share them. A failure leaves the GPU unregistered, and memory the firmware or a hung copy may still reach stays allocated for good.address_space::create_splitcreates one split between them, handing the firmware the kernel's page directories above its range (context_page_tables::add_directories).page_mappingmaps the context buffers so that only the GPU's privileged accesses, such as a context switch's, reach them, and the register access map read-only.channel::createis split intoallocate,add_objectandschedule, so the golden channel's buffers are promoted between its allocation and its 3D object and the channel is never scheduled.