Skip to content

drm/apple: stamp the swaps of every 14.7 ProMotion panel - #2805

Draft
RyanTheTide wants to merge 2 commits into
integration/aurorafrom
dcp/m3-pro-promotion-stamps-v2
Draft

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
dcp/m3-pro-promotion-stamps-v2

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #1632 (same changes, commit trailers fixed, on the current integration/aurora).

Problem

On a J514S (MacBook Pro 14", M3 Pro) the internal panel is set to 3024x1890@120 (804.56 MHz, htotal 3104, vtotal 2160), and GNOME shows 120 Hz. The panel still presents at 60 fps: apple-dcp swap completions are 16.64 ms apart and wl_surface.frame callbacks run at about 60.25 fps.

The J514S and J516S DCP (apple,t6030-dcp) binds the T6030 board record, which has promotion but not swap_timestamps. Its swaps go out with zero timestamps, and with zero timestamps the 14.7 firmware completes at most one swap per 16.7 ms. 47d53ce fixed the same thing on the J516C. The J514C record has the same gap: it runs the J516C's DCP image on a 120 Hz panel.

Fix

Decide the stamping from the record's promotion bit in dcp_v14_board_stamps_swaps() and drop the separate swap_timestamps field (second commit, 2506e16), so every 14.x record with a 120 Hz panel stamps its internal swaps with the constant deadline the J516C uses. The template path (fa13cbd) and the M4 path (#1525) already do this for their 120 Hz panels. The 60 Hz J613/J615 panels and the external processors keep zero timestamps, byte for byte.

Audit of the other 120 Hz internal panels

Mac path before after
J514S, J516S (M3 Pro) v14.7, T6030 record zero timestamps stamped
J514C (M3 Max 14") v14.7, J514C record zero timestamps stamped
J516C (M3 Max 16") v14.7, J516C record stamped (47d53ce) unchanged
J613, J615 (M3 Air, 60 Hz) v14.7 zero unchanged
J504 (M3 14"), J514M/J516M (T6034) no board record, internal display not started n/a unchanged
M1/M2 Pro/Max 14"/16" template, needs_timestamps stamped (fa13cbd) unchanged
M4 Pro/Max (T6041, J616s etc.) template, desktop 26 stamped unchanged
M4 J604 (T8132) iomfb_m4 stamped (#1525) unchanged

Tests

  • KUnit apple-dcp-v14-board: the J514S, J516S, J514C and J516C records stamp their internal swaps; J613, J615, the external role and no record do not; the stamp decision equals promotion on every record. At 2506e16: apple-dcp* suites 22/22 on arm64 (qemu, LLVM, 16K), and a mutant that never stamps fails v14_board_swap_timestamps. W=1 and checkpatch --strict are clean.
  • Not tested on M3 hardware: no J514S, J516S or J514C was available. The J516C measurement in 47d53ce (kmscube 60 -> 120 fps) and the J514S report above are the evidence. A test build for the J514S is in fedora-aurora (test/dcpm3-m3-pro-120hz).
  • No other Mac's code path changes: J616s, M1 Pro and M2 do not use the 14.x board records.

Reported by fraudsta on the Aurora Discord, with the swap and frame-callback measurements above.

Native hardware qualification

On J514S or J516S at 2506e1647580, verify 120 Hz swap completion at about 8.33 ms and Wayland frame callbacks at about 120 fps, then verify 60 Hz swap completion at about 16.67 ms. Use the default command line and record new kernel errors, SELinux denials and failed units.

Assisted-by: LLM (Claude:Opus 5.5)

On a J514S (MacBook Pro 14", M3 Pro) the internal panel is set to its
3024x1890@120 timing, but swaps complete 16.64 ms apart and Wayland
frame callbacks run at about 60 fps. The T6030 board record, which
serves the J514S and J516S, has promotion but not swap_timestamps, so
its swaps go out with zero timestamps. With zero timestamps the 14.7
firmware completes at most one swap per 16.7 ms, the behaviour
47d53ce ("drm/apple: stamp the J516C panel's 14.7 swaps") fixed on
the J516C. The J514C record has the same gap: it runs the J516C's own
DCP image, where stamping was measured, on a 120 Hz panel.

Set swap_timestamps in the T6030 and J514C records. Every 14.x board
record with a 120 Hz panel now stamps its internal swaps with the
constant deadline, as the template path (fa13cbd) and the M4 path
(09986ee) do for their 120 Hz panels. The 60 Hz J613/J615 panels
and the external processors keep zero timestamps, byte for byte.

The board KUnit case now checks the J514S, J516S, J514C, J516C, J613
and J615 records, and that swap_timestamps follows promotion on each.

Not tested on M3 hardware: no J514S, J516S or J514C was available. The
J516C result and the reporter's measurements are the evidence; the
reporter's test of this change on a J514S is the check.

Reported-by: fraudsta (Discord: thetennisfan)
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
swap_timestamps was set on exactly the records that have promotion, and
the KUnit case asserted that the two are equal. A separate flag only
leaves room for the next 120 Hz record to miss it, which is how the
T6030 and J514C records lost their stamps. Decide it in
dcp_v14_board_stamps_swaps() from board->promotion and drop the field.

No record changes behaviour: the three records that stamped still do,
and the 60 Hz T8122 records still don't. The KUnit case now checks the
ProMotion bits and that the stamp decision follows them.

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

@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 at 2506e1647580b8f0548cb3e76a0112fb034274d5 against pre-pr-checklist.md (§1–§6).

0 code blockers. The code and tests are clean:

  • §1 / §2 / §3: Dropping the redundant per-board swap_timestamps boolean and deriving swap stamping from board->promotion in dcp_v14_board_stamps_swaps() (drivers/gpu/drm/apple/iomfb_v14_7.c:1710-1713) removes the per-board drift that left T6030 (J514S/J516S) and J514C unstamped at 60 fps. External processors and 60 Hz T8122 panels (J613/J615) keep zero timestamps byte-for-byte, and ProMotion panels stamp constant DCP_V14_SWAP_TIMESTAMP_VALUE (120) in slots 0, 1, and 6 matching J516C (47d53ce42303).
  • Tests & CI: KUnit v14_board_swap_timestamps covers J514S, J516S, J514C, J516C, J613, J615, external role, and NULL board; host-tests CI passes at 2506e1647580.
  • §4 & §6: Both commits (1882f3be6ee2, 2506e1647580) carry human author/committer and Signed-off-by: only (zero AI commit trailers); naming clean.

Blocker before approval (§5 hardware evidence)

  • This is a non-draft PR with no hardware run yet on any newly enabled M3 Pro/Max panel (J514S, J516S, or J514C). Before merge (or convert back to draft until a tester row lands), please attach a J514S or J516S hardware row at 2506e1647580 on the default command line confirming:
    • 120 Hz mode (3024x1890@120 on J514S / 3456x2234@120 on J516S): dcp:iomfb_swap_complete intervals ~8.33 ms and wl_surface.frame ~120 fps;
    • 60 Hz mode: ~16.67 ms unchanged;
    • System regression counts: 0 SELinux denials, 0 failed units, 0 new kernel errors.

Non-blocking notes

  • The PR description still cites the superseded #1632 commit SHA 983f5f98 in two places ("second commit, 983f5f9" and "At 983f5f9"); please update those to 2506e1647580.
  • Note overlap with open PR aurora-silicon/linux#1969 (drm/apple: t6030: swap timing words and early flip for 120 Hz) when coordinating merge order.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide
RyanTheTide marked this pull request as draft November 22, 2026 13:18
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Looking for a row from anyone with a J514S or J516S (M3 Pro), or a J514C (M3 Max 14"). There's none in our lab.

Test kernel at this head (2506e16), Fedora Aurora 44 and 45 RPMs: https://github.com/aurora-silicon/linux/releases/tag/untagged-8afc8a87f355fb09576d (install notes and SHA256SUMS on the page).

What to check, default command line:

  1. At 120 Hz: apple-dcp swap completions about 8.33 ms apart, and Wayland frame callbacks at about 120 fps (WAYLAND_DEBUG=1 on a client, or any frame-pacing tool you already use).
  2. Switch the panel to 60 Hz: swap completions about 16.67 ms apart.
  3. New kernel errors (journalctl -k -b -p err), SELinux denials and failed units, compared with your current kernel.

The M1 Pro/M2 and M4 Pro paths don't use these board records, so they can't stand in for this row.

Assisted-by: LLM (Claude:Opus 5.5)

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.

2 participants