drivers/gop: Resolve GOP child controller ownership - #2
Merged
Conversation
Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Cass Sheng <cass@microperceptron.com>
There was a problem hiding this comment.
Pull request overview
This PR improves how the UEFI GOP driver determines framebuffer ownership by PCI endpoint when the GOP handle’s device path cannot be resolved to an EFI_PCI_IO_PROTOCOL provider, adding a standards-based fallback while still avoiding heuristic guesses.
Changes:
- Refactors PCI framebuffer-source extraction into a reusable helper and returns success/failure to drive fallback behavior.
- Adds a fallback path that uses
OpenProtocolInformation()and theEFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLERrelationship to match a GOP child handle to its owning PCI I/O controller. - Updates extension documentation to describe the two-step (device-path first, child-controller relationship second) ownership proof.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| EXTENSIONS.md | Documents the refined GOP-to-PCI ownership resolution strategy and when “unknown” is reported. |
| common/drivers/gop.c | Implements the child-controller relationship fallback for GOP-to-PCI ownership and refactors PCI source assignment into a helper. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLERrelationship when firmware installs GOP on an unresolvable child handleWhy
A Lunar Lake boot using the first framebuffer-source extension enumerated the exact
8086:64a0display identity, but the source remained unknown and Kore correctly stopped at ownership note 6. On this firmware, the GOP handle does not appear to expose a device path thatLocateDevicePath(EFI_PCI_IO_PROTOCOL)can resolve.The fallback enumerates PCI I/O handles and accepts a candidate only when
OpenProtocolInformation(EFI_PCI_IO_PROTOCOL)contains aBY_CHILD_CONTROLLERrecord whose controller handle is exactly the GOP handle. It returns unknown when that positive UEFI relationship is absent or ambiguous.Verification
--enable-werror--enable-all --enable-werrorgit diff --check origin/ft/gpu-handoff...HEADThe repository's “targetting trunk” policy check is expected to fail because this integration PR intentionally targets the requested
ft/gpu-handoffbranch. Both compilation checks are green.