Repository navigation
drm/apple: Default to native refresh on panels and native resolution at full refresh on external displays - #562
Merged
Conversation
GNOME brings the J616s panel up at 60 Hz with a fixed refresh whenever it makes a new monitor configuration: it takes the mode the kernel marks preferred. The panel's firmware ranks its 120 Hz timing first (IsPreferred, highest score), and the parser marks that one, but the takeover trial set the boot-like 60 Hz mode first and then moved the preferred mark to whichever mode it accepted, so 60 Hz it always was. Try the preferred mode first and the boot-like one only if it fails. The mode that worked stays the preferred one, as before, and is now the panel's native 120 Hz. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…resh An external display came up in the timing its EDID lists first: the firmware marks that timing IsPreferred, and the parser preferred IsPreferred timings, then the highest score. On an Acer QG270 S3 that is 1920x1080 at 60 Hz of a 180 Hz panel; an MSI MPG 325CQRXF marks 1920x1080 at 240 Hz and 2560x1440 at 60 Hz, and the score picks 1920x1080 for a 2560x1440 panel. Default an external display to its native resolution at the highest refresh rate it can take, as other systems do: the native resolution is the largest the firmware marks IsPreferred (the largest of all when it marks none), and among its timings the higher refresh rate ranks first, then IsPreferred, then the firmware score. A timing whose SDR color elements are all unsafe or DSC only is never the default. Panels keep the timing their firmware prefers. The host selftests cover the three cases with synthetic catalogs modelled on both displays and a panel. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The detailed timing of a firmware-derived EDID was the preferred mode, accepted only when the firmware marks that timing IsPreferred and describes it fully. Now that an external display defaults to its native resolution at its highest refresh rate, the preferred mode is often a timing the firmware does not mark, and the EDID was not built at all: an MSI MPG 325CQRXF defaulting to 2560x1440 at 280 Hz came up with no EDID. Take the preferred mode when it qualifies, otherwise the highest-scored timing the firmware marks IsPreferred, the one the sink's own EDID lists first. The EDID describes the sink; the mode set is unaffected. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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.
On the J616s, GNOME brings the internal panel up at 60 Hz with a fixed refresh whenever it creates a new monitor configuration, for example after a display is plugged in. Mutter's default configuration uses the fixed-rate variant of the mode the kernel marks preferred; the VRR default is aurora-silicon/fedora-aurora#41.
Cause. The panel's firmware ranks its 120 Hz timing first (IsPreferred, score 17026 vs 15523 for 60 Hz), and the parser marks it preferred. The desktop 26.6 takeover trial (from the T6041 panel bring-up, c7a3e09) then tries the boot-like mode first, which is 60 Hz because the boot loader runs the panel at 60 Hz. It moves the preferred mark to whichever mode it accepts, so 60 Hz was always preferred.
Fix. Try the preferred mode first, and the boot-like mode only if it fails. The trial's guarantee is unchanged: the mode proven at takeover is still the one marked preferred, and the console and a desktop pick it. That mode is now the panel's native 120 Hz. Nothing changes for other machines, since the trial only runs for a desktop 26.x panel.
Second commit: external displays default to native resolution at full refresh. The firmware marks the EDID's first timing IsPreferred, so displays came up there: an Acer QG270 S3 at 1920x1080@60 of a 180 Hz panel, and an MSI MPG 325CQRXF at 1920x1080@240 of a 2560x1440 panel. The default is now the native resolution (the largest IsPreferred one, or the largest of all) at its highest refresh rate. Ties go to IsPreferred, then the firmware score, and a timing whose SDR elements are all unsafe or DSC-only is never the default. Panels keep their firmware's preference. This is a shared rule for all external processors on every machine.
Third commit: firmware-derived EDID timing. With the new external default, the preferred mode is often not an IsPreferred timing, and the firmware-derived EDID builder (#530) then built no EDID (names lost). The EDID's detailed timing now uses the preferred mode when it qualifies, otherwise the highest-scored IsPreferred timing, the one the sink's own EDID lists first.
Hardware (J616s, fleet6 + this PR + #561):
Not in this PR. VRR on by default: mutter 51 has no default-VRR setting. A new configuration always takes the fixed variant, and in variable mode mutter only sets
VRR_ENABLEDwhile a fullscreen surface is the scanout candidate. That needs a decision on the userspace side.Tests. apple-dcp host selftests 80/80, with synthetic catalogs modelled on the Acer, the MSI (including an unsafe-only 300 Hz timing that must not win) and a panel. A deliberately wrong expectation fails, so the checks are live. drm/apple KUnit (qemu arm64): 178 passed, 1 skipped (needs CONFIG_UCLAMP_TASK).
🤖 Generated with Claude Code