Skip to content

drm/apple: send firmware 27 swap timestamps in the firmware's timebase - #1404

Merged
DjDeveloperr merged 1 commit into
funkzy/t6050-gpu-on-integrationfrom
j716c/v27-swap-timebase
Nov 10, 2026
Merged

DjDeveloperr merged 1 commit into
funkzy/t6050-gpu-on-integrationfrom
j716c/v27-swap-timebase

Conversation

@erikwb

@erikwb erikwb commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

What this fixes

On T6050 the internal ProMotion panel either timed out its first present in the 120 Hz mode (with swap timestamps) or presented at 60 Hz in that mode (without them). Firmware 27 counts the continuous time of swap timestamps at 24 MHz, while the ARM counter runs at 1 GHz there, so a raw counter value named a moment about 40 times too far from boot and the firmware held the swap for it.

The change

On firmware 27, swap timestamps are the counter scaled to 24 MHz. The previous accepted swap's time is used only when it is at most a second old. The dual-pipe path records its submission time the same way. Other firmware versions are unchanged.

With this, the fixed-rate ProMotion timestamp policy on integration/aurora works on firmware 27, and #1270 drops its policy workaround.

Testing (J716c)

  • Internal panel in 3456x2234@120 with timestamps on: 119.5 completed swaps per second with a continuously animating client (8.33 ms median interval), including the first frames after idle, and no swap timeouts. Without timestamps: 60.0.
  • Two external 4K displays on a Thunderbolt dock (one 4K240 over two pipes) on the same kernel.
  • Builds on drm/asahi, drm/apple: M5 GPU and firmware-27 display on integration/aurora #1012's head.

Created with Claude Opus 5.5 and Claude Fable 5.2 in T3 Code.

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

The change is limited to the firmware-27 template instance: dcp_swap_time() and dcp_swap_prev_time() scale and clamp only under DCP_FW_H17(DCP_FW_VER) && DCP_FW_VER >= DCP_FW_VERSION(27, 0, 0). Other instances still pass the raw counter and the previous timestamp. That instance is used only by apple,t6050-dcp/apple,t6050-dcpext. No code changes needed.

It depends on firmware-27 code that exists only on its base, funkzy/t6050-gpu-on-integration (#1012). It can go in after that lands, retargeted to integration/aurora.

Firmware 27 counts the continuous time of swap timestamps at 24 MHz, but
on T6050 the ARM counter Linux reads runs at 1 GHz, so a raw counter
value names a moment about 40 times as far from boot as now. The
firmware accepts such a swap and holds it, and the commit times out.
Without timestamps, the internal ProMotion panel presents at 60 Hz in
its 120 Hz mode.

On firmware 27, scale the counter to 24 MHz, and use the previous
accepted swap's time only when it is at most a second old; after an idle
period the firmware would otherwise pace from a stale time. The
dual-pipe path records its submission time the same way. Other firmware
is unchanged.

On J716c the internal panel completes 119.5 swaps per second in its
120 Hz mode with timestamps on, against 60.0 without them.

Developed with Claude Code.
Signed-off-by: Erik Bourget <erik@ebourget.net>
@DjDeveloperr
DjDeveloperr force-pushed the j716c/v27-swap-timebase branch from 01a88d7 to 7e32e38 Compare November 10, 2026 09:11
@DjDeveloperr
DjDeveloperr changed the base branch from funkzy/t6050-gpu-on-integration to fix/m5-fbdev-argb-fw27 November 10, 2026 09:11
@DjDeveloperr
DjDeveloperr changed the base branch from fix/m5-fbdev-argb-fw27 to funkzy/t6050-gpu-on-integration November 10, 2026 10:21
@DjDeveloperr
DjDeveloperr merged commit 5c1938f into funkzy/t6050-gpu-on-integration Nov 10, 2026
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.

3 participants