Skip to content

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

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

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

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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, 983f5f9), 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 983f5f9: 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.

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)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
ggresillion added a commit to ggresillion/dotfiles that referenced this pull request Nov 17, 2026
- Kernel patch: stamp the J504's internal swaps. Unstamped, the 14.7
  DCP firmware completes one swap per 16.7 ms, so the 120 Hz panel ran
  at 60 fps (same fix as aurora-silicon/linux#1632 for the other M3s).
- Touchpad: adaptive acceleration instead of flat, natural scrolling,
  two-finger right click, disabled while typing.
- vicinae: run its server as a user service, so Mod+Space opens the
  launcher.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. drivers/gpu/drm/apple/iomfb_v14_7.c:106 and :191 add swap_timestamps to two more per-board records. The new KUnit case asserts that swap_timestamps == promotion on every record (drivers/gpu/drm/apple/v14-board-test.c, v14_board_swap_timestamps), and the header comment now says "set wherever promotion is" (iomfb_v14_7_board.h:45-46). The flag has no independent meaning left, and the next 120 Hz record can still miss it, which is how the T6030 and J514C records got this bug. Decide it in dcp_v14_board_stamps_swaps() (iomfb_v14_7.c:1707-1710) from board->promotion (or, better, from the panel reporting a timing above 60 Hz, the same test the mode check at :2591 uses). Then drop the swap_timestamps field and keep the KUnit expectations as they are.

The commit message carries Assisted-by: LLM. Noted once; no history rewrite needed.

HW row: J514S (or J516S) on this head, default cmdline, panel at 3024x1890@120: tracefs dcp:iomfb_swap_complete intervals at about 8.33 ms and wl_surface.frame at about 120 fps. The same Mac at 60 Hz still shows 16.67 ms. 0 AVC, 0 failed units, 0 new kernel errors. A J514C row too, if one becomes available.

Assisted-by: LLM (Claude:Opus 5.5)

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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Done in 983f5f9. dcp_v14_board_stamps_swaps() now decides from board->promotion, the swap_timestamps field and its three settings are gone, and the KUnit case checks the ProMotion bits and that the stamp decision follows them. No record changes behaviour. On arm64 KUnit (qemu, LLVM, 16K pages) the apple-dcp* suites pass 22/22, and with the function forced to return false v14_board_swap_timestamps fails, as it should. W=1 and checkpatch --strict are clean.

The J514S/J516S 120 Hz row (swap-complete intervals around 8.33 ms, about 120 fps frame callbacks, still 16.67 ms at 60 Hz) still needs an owner of one of those machines.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Still needed: a J514S or J516S row at 120 Hz on this head (swap-complete about 8.33 ms, about 120 fps callbacks, unchanged at 60 Hz), and this overlaps #1969, so the two should land together with the stamping taken from the ProMotion bit. Both commits also carry an Assisted-by trailer, so they need re-committing with a human Signed-off-by only.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Replaced by #2805: the same changes with the commit trailers fixed, on the current integration/aurora.

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.

1 participant