Skip to content

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

Draft
RyanTheTide wants to merge 1 commit into
mainfrom
fix/dcp-fw27-paced-fixed-modes-v2
Draft

RyanTheTide wants to merge 1 commit 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
    

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:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants