drm: apple: support ProMotion variable refresh rate - #3
Merged
Merged
Conversation
DCP exposes an adaptive-sync parameter taking a minimum refresh rate, a media target rate and a fractional rate. Program it during modesets and report the panel's range through the standard vrr_capable connector property, so userspace drives VRR through the atomic VRR_ENABLED CRTC property rather than a driver-specific knob. The swap path previously wrote a constant 120 into the three timestamp fields to hold the internal panel at its maximum rate. Replace that with architectural counter timestamps taken at swap submit and at present, which is what the firmware needs in order to vary the rate at all. An internal ProMotion panel carries no EDID or DisplayID, so DCP reports no adaptive-sync range for it. Assume the ProMotion floor of 24 Hz up to the rate the mode itself advertises. Key that off the connector type from the device tree rather than the main-display flag, which is filled in by an asynchronous response and is not reliably set by the time the timing elements are parsed. External displays keep the range DCP reports, and a reported range is only believed when its maximum exceeds its minimum. Fill in display_info.monitor_range as well. Nothing else populates it for a panel with no EDID, so without it the range is missing from debugfs and from anything else that reads it. Signed-off-by: DjDeveloperr <hey@djdev.me>
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.
ProMotion variable refresh rate on the internal panel, on top of #2.
DCP exposes an adaptive-sync parameter taking a minimum refresh rate, a media target rate and a fractional rate. This programs it during modesets and reports the panel's range through the standard
vrr_capableconnector property, so userspace drives VRR through the atomicVRR_ENABLEDCRTC property rather than a driver-specific knob.The timestamp hack goes away
The swap path wrote a constant
120into all three timestamp fields to pin the internal panel at its maximum rate — the tree flags this as a HACK today. It is replaced with architectural counter values taken at swap submit and at present, which is what the firmware needs in order to vary the rate at all. That change stands on its own merit whether or not VRR is enabled.Where the range comes from
An internal ProMotion panel carries no EDID or DisplayID, so DCP reports no adaptive-sync range for it. The driver assumes the ProMotion floor of 24 Hz up to the rate the mode advertises, keyed off the connector type from the device tree rather than the main-display flag — that flag is filled in by an asynchronous response and is not reliably set by the time the timing elements are parsed. External displays keep whatever range DCP reports, and a reported range is believed only when its maximum exceeds its minimum.
display_info.monitor_rangeis filled in too. Nothing else populates it for a panel with no EDID, so without it the range is missing from debugfs and from anything else that reads it.Known gap
GNOME will not drive VRR on the internal panel: mutter needs a refresh-rate range through uAPI that does not exist yet. The right fix is a range property upstream, not a driver-side workaround — synthesising a fake EDID to smuggle two integers past the uAPI gap would break EDID-based quirk matching and mislead every userspace consumer. That is a mutter/uAPI limitation rather than something this driver should paper over.