Skip to content

drm: apple: support ProMotion variable refresh rate - #3

Merged
DjDeveloperr merged 1 commit into
tbfrom
vrr
Sep 12, 2026
Merged

DjDeveloperr merged 1 commit into
tbfrom
vrr

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Sep 5, 2026

Copy link
Copy Markdown

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_capable connector property, so userspace drives VRR through the atomic VRR_ENABLED CRTC property rather than a driver-specific knob.

The timestamp hack goes away

The swap path wrote a constant 120 into 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_range is 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.

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>
@DjDeveloperr DjDeveloperr changed the title ProMotion variable refresh rate drm: apple: support ProMotion variable refresh rate Sep 12, 2026
@DjDeveloperr
DjDeveloperr merged commit 44f2be4 into tb Sep 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant