Skip to content

drm/apple: offer a firmware 27 ProMotion panel's fixed rates as paced modes - #4059

Open
RyanTheTide wants to merge 2 commits into
mainfrom
fix/dcp-fw27-paced-fixed-modes-v2
Open

RyanTheTide wants to merge 2 commits into
mainfrom
fix/dcp-fw27-paced-fixed-modes-v2

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Supersedes #3693: the same change rebased on main at 13dc5a7 (that branch conflicted; this is a fresh branch, no force push).

Problem

Firmware 27 lists a ProMotion panel's fixed rates (60, 59.94, 50, 48, 47.95 Hz, each IsPromoted) next to its 120 Hz timing, the set macOS offers. Linux offers only 120 Hz, because a mode set away from the 120 Hz timing crashes the internal DCP (dcp_mode_settable(), hw.only_120hz_modes). Compositors also show the panel's VRR range as 47-120 Hz instead of 24-120.

Change

Each fixed rate becomes a mode that keeps the DCP on the 120 Hz timing of its size, and the swaps are paced to the rate in the IOMFB queue. Switching between those rates is no mode set. The synthesized panel EDID's range starts at the paced floor (24 Hz).

Scope: firmware 27 internal panels whose DCP sets only_120hz_modes: the T6050 (M5 Pro/Max) today, the T6031 (#4049) and T6030 once their flags land. dcp_paced_rates() keys on hw.only_120hz_modes && fw_compat == 27, the same condition #4049 gives the 120 Hz restriction in dcp_mode_settable(), so a SoC that gets the flag gets the paced rates with it.

Real firmware mode sets to these rates are tracked separately (Dj's work); this change never sends one.

Testing

Tested: no new hardware row on this head yet (228f556). Build/unit proof on the buildbox at this head: KUnit dcp-fabric 117/117, dcp-topology 236/237 (1 skip), dcp-display 316/317 (1 skip, apple_g17_rx_util_min_test needs UCLAMP_TASK); tools/asahi/run-host-tests.py 1032/1032; checkpatch --strict clean; arm64 LLVM=1 W=1 build of drivers/gpu/drm/apple/ with 0 warnings. #3693's K114s and J616s rows were on the pre-rebase head 76de6e2 (details below).
Risk: Two-way. K114s/T6050 internal panel (M5 Pro/Max) on firmware 27; T6031/T6030 once their only_120hz_modes flags land. New swap pacing in the firmware 27 IOMFB queue for the non-120 Hz modes; 120 Hz and VRR swaps are not held, and every firmware mode set still uses the 120 Hz timing. Other machines: dcp_paced_rates() is false, an untaken branch.

Still to run

Rebase notes
#3693 hardware rows (pre-rebase head 76de6e2)

K114s (M5 Pro 14", firmware 27), lab module on its 7.3.0 kernel: six eDP modes, EDID range 24-121, Mutter lists all six with their Variable variants. Flip-event rate per mode with a client flipping as fast as events come (349 flips each): 120.024 / 60.001 / 59.957 / 50.004 / 48.001 / 47.946 Hz; VRR still variable. Live Mutter switches through all six rates: 0 firmware mode sets, 0 DCP crashes. J616s (M4 Pro, firmware 26.6) on its Edge kernel: identical modes and Mutter list, 120.001 / 60.000 / 59.940 / 49.998 / 48.000 / 47.953 Hz, same as stock.

… modes

Firmware 27 lists the T6050 internal panel's fixed rates next to its
120 Hz timing: 60, 59.94, 50, 48 and 47.95 Hz, each marked IsPromoted,
the set macOS offers.  Linux offered only 120 Hz, because a mode set
away from the 120 Hz timing crashes the DCP (dcp_mode_settable()).

The panel does not need that mode set: it shows each swap on the first
240 Hz tick after the swap arrives (dcp_refresh_swap_paced()).  So offer
each fixed rate as a mode of its own that keeps the DCP on the 120 Hz
timing of its size, and pace the swaps to the rate:

- dcp_find_mode() gives a paced rate's 120 Hz entry, so a mode set,
  dcp_mode_settable() and every firmware call see that timing only.
- Switching between paced rates of one timing is no mode set
  (apple_connector_rate_fastset()), as with the notch geometries.
- iomfb_pace_hold() holds a paced swap until its due time, kept whole
  periods apart, so 60 and 48 Hz are whole ticks and 59.94, 50 and
  47.95 Hz keep their average.  A swap a period late starts again from
  the last swap shown.  VRR_ENABLED turns the pacing off.

Only while the panel runs the 120 Hz timing; a panel iBoot left at
60 Hz keeps just that.

This covers every firmware 27 internal panel whose DCP sets
hw.only_120hz_modes, the flag dcp_mode_settable() already keys the
120 Hz restriction on: the T6050 today, the T6031 and T6030 once their
flags land.

The panel EDID's range also started at its lowest timing (47 Hz), which
is what compositors show as the VRR range; take the paced floor (24 Hz)
instead.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide RyanTheTide added door:two-way Revertible or not, from Merge risk (bot) area:gpu Area from CODEOWNERS (bot) area:display Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) labels Dec 3, 2026
@Acelogic

Acelogic commented Dec 3, 2026

Copy link
Copy Markdown
Member

Bare-metal J516c (16-inch MacBook Pro, M3 Max apple,j516c / apple,t6031, macOS 27.2 / 26B123 stub) verification at exact head 228f5569a9fedfe5e5532a4ad7e920ba29765301 merged with main (cff875630c61, resolving the two expected context conflicts with #4049 in iomfb.c dcp_mode_settable() and parser-test.c).

  • Boot: 7.3.0-t6031-ref4059+, boot_id=ba033f02-6ab9-4d10-9613-700d527f415f, stage1=1.0.0b19, stage2=1.0.0b19-15-g8e806074, 0 failed units.
  • Exposed modes (modetest -M apple -c, eDP-1): 6 modes (3456x2234 @ 120.00, 60.00, 59.94, 50.00, 48.00, 47.95 Hz), vrr_capable=1.
  • Synthesized EDID Monitor Range Limits: vfreq=24..121 Hz (lowered from 47..121 Hz).
  • Live atomic mode switching (every switch passed WITHOUT DRM_MODE_ATOMIC_ALLOW_MODESET, 0 firmware mode sets, 0 DCP crashes/errors in dmesg, plasmalogin restarted cleanly):
    mode 3456x2234@120.00Hz (allow_modeset=0): mean=  8.31ms (120.32 Hz) min=  8.30ms max=  8.32ms
    mode 3456x2234@ 60.00Hz (allow_modeset=0): mean= 16.63ms ( 60.15 Hz) min= 16.58ms max= 16.68ms
    mode 3456x2234@ 59.94Hz (allow_modeset=0): mean= 16.63ms ( 60.14 Hz) min= 16.62ms max= 16.64ms
    mode 3456x2234@ 50.00Hz (allow_modeset=0): mean= 19.95ms ( 50.11 Hz) min= 16.69ms max= 20.80ms
    mode 3456x2234@ 48.00Hz (allow_modeset=0): mean= 20.79ms ( 48.11 Hz) min= 20.73ms max= 20.85ms
    mode 3456x2234@ 47.95Hz (allow_modeset=0): mean= 20.79ms ( 48.10 Hz) min= 20.77ms max= 20.81ms
    mode 3456x2234@120.00Hz (allow_modeset=0): mean=  8.32ms (120.24 Hz) min=  8.31ms max=  8.32ms
    

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Hardware check on MacBook Pro 16-inch M3 Pro (J516s, T6030, firmware-27 ProMotion 3456x2234 eDP panel) at head 228f5569a9fedfe5e5532a4ad7e920ba29765301 (applied cleanly on main 9b8e29feafe7 after resolving the expected context conflicts in drivers/gpu/drm/apple/iomfb.c and drivers/gpu/drm/apple/parser-test.c): PASS.

  • Host unit tests: tools/asahi/dcpext26-queue-tests.py PASS; tools/testing/selftests/drivers/gpu/apple-dcp/run.py 103/103 PASS.
  • Mode list & EDID on eDP-1:
    • Exposes all 6 fixed modes (vs. 1 mode 120.00 Hz on main): 3456x2234 at 120.00 (preferred), 60.00, 59.94, 50.00, 48.00, and 47.95 Hz.
    • vrr_capable = 1.
    • EDID Monitor Range Limits descriptor reports 24..121 Hz (vs. 47..121 Hz on main).
  • Seamless atomic paced mode switching (all commits without DRM_MODE_ATOMIC_ALLOW_MODESET, 0 additional DCP firmware set_digital_out_mode calls across all switches):
    • Pre-sleep:
      • 120.00 Hz: mean 8.43 ms (118.61 Hz); return to 120.00 Hz: mean 8.33 ms (120.02 Hz, 8.31–8.35 ms)
      • 60.00 Hz: mean 16.67 ms (60.00 Hz, 16.65–16.68 ms)
      • 59.94 Hz: mean 16.67 ms (60.00 Hz)
      • 50.00 Hz: mean 20.12 ms (49.71 Hz)
      • 48.00 Hz: mean 20.83 ms (48.00 Hz, 20.80–20.87 ms)
      • 47.95 Hz: mean 20.98 ms (47.67 Hz)
      • VRR_ENABLED=1: 14 ms render -> 16.67 ms (60.00 Hz); 20 ms render -> 25.00 ms (40.00 Hz)
    • Post-deep-sleep (rtcwake -m mem -s 15, boot object resumes 0 -> 1, DCP restores timingID: 2, colorID: 1, 0 extra firmware modesets during subsequent switches):
      • 120.00 Hz: 8.33 ms (119.98 Hz); 60.00 Hz: 16.67 ms (59.99 Hz); 59.94 Hz: 16.81 ms (59.49 Hz); 50.00 Hz: 19.97 ms (50.07 Hz); 48.00 Hz: 20.83 ms (48.00 Hz); 47.95 Hz: 20.83 ms (48.00 Hz); return 120.00 Hz: 8.33 ms (120.00 Hz)
      • VRR_ENABLED=1: 14 ms -> 16.67 ms (60.00 Hz); 20 ms -> 25.00 ms (40.00 Hz)
  • Desktop & stability: display manager restored cleanly (active), 0 DCP crashes/timeouts/errors during mode switching or VRR.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Forward-merged main 7b10eb1 as b94d892. Conflicts in iomfb.c and parser-test.c:

  • Main's queue now starts transactions through iomfb_start_next_locked() (also called directly from iomfb_queue_admit()). The pace hold moved there: a paced swap that is not yet due leaves the queue untouched and returns false, and iomfb_pace_fire() schedules the worker at the due time, as before. The atomic flush sets pace_ns and then goes through main's iomfb_queue_admit(..., iomfb_commit_starts_direct(state)). Both the pace hrtimer and main's v27 idle-cache init are kept.
  • dcp_mode_settable(): main's condition (only_120hz_modes and firmware 27, T6050 and T6030) with this PR's dcp_mode->mode (a paced rate checks the 120 Hz timing it runs on).
  • parser-test.c: main's firmware 14.7 case and this PR's paced cases, both kept.
    Note drm/apple: allow all fixed ProMotion refresh rates on T6031 #4379 (merged) dropped only_120hz_modes on T6031, so on the J516c the fixed rates are real mode sets now; the paced path applies to the T6050 and T6030.

Local: arm64 LLVM W=1 build of drivers/gpu/drm/apple/ (with the parser/display KUnit objects) clean; tools/asahi/dcpext26-queue-tests.py PASS; tools/testing/selftests/drivers/gpu/apple-dcp/run.py 104/104. The J516s (T6030) and J516c rows above were on the pre-merge head; a K114s (T6050) row on this head is queued as the post-merge check. Ready for review.

@RyanTheTide
RyanTheTide marked this pull request as ready for review December 5, 2026 01:55
@RyanTheTide
RyanTheTide requested review from a team and DjDeveloperr as code owners December 5, 2026 01:55
@github-actions github-actions Bot added blast:m3 Macs affected, 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 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Merge readiness at b94d8922: not ready yet

Check Detail
CI at head running running: KUnit dcp-fabric dcp-topology dcp-display
Review no needs one approving review from Core, Omarchy Mac or Aurora Maintainers (not the author)
Requested changes ok none
Hardware row at head ok comment at b94d8922
Conflicts ok none
PR text ok Risk: two-way · . K114s/T6050 internal panel (M5 Pro/Max) on firmware 27; T6031/T6030 once their only120hzmodes flags land. New swap pacing in the firmware 27 IOMFB queue for the non-120 Hz modes; 120 Hz and VRR swaps are not held, and every firmware mode set still uses the 120 Hz timing. Other machines: dcppacedrates() is false, an untaken branch.

Areas: area:display, area:gpu

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 saved default baseline, Linux 1675a62307d2, Aura 1.0.0b19, firmware 27.2. The internal OLED exposed only the 3024×1986 120 Hz timing. With that timing held, stock DRM flip delivery completed at 24, 48 and 100 Hz with zero reported flip errors. At 48 Hz, 109 of 114 intervals measured 20.83 ms.

The exact b94d89221e03 build is queued on Namespace. The K114S trial will pair its kernel and DTB, enumerate paced modes, and exercise the lower-rate transitions in Mutter before returning to the saved default.

Stock display receipt · Flip timing receipt

@RyanTheTide

RyanTheTide commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor Author

MacBook Pro 14-inch M5 Pro (K114S) hardware verification passed on exact head b94d89221e03718b08ebe71f4a1212466d8fdf38, from Namespace run 47478566774. This was a paired one-shot of the verified 7.3.0-aurora-ci image and its K114S DTB with Aura 1.0.0b19, U-Boot 5c0d5fe1, stub 27.2, and the saved kernel command line.

Fixed mode Measured Hz Completed flips
120.000 120.002 720
60.000 60.000 720
59.940 59.941 720
50.000 50.005 720
48.000 48.000 720
47.950 47.946 720

Mutter successfully switched through all six fixed modes with DP-2 enabled at 1920×1080, 180.002 Hz throughout. The switches logged zero firmware mode-set requests and zero DCP, GPU or DART faults. The EDID range was 24–121 Hz. The 48 Hz variable-refresh control delivered 48.001 Hz across 240 flips, with 226/229 measured intervals off the fixed 120 Hz grid. Both test phases restored the greeter to 120 Hz variable mode. These measurements are DRM flip delivery cadence.

The saved Linux 1675a62307d2 rebooted with Aura 1.0.0b19, empty next_entry, SELinux enforcing and zero failed units. The candidate kernel and Stage 2 one-shot were removed. Hardware validation receipt.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 5, 2026

This branch has not been deployed

No deployments
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) area:gpu Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (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.

3 participants