fix(kms): consider all connected connectors when picking primary gpu - #2647
Open
techywilbur wants to merge 1 commit into
Open
fix(kms): consider all connected connectors when picking primary gpu#2647techywilbur wants to merge 1 commit into
techywilbur wants to merge 1 commit into
Conversation
`determine_primary_gpu` looked for a built-in laptop panel (eDP/LVDS/DSI) by scanning only connectors that already had a `Surface` (`dev.inner.surfaces.values()`). At startup a connector may not have been turned into a `Surface` yet, or its `Surface` creation may have transiently failed, so the internal panel could be missed and the wrong render GPU selected on a hybrid (e.g. Intel + NVIDIA) laptop when an external display is connected at boot. Instead, enumerate every connector via `resource_handles()` and treat a device as holding the built-in panel only when an internal-interface connector reports `ConnectorState::Connected`. A device that fails to report resource handles is skipped rather than aborting selection for all devices. Preserves the existing `COSMIC_RENDER_DEVICE`, boot-gpu and first-device fallbacks unchanged. Adds trace/info logging of which connectors were considered and why a GPU was chosen, plus a unit test for the internal-panel predicate. This mirrors the approach of the upstream branch `fix-check-all-connectors_noble` (9c95ebf, Victoria Brekenfeld); it is a candidate for pop-os/cosmic-comp issue #3751 and does not claim to resolve every report in that issue (a single-GPU report is unlikely to be affected by primary-gpu selection). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
5 tasks
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.
determine_primary_gpulooked for a built-in laptop panel (eDP/LVDS/DSI) by scanning only connectors that already had aSurface(dev.inner.surfaces.values()). At startup a connector may not have been turned into aSurfaceyet, or itsSurfacecreation may have transiently failed, so the internal panel could be missed and the wrong render GPU selected on a hybrid (e.g. Intel + NVIDIA) laptop when an external display is connected at boot.Instead, enumerate every connector via
resource_handles()and treat a device as holding the built-in panel only when an internal-interface connector reportsConnectorState::Connected. A device that fails to report resource handles is skipped rather than aborting selection for all devices. Preserves the existingCOSMIC_RENDER_DEVICE, boot-gpu and first-device fallbacks unchanged.Adds trace/info logging of which connectors were considered and why a GPU was chosen, plus a unit test for the internal-panel predicate.
This mirrors the approach of the upstream branch
fix-check-all-connectors_noble(9c95ebf, Victoria Brekenfeld); it is a candidate for pop-os/cosmic-comp issue #3751 and does not claim to resolve every report in that issue (a single-GPU report is unlikely to be affected by primary-gpu selection).