Skip to content

drm/apple: v14.7: offer a locked 60 Hz mode beside variable refresh - #3800

Merged
DjDeveloperr merged 3 commits into
mainfrom
feat/v14-locked-60hz
Dec 2, 2026
Merged

DjDeveloperr merged 3 commits into
mainfrom
feat/v14-locked-60hz

Conversation

@maralcbr

@maralcbr maralcbr commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Offer a locked 60 Hz mode beside the 120 Hz variable-refresh mode on ProMotion panels using the v14.7 display path when the board stamps swap timing words.

Commits

  1. Preserve Ilyas Akin's original commit (c41855ae2ce78c2797cffd975aafaacccea82504) adding the locked 60 Hz mode alongside 120 Hz VRR on swap-stamping v14.7 ProMotion panels (addresses drm/apple: 14.7 internal panels expose only one mode (no 60 Hz, no VRR) #1633).
  2. Follow-up hardening:
    • Enable ctx.zero_vrr_range_fallback for swap-stamping ProMotion boards so 14.7 firmware's zero VRR placeholders are admitted by the parser, and require best->vrr before splitting the 120 Hz mode so a timing whose VRR range was rejected by the mode parser is never split or forced to advertise vrr_capable.
    • Clear min_vrr/max_vrr on the locked 60 Hz mode and hold dcp->v14->lock around v14->timed updates in iomfb_v14_7_modeset() to serialize cleanly with concurrent dcp_v14_swap_locked() calls (including dcp_v14_backlight_work() swaps).
  3. Add dcp_v14_locked_mode KUnit suite (drivers/gpu/drm/apple/iomfb_v14_7_locked_mode_test.c) covering admitted 120 Hz VRR timings (both 14.7 zero placeholders and explicit 48..120 Hz range), parser-rejected VRR ranges (out-of-bounds, partial, inverted), non-stamping ProMotion boards (J504), split swap timestamp toggling, and unchanged non-split 60 Hz stamping behavior.

Tested: MacBook Pro 14-inch (M3 Pro, j514s) at b1202-001035-53b6 (job j1202-001502-d4b3) and MacBook Pro 16-inch (M3 Max, j516c) at b1202-103918-3651 (job j1202-104500-6229): modetest -M apple -c -p and hyprctl monitors -j advertise both 120 Hz (vrr_capable: 1) and locked 60 Hz with zero DRM errors; dcp_v14_locked_mode KUnit suite runs in CI; strict checkpatch clean.
Risk: two-way · drm/apple v14.7 internal ProMotion mode splitting and swap timestamping

@maralcbr
maralcbr requested review from a team as code owners December 1, 2026 15:11
@maralcbr
maralcbr requested review from Acelogic and malik-na and a balanced review from Copilot December 1, 2026 15:11

Copilot AI 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.

🟡 Changes recommended

The new mode-splitting and timestamp-selection behavior lacks KUnit regression coverage for admitted and rejected VRR timings, non-stamping boards, and split versus non-split timestamp behavior.

1 open issue
What changed in this PR

This PR adds a locked 60 Hz option alongside 120 Hz variable refresh for eligible ProMotion panels using the v14.7 display path, addressing part of #1633 while retaining the firmware’s boot timing.

Changes:

  • Split eligible 120 Hz modes into variable-refresh and locked 60 Hz options only when the parser accepts VRR.
  • Disable swap timestamps for the locked mode.
  • Serialize timestamp-state updates with concurrent swaps using the existing mutex.
File Description
drivers/​gpu/​drm/​apple/​iomfb_v14_7.c Adds guarded mode splitting and synchronized, mode-dependent swap timestamp control.

Review effort: Balanced

Comment on lines +2694 to +2696
split = v14->board->promotion && best->vrr &&
drm_mode_vrefresh(&best->mode) == 120 &&
dcp_v14_board_stamps_swaps(v14->board, false);
@github-actions github-actions Bot added area:display Area from CODEOWNERS (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 Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at ea3abe99: ready to merge

Check Detail
CI at head ok 10 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at ea3abe99
Conflicts ok none
PR text ok Risk: two-way · drm/apple v14.7 internal ProMotion mode splitting and swap timestamping

Areas: area:display
Merge: gh pr merge 3800 --merge (Owners and Core through the bypass: add --admin).

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

ilyasakin and others added 3 commits December 2, 2026 11:58
A ProMotion panel on the 14.7 path has a single 120 Hz timing (one
"timing 1/1" on a J514S), so GNOME, KDE and Hyprland offer only 120 Hz,
with no way to run the panel at 60 Hz.

On a board whose swaps carry timing words, offer it as two modes, as
the 26.6 path does: the 120 Hz timing as the variable-refresh mode, and
the same timing as a locked 60 Hz mode whose swaps carry none, which
the firmware then shows at 60 Hz. The firmware keeps its boot timing
either way, so switching modes sends nothing to it and the panel never
blanks. Boards that don't stamp swaps keep their single mode: both modes
would send the same swaps there. Swaps stay timed unless the locked mode
is set, so a stamping board keeps its timing words whatever its best
timing.

On a J514S (MacBook Pro 14", M3 Pro), with the desktop idle (0.1
swaps a second), the variable-refresh mode draws 7.88 W and the locked
60 Hz mode 8.45 W: the panel lowers its refresh rate when no swaps
come. glmark2 with FIFO runs at 120 and 60 FPS in the two modes.

Link: #1633
Signed-off-by: Ilyas Akin <ashnwor@gmail.com>
Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
…erialize timed updates

Live testing on a 14-inch M3 Pro (J514S) showed that v14.7
PreferredTimingElements publishes zero VRR range placeholders (matching
13.5 firmware in #3611 and desktop 26.6), leaving best->vrr false unless
ctx.zero_vrr_range_fallback is enabled. Enable zero_vrr_range_fallback
for swap-stamping ProMotion boards, require best->vrr before splitting
the 120 Hz mode so a parser-rejected VRR timing is never split or forced
to advertise VRR, preserve the parser's exact min_vrr/max_vrr on the
120 Hz mode while clearing them on the locked 60 Hz copy, and select
timed vs untimed swaps in iomfb_v14_7_modeset() by refresh rate under
v14->lock.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Add the dcp_v14_locked_mode KUnit suite included in iomfb_v14_7.c to
cover the production dcp_v14_mode(), iomfb_v14_7_modeset(), and
dcp_v14_swap_locked() paths:
- Admitted 120 Hz VRR timing with 14.7 zero VRR placeholders and with an
  explicit 48..120 Hz VRR range: verifies mode splitting, VRR metadata
  preservation/clearing, and modeset toggling of swap timestamps.
- Parser-rejected VRR ranges (out-of-bounds, partial, inverted):
  verifies no split, vrr left false, and unchanged stamped swaps.
- Non-stamping ProMotion board (J504) with zero and explicit VRR ranges:
  verifies no split and unstamped swaps.
- Non-split 60 Hz timing on a stamping board: verifies locked_mode stays
  false and swaps stay stamped across modesets.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
@maralcbr
maralcbr force-pushed the feat/v14-locked-60hz branch from d738aa4 to ea3abe9 Compare December 2, 2026 02:10
@maralcbr

maralcbr commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback:

  • Added the best->vrr guard to split in dcp_v14_mode() (7be627e727ce) so parser-rejected VRR timings are never split or forced to advertise VRR.
  • Added the dcp_v14_locked_mode KUnit suite in drivers/gpu/drm/apple/iomfb_v14_7_locked_mode_test.c (ea3abe99b84a), covering:
    • admitted 120 Hz VRR with 14.7 zero VRR placeholders and explicit 48..120 Hz range,
    • parser-rejected VRR ranges (max above mode rate, zero min with non-zero max, inverted range, partial key),
    • non-stamping ProMotion board (J504) with zero and explicit VRR ranges,
    • split modeset toggling of A(407) swap timestamp slots 0, 1, 6,
    • non-split 60 Hz VRR timing preserving locked_mode = false and stamped swaps.
  • CI: KUnit dcp-fabric dcp-topology dcp-display (12m9s), apple-build, and host-tests all pass.
  • Live hardware verification on aurora-silicon/main (b1202-121643-a0b0, job j1202-122310-8341 on 14-inch M3 Pro j514s): modetest and Hyprland advertise 3024x1964@120.00Hz (vrrCapable: true) and locked 3024x1964@60.00Hz; live modeset 120 -> 60 -> 120 Hz and combined 10-bit XRGB2101010 at 120 Hz & 60 Hz passed (7/7) with zero DRM warnings.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed ea3abe9. Offering the 120 Hz ProMotion timing a second time as a locked 60 Hz mode whose swaps carry no timing words matches the 26.6 path, the split needs an admitted VRR range, and the timed flag is updated under the v14 lock that the swap path holds. Only the stamping boards (T6030 J514s/J516s and J516c) take the new path, and both chips were run. Note that zero_vrr_range_fallback also makes the 120 Hz mode VRR-capable on those boards, which the J514s/J516c runs show working in Hyprland.

For merge, the row needs to name the head: please add a line to the PR with the head SHA, the Mac and the result (the readiness check looks for that), saying whether the b1202-121643-a0b0 build carried ea3abe9 unchanged or together with #3801.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merge status: one item left, a hardware line that names the head.

The merge with current main builds clean (below). main changed iomfb_v14_7.c after this branch's base (a342786), but only the boot-panel height read from chosen.asahi,show-notch, not the mode-split or swap paths this PR changes.

The review's open item still stands. Please add one line naming the head SHA, the Mac and the result of the 120 Hz VRR plus locked 60 Hz check. Also say whether build b1202-121643-a0b0 carried this head unchanged or together with #3801.

Local checks on the merge result (hosted CI stand-in)
  • Head ea3abe99b84a merged into main 5a870d0f0b3f: clean merge, tree 341f3f4ba1ce.
  • arm64 LLVM=1 asahi config plus CONFIG_KUNIT=y, CONFIG_DRM_APPLE_KUNIT_TEST=m, CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST=y; make W=1 modules_prepare drivers/gpu/drm/apple/: 0 errors, 0 warnings in drivers/gpu/drm/apple/ (iomfb_v14_7.o built with the new KUnit file included).
  • The KUnit suites run on arm64 QEMU. They passed in hosted CI at this head and were not re-run locally.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J516s (M3 Pro, T6030) hardware row at exact unchanged head ea3abe99b84a1f2f2d52cfdd0b46ee6e72466f7a: PASS.

  • Kernel: plain git merge --no-ff of main ea0d384f65e5604f80f2ef527c8479c144bc7f31 + exact #3800 head ea3abe99b84a1f2f2d52cfdd0b46ee6e72466f7a (merge commit 9e0e2ce4171c703429534501be9b9793ced5efef, merge tree ef3eb8f80e2ada9c3f94c4b3a3e423e572bf89b4, release 7.3.0-m3-pr3800-ea3abe99+).
  • Boot: one-shot asahi-bless --next to J516s's legacy 14.8.3 Aurora Alarm stub (os-fw 14.7 / DCP v14.7 internal panel, iBoot-10151.140.19.700.2, boot_id=187d960e-103a-463d-a653-e17f2940d81c, default Arch cmdline + panic=10 trial safety).
  • modetest -M apple -c (eDP-1, connector 41, 346x223 mm):
    • #0 3456x2234 120.00 (clock 1042130, type: preferred, driver) with vrr_capable=1
    • #1 3456x2234 60.00 (clock 521065, type: driver)
  • Modeset 120 -> 60 -> 120 swap completions (modetest -M apple -s 41@39:#0/#1/#0 -v, plasmalogin.service paused/restarted):
    • 120 Hz (#0): steady 119.97 Hz (~8.34 ms/swap; range 119.96–119.98 Hz)
    • 60 Hz (#1): steady 59.99 Hz (~16.67 ms/swap; range 59.98–59.99 Hz)
    • 120 Hz (#0): steady 119.98 Hz (~8.33 ms/swap; 8/8 intervals 119.98 Hz)
  • Errors & health: 0 DCP/DRM errors, 0 kernel errors/WARNs/Oops (dmesg --level=err,crit,alert,emerg empty), plasmalogin.service active after test (speakerguardd-v2-switchtest.service failed its unrelated local hw:AppleJ516,1 pcm_write self-check on the legacy 14.8.3 stub; 0 other failed units).
  • Stock return: cleaned temporary kernel/initramfs/GRUB entries and rebooted cleanly to default Aurora 27.2 stub + stock 7.3.0 (boot_id=f060d74f-05b3-4d25-b6aa-720035ee79dd, 12/12 CPUs, eDP-1 connected, 0 failed units).

@DjDeveloperr DjDeveloperr removed the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@github-actions github-actions Bot added the ready-to-merge Meets the merge policy: merge it (bot) label Dec 2, 2026
@DjDeveloperr

DjDeveloperr commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Local qualification for ea3abe99b84a on main 30c1870074ca (merge tree b0d5a8445cbd). The two changed v14.7 files are byte-identical to the J516s hardware merge tree. J516s result

~/bin/aurora-build ./linux-build/build kernel --profile asahi linux-pc-edge-pr3897-8616760 -- -j8 W=1 drivers/gpu/drm/apple/ drivers/gpu/drm/apple/appledrm.o passed. iomfb_v14_7.o compiled and appledrm.o linked. With KUNIT=y and DRM_APPLE_DISPLAY_KUNIT_TEST=y, llvm-nm confirmed v14_lm_suite in the linked object. The only build diagnostic was the unrelated audio fixture DTC warning.

Dispatched apple-build-kunit.yml with suites=dcp-display on the exact merge candidate 49596e9ace2a. The dcp_v14_locked_mode runtime result is pending. Current-tree KUnit run

KUnit runtime: built, not run (arm64-only, no QEMU)

@DjDeveloperr
DjDeveloperr merged commit 9368e93 into main Dec 2, 2026
13 of 15 checks passed
@DjDeveloperr
DjDeveloperr deleted the feat/v14-locked-60hz branch December 2, 2026 15:45
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) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants