Skip to content

drm/apple: take a panel's zero refresh range as no range on firmware 27 too - #3369

Closed
RyanTheTide wants to merge 5 commits into
mainfrom
fix/dcp-panel-vrr-range
Closed

RyanTheTide wants to merge 5 commits into
mainfrom
fix/dcp-panel-vrr-range

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What

The K114s's internal ProMotion panel (firmware 27.2) offers no adaptive sync: vrr_capable stays 0, and GNOME offers no variable refresh rate. The J616s (desktop 26.x) offers it on every panel mode.

Both firmwares list the panel's variable refresh range as zero placeholders. On the K114s's 120 Hz timing, MinimumVariableRefreshRate and MaximumVariableRefreshRate are both present and 0 (debugfs vrr_range 0/0). The driver already reads an internal 120 Hz timing that has no range as variable down to 24 Hz (dcp_refresh_range()), but zeros counted as "no range" only for desktop 26.x, so on firmware 27 the timing stayed fixed.

This takes zeros as no range on every firmware (no firmware-version gate). Only an internal ProMotion timing then gets a range; external timings and 60 Hz panels stay fixed. Consequence for firmware 13.x ProMotion panels (J314/J316): if their 120 Hz timing sends zero placeholders, it now gets the 24-120 Hz range as macOS gives it; timings with a real range are unchanged. They can't be rowed here (our only one is headless).

Tested

Tested: K114s (T6050, firmware 27.2) with this change in a test kernel (main + this + linux#3367 + #2798): vrr_capable 1, vrr_range 24-120, set_digital_out_mode ... vrr:1, and GNOME's Mutter runs the panel at [email protected]+vrr.

  • Before (kernel 7.3.0-42, same DT): vrr_capable 0, vrr_range 0/0, set_digital_out_mode ... vrr:0, Mutter mode [email protected].
  • An external Acer on DP-2 (dcpext0) stays vrr_capable 0: external timings are untouched.
  • KUnit (display.kunitconfig + CONFIG_DRM_APPLE_KUNIT_TEST=y, arm64) at ff66aef1: 373 tests, 372 passed, 1 skipped. parser_vrr_empty_range is updated in the second commit: it expected the zero placeholders to give a range on desktop 26.x only.

Risk: two-way · internal 120 Hz ProMotion panels on non-desktop firmware: firmware 27 (K114s, J714s, other T6050) and older laptop firmware such as 13.5 (M1 Pro/Max J314/J316), if they send zero placeholders

Not yet

  • A K114s row at this head: the condition is true on firmware 27 exactly as at ff66aef1 (rowed), but iomfb.c changed, so a row at the new head is owed (next K114s window). Ryan's default (the bridge) runs without this today: vrr_capable 0.
  • Firmware 13.x ProMotion (J314/J316) and J714s/J716c/M5 Max rows (Dj asked).
  • KREVIEW: a K114s row at head under a variable-rate load (~10 min) + one s2idle, 0 DCP crashes.

…27 too

The K114s's internal ProMotion panel (firmware 27.2) offers no adaptive
sync: vrr_capable stays 0 and GNOME has no variable refresh, while the
J616s (desktop 26.x) offers it on every panel mode.

Both firmwares list the panel's variable refresh range as zero
placeholders (the K114s's 120 Hz timing: MinimumVariableRefreshRate
and MaximumVariableRefreshRate both 0), and the driver already reads an
internal 120 Hz timing without a range as variable down to 24 Hz. The
zeros counted as "no range" only for desktop 26.x, so on firmware 27
they left the timing fixed.

Take zeros as no range for every firmware. Only an internal ProMotion
timing then gets a range (dcp_refresh_range()); external timings and
60 Hz panels stay fixed.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 27, 2026 08:33
parser_vrr_empty_range expected the panel's zero placeholders to give a range on desktop 26.x only. With the previous commit they give one on every firmware: an internal ProMotion timing gets 24-120 Hz either way.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide marked this pull request as draft November 27, 2026 08:36
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J616s regression row (M4 Pro, desktop 26.x firmware, known-gamut mini-LED panel). Test kernel 7.3.0-j6disp = main + linux#3367 (6522d8db) + linux#3369 (ff66aef1) + #2798 (a5ee0c10), merged as d8cf3fe8e04be5. The J616s's fleet89 config, trimmed to its loaded modules; its own Stage 2 and DTB; a GRUB one-shot, then a plain reboot back to fleet89. Before = fleet89 on the same machine, read the same way:

fleet89 with the three PRs
eDP-1 modes 6 (3456x2234 at 120/60/59.94/50/48/47.95) 6 (same)
EDID primaries R/G/B/W, gamma 0.6797,0.3203 / 0.2646,0.6904 / 0.1504,0.0596 / 0.3125,0.3291, 2.20 identical
EDID name Apple Panel Apple Panel
P3 fallback message none (the ADT names a known gamut) none
vrr_capable, vrr_range 1, 24-120 1, 24-120
Colorspace / Mutter colour modes 9 / [0, 2, 1] 9 / [0, 2, 1]
PQ_REFERENCE_LUMINANCE 100 203 (the intended change in #3367)
EDR headroom / peak 16 / 1600 nits 16 / 1600 nits
DCP/DRM error lines, failed units 0, 0 0, 0

Files: traces/display/20261127-k114s-dcp/j616s-fleet89-before.txt and j616s-j6disp-after.txt (lab store).

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

On older-firmware ProMotion panels: our only firmware-13.x ProMotion laptop, the M1 Pro J316s, is headless (eDP-1 disconnected on fleet89), so we can't row that path here. The change only matters where a panel's 120 Hz timing carries zero MinimumVariableRefreshRate and MaximumVariableRefreshRate. Rows so far: K114s (firmware 27, gains VRR 24-120) and J616s (desktop 26.x, unchanged). @DjDeveloperr: could your J714s, or an M1/M2 Pro/Max MacBook Pro, give one row (vrr_capable, the mode list, /sys/kernel/debug/dri/*/eDP-1/vrr_range)? Or, if you know these firmwares send real ranges, say so and this can come out of draft.

… firmware 27

Firmware 13.x ProMotion panels can't be checked here (the only one in
the lab is headless), so leave them as they were: zeros stay a range
there.  Desktop 26.x and firmware 27, where both zero placeholders were
seen (J616s, K114s), take them as no range.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 28, 2026 02:31
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Narrowed (4a71e467): the zero-range convention now applies to desktop 26.x and firmware 27 only; firmware 13.x keeps zeros as a range, as before. That removes the open question about the 13.x ProMotion panels (we can't row them). On the J616s and K114s rows the condition is true exactly as before. KUnit 372/373 (+1 skip), with parser_vrr_empty_range now covering 13.5 (no range), 26.6 desktop and 27 (24–120 Hz); apple-dcp host tests 96/96. A K114s row at this head is owed for the next window.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at 4a71e467 (K114S-STACK, adversarial; not an approval yet).

Checked:

  • The logic is right for the two firmwares it names. zero_vrr_range_fallback now also holds on firmware 27, so the K114s's 120 Hz timing (Min/MaxVariableRefreshRate both 0) reaches dcp_refresh_range() and gets 24-120.
  • External timings stay fixed, because the fallback only applies to internal ProMotion timings.
  • The KUnit loop now covers 13.5, 26.6 desktop and 27.0.

Blocking question (project rule: no chip/board/firmware-version gates):

  • This widens a firmware-version gate (fw_compat == 26_6_DESKTOP || == 27_0) instead of removing it. Firmware 13.x keeps "zeros = a 0..0 range" only because it can't be checked here.
  • What does a 0..0 range do on 13.x today? If it already means "no VRR" (vrr_capable 0), then treating zeros as "no range" on every firmware is the same rule everywhere. The only change on 13.x would be that an internal 120 Hz timing gets the default 24-120 range, which is exactly what this PR asserts is right for ProMotion panels.
  • So either drop the version test (one rule for all firmware, with that 13.x consequence stated in the commit), or say concretely why 13.x zeros mean something different. A J314/J316 row or a 13.x timing dump would settle it.

Owed either way: a K114s row at this head (iomfb.c changed since the rowed ff66aef). I'll carry this in the next K114s bridge build so the default-boot checklist provides that row: vrr_capable, debugfs vrr_range, Mutter mode.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge, at 4a71e467d4af. No blockers in the code; the K114s row at this head needs to cover VRR actually varying.

Before merge:

  1. K114s row at this head that exercises VRR, not just enables it. The earlier row shows vrr_capable 1, range 24–120, set_digital_out_mode ... vrr:1 and Mutter at @120.000+vrr, but not the panel running below 120 Hz. This is the T6050 internal DCP that crashes on a mode set away from the boot timing (#3427), so please show about 10 minutes of a variable-rate workload with VRR on: a full-screen client presenting at, say, 30/48/90 fps (or a 24 fps video in a VRR-aware player), plus the idle desktop, with 0 DCP has crashed, the panel lit, and the rate seen to change (debugfs or the swap timestamps). Add one s2idle cycle with VRR on.
  2. Reach: this applies to every firmware-27 internal ProMotion panel, not only the K boards: the J714s/J716c (and J714c/J775c) mini-LED MacBook Pros gain VRR too, including the M5 Max DCP that only_120hz_modes came from. Nobody here has rowed those. @DjDeveloperr, one J714s row (vrr_capable, vrr_range, a few minutes of variable-rate content, no DCP errors) would settle it. If that can't happen, say so in Not yet.

Checked:

  • The change is one condition: zero_vrr_range_fallback now holds for desktop 26.x and firmware 27; firmware 13.x keeps zeros as a range, unchanged.
  • With the fallback, only an internal 120 Hz ProMotion timing gets a range (dcp_refresh_range()), so external timings stay fixed (the Acer on DP-2 stays vrr_capable 0 in the row) and the 60 Hz M5 Air panel is unaffected.
  • Interaction with #3427, now in main: after a 60 Hz handover only the 60 Hz timing is offered, and it gets no range, so a VRR mode never asks the T6050 DCP for a mode it didn't boot with.
  • KUnit parser_vrr_empty_range covers 13.5 (no range), 26.6 desktop and 27 (24–120). J616s regression row: modes, EDID, VRR range and colour unchanged.
  • No attribution.

…26.x and firmware 27"

Review (no firmware-version gates): take zero refresh-range placeholders
as no range on every firmware.  On a firmware 13.x ProMotion panel that
sends zeros, the internal 120 Hz timing then gets the 24-120 Hz range,
as macOS gives it; timings with a real range are unchanged.

This reverts commit 4a71e46.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Per review (no firmware-version gates): reverted the narrowing (8305dff9). Zeros are no range on every firmware again, and the body states the 13.x ProMotion consequence (24–120 Hz on a zero-placeholder 120 Hz timing, as on macOS; real ranges unchanged). KUnit 372/373 (+1 skip). The K114s row at head (variable-rate load ~10 min + s2idle, 0 DCP crashes) comes with K114S-STACK's bridge v2 or the next K114s window.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge, at 8305dff9852d (same as my review at 4a71e467, plus one point from the revert).

Reverting the narrowing removes the firmware gate, which fits the no-gates rule, and the new code is the one condition from 466cdb00. It also widens the reach: any internal 120 Hz ProMotion timing with zero placeholders now gets 24–120 Hz on every firmware, including the firmware-13.x M1/M2 Pro/Max MacBook Pros, which nobody here can row (the J316s is headless). That's fine if those firmwares either send real ranges (then nothing changes) or behave like the J616s and K114s.

Before merge, in addition to my earlier review:

  1. The K114s row at this head with VRR under a variable-rate load (unchanged ask).
  2. One row, or a clear statement in Not yet, for a firmware-13.x ProMotion panel: vrr_range before/after and a few minutes of variable-rate content with no DCP errors. @DjDeveloperr or anyone with an M1/M2 Pro/Max MacBook Pro. The J714s ask from my earlier review stands for firmware 27.

Checked: 8305dff9 reverts 4a71e467 exactly (the diff against main is 466cdb00 + ff66aef1: the condition set for every firmware, and the KUnit expectation of a range on every firmware). No attribution.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

K114s row at 8305dff (partial). One-shot on Ryan's bridge kernel (7.3.0-k114sstack) with appledrm.ko = bridge + this change only; panel handed over at 120 Hz.

  • VRR: vrr_capable 1 and vrr_range 24–120 (the same kernel without this change: 0 and 0/0); set_digital_out_mode ... vrr:1.
  • Load: 10 rounds of ~50 s vkmark (fifo) on the GNOME greeter, 0 DCP crashes, no failures.
  • s2idle (rtcwake -m freeze -s 30): the machine did not come back. It stayed off the network until a VDM reboot 37 min later, and the default came up clean. The journal didn't keep anything past boot, so it's unknown whether it hung or never got the RTC wake. A control (the same rtcwake on the same kernel without this change) is next; until then, s2idle under this change counts as not yet shown.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Update on the s2idle part of the row above: the K114s can't wake from s2idle on an RTC alarm at all (known gap: no PMU alarm IRQ on this board yet, per the K114s window owner). So the missing wake was the test method, not this change. The s2idle part will be redone with a key/lid wake on the bridge build that carries this PR; the VRR and load parts stand.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 8305dff9: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 8305dff9, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · internal 120 Hz ProMotion panels on non-desktop firmware: firmware 27 (K114s, J714s, other T6050) and older laptop firmware such as 13.5 (M1 Pro/Max J314/J316), if they send zero placeholders Not yet - A K114s row at this head: the condition is true on firmware 27 exactly as at ff66aef1 (rowed), but iomfb.c changed, so a row at the new head is owed (next K114s window). Ryan's default (the bridge) runs without this today: vrr_capable 0. - Firmware 13.x ProMotion (J314/J316) and J714s/J716c/M5 Max rows (Dj asked). - KREVIEW: a K114s row at head under a variable-rate load (~10 min) + one s2idle, 0 DCP crashes.

Areas: area:display

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

K114s row on the merge result (bridge4, 7.3.0-k114sstack3 = main 68253d5 + #3369 + other open K PRs; Stage 2 1.0.0b17-ge2a8cf96), 2026-11-28 23:28, fresh boot, read-only: eDP-1 vrr_capable 1, vrr_range Min 24 / Max 120, 0 DCP has crashed, backlight apple-panel-bl present (1000/1000), 0 failed units. PASS for the VRR exposure at boot on the merge result. The s2idle + key-wake part rides K114S-TOUCH's Ryan sleep slot on this same bridge4 boot, with my VRR snapshot before and after the wake; I'll post it when it runs. Our trace: traces/display/20261128-k114s-3502-row/k114s-bridge4.txt

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blocker found, please don't merge yet. On the K114s (bridge4 = main + this PR + other open K PRs), relighting the internal panel with VRR_ENABLED=1 crashes the internal DCP. Measured 2026-11-29 with gdm stopped and an atomic CRTC on/off/on tool:

  • VRR_ENABLED=1: crashed on the first relight, 2 of 2 runs;
  • VRR_ENABLED=0: 0 crashes in 10 relights;
  • this PR reverted: 0 crashes in 10.

The firmware-27 modeset sends adaptive sync minRR 24 Hz, then set_device_enabled 0->1, a DPTX FIFO error interrupt and the co-processor crash. This is the intermittent shutdown crash on that kernel: fbdev relights the panel with mutter's leftover VRR_ENABLED=1. The shutdown A/B was control 1/5, revert 0/6. A VRR modeset on a panel that is already lit does not crash. I'll fix it here: on firmware 27, light from off with minRR 0 and apply the VRR minimum once the mode is live. Then a new hardware row (relight loop + shutdowns + the earlier VRR rows). Our trace: traces/display/20261129-k114s-shutdown-dcp-crash/README.md

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Correction to my blocker above, after reading the whole crashed session's log. On that 28-minute boot VRR was never active. The only modeset, at boot, sent adaptive sync minRR 0 ("Already set to timingID"), because firmware-27 panels don't re-modeset on a VRR_ENABLED change. The shutdown modeset, with fbdev inheriting VRR_ENABLED=1, was the first to send a nonzero minimum (24 Hz). The firmware tore the link down to apply it (set_device_enabled 1->0->1) and crashed on the relight. So with this PR, any modeset that turns adaptive sync on for the K114s (fw27) panel crashes the internal DCP, and the K114s VRR row I posted earlier only showed vrr_capable and the range, not VRR actually working. I withdraw that row. Until we know how macOS enables ProMotion VRR on firmware 27 (a guest trace), this PR shouldn't advertise VRR on fw27 panels. I'll either narrow it so fw27 panels keep vrr_capable 0 (no behaviour change; the range parsing stays for desktop 26.x) or close it, and I'm asking for the trace. traces/display/20261129-k114s-shutdown-dcp-crash/README.md (correction section).

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Closing. Narrowing this so firmware-27 panels keep vrr_capable 0 would revert its only line: desktop 26.x already takes zero placeholders as no range. So nothing would be left. Firmware-27 ProMotion VRR needs the right enabling sequence first: sending adaptive sync through the modeset crashes the K114s internal DCP (see the two comments above). The branch stays; a new PR follows once a macOS guest trace shows how fw27 turns VRR on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant