Skip to content

drm/apple: t6030: swap timing words and early flip for 120 Hz - #1969

Open
knalekar wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
knalekar:drm-apple-t6030-120hz
Open

knalekar wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
knalekar:drm-apple-t6030-120hz

Conversation

@knalekar

@knalekar knalekar commented Nov 15, 2026 •

Copy link
Copy Markdown

The 14.x firmware on the T6030 ProMotion panel completes swaps every second refresh: the presentation timing words in the swap record are all zero on the 14.x path, so the panel scans out at 120 Hz but everything is paced at 60 fps (omacom/linux-aurora #31, where the original change was posted and validated on j516s).

Two module parameters, both default off:

  • t6030_swap_timestamps stamps the three presentation timing words (0x00/0x08/0x30, the same offsets as on the 12.x/13.x/26.6 paths) on T6030 swaps. Reuses the tree's existing dcp_v14_swap_timestamps() (J613/25G83), which writes exactly these words.
  • t6030_early_flip reports the page flip before dcp_v14_present() instead of after the blocking swap, so the compositor is not serialized behind the swap round trip. Opt-in, because a two-buffer client with direct scanout could see a released buffer early.

Tested on j514s (MacBook Pro 14", M3 Pro), GNOME/mutter 50.6 on Wayland, kernel built from this tree: stock paces everything at ~60 fps while the panel reports 120 Hz; with both parameters on, panel and apps run at ~120 fps (UFO tester in Firefox and visually), stable across several boots with no GPU faults, flip failures or display errors.

Companion PR for the 14.7 panel colour fix (omacom/linux-aurora #308): #1970

Assisted-by: GLM 5.3 Flash

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for chasing the 60 fps pacing on the T6030 ProMotion panel. That's a real improvement.

Two things don't fit how we usually do this. Both behaviours sit behind new module parameters that default to off (drivers/gpu/drm/apple/iomfb_v14_7.c:117-120 t6030_swap_timestamps, :128-131 t6030_early_flip), so users would have to set a boot option to get 120 Hz. They are also chosen by comparing against one board pointer (:2871, :3394).

The driver already has per-board panel data for this: dcp_v14_board_stamps_swaps() reads board->swap_timestamps. Could you set .swap_timestamps = true in dcp_v14_board_t6030 and drop both parameters? For the early flip, if it is safe with the swapchain argument in the comment, it could be the default for every v14 internal panel. If it isn't, a comment explaining what the T6030 has that the others lack would help.

We can run pacing rows on our M1 Pro, M2, M4 Pro and A18 Pro if the early flip becomes the default.

14.7 firmware on the T6030 ProMotion panel completes swaps every
second refresh: with the swap record's presentation timing words all
zero, swaps complete 16.7 ms apart even though the panel scans out at
120 Hz, so compositors pace everything at 60 fps
(omacom/linux-aurora aurora-silicon#31).

Set the existing per-board .swap_timestamps flag on the T6030 record.
dcp_v14_swap_locked() then stamps the three presentation timing words
(offsets 0x00, 0x08 and 0x30, as on the 12.x/13.x/26.6 paths) through
dcp_v14_swap_timestamps(). With the target long past, the firmware
presents each swap at the next refresh, i.e. at 120 Hz.

Report an internal panel's flip before dcp_v14_present() instead of
after it. dcp_v14_swap() blocks until the firmware completes the swap,
so the compositor could not start its next frame until then. The next
commit still waits for this swap (v14->lock and the CRTC commit
dependencies), and displaced framebuffers stay pinned until the swap
completes, so nothing is freed while the firmware may still scan it. A
3-buffer swapchain renders into the buffer from two flips back, which
is already off screen. This is not board-specific and now applies to
every internal 14.x panel; external processors keep their present
path.

On j514s (MacBook Pro 14", M3 Pro, T6030) with GNOME/mutter 50.6,
stock paces everything at ~60 fps while the panel reports 120 Hz; with
these changes UFO tester and visual checks confirm ~120 fps, stable
across several boots with no GPU faults, flip failures or display
errors. The swap timestamps were also validated on j516s
(omacom/linux-aurora aurora-silicon#31). The early flip has only been tested on
T6030.

Assisted-by: LLM
@knalekar
knalekar force-pushed the drm-apple-t6030-120hz branch from 4cf4a44 to 0136657 Compare November 19, 2026 16:05
@knalekar

knalekar commented Nov 19, 2026 •

Copy link
Copy Markdown
Author

Thanks — reworked along those lines.

  • dcp_v14_board_t6030 now sets .swap_timestamps = true, so dcp_v14_board_stamps_swaps() picks it up, and both module parameters (and the special-case board check) are gone.
  • The early flip is now the default for every internal 14.x panel; external processors keep the existing path. The comment there explains why the next commit cannot overtake the swap (v14->lock and the CRTC commit dependencies) and that displaced framebuffers stay pinned until the swap completes.
  • I also fixed the early path to release the retained framebuffers after a successful swap (it previously returned without doing so) and to cancel the event if the swap fails.
  • v14-board-test.c now expects the T6030 to stamp its swaps.

Only j514s (M3 Pro) has been tested: still ~120 fps with no faults. The KUnit change is compile-checked only (my build config has KUNIT off). Since the early flip is now the default on all internal v14 panels, your offered pacing rows on M1 Pro, M2, M4 Pro and A18 Pro would be very welcome.

Assisted-by: DeepSeek v4.1 Flash

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the rework: .swap_timestamps in the T6030 record and no module parameters is what we hoped for, and the comment on the early flip explains why it is safe. Since the early flip is now the default for every internal v14 panel, we will run pacing rows on our lab Macs; no CI has run on 0136657 yet, so a run would help too.

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