Skip to content

J516S: 120 Hz mode produces approximately60 Hz page-flip completions #31

Open

Description

@chriskearney

New .12 report: DRM and DCP select3456x2234@120, but modetest with the compositor stopped measures about60 Hz over repeated page flips. Honeykrisp FIFO vkgears stays near60fps while MAILBOX exceeds500fps. The report does not yet distinguish physical60Hz scanout from completions on every second vblank.

Priority: P2 · Readiness: investigation · Implementation owner: kernel

Baseline: Aurora 2026.10.11.13, development commit 5dcdeb8cda8dafe203d4d2f03952ade392c3fe23. Earlier reproductions retain the exact versions above.

Code: drivers/gpu/drm/apple/iomfb_v14_7.c · drivers/gpu/drm/apple/dcp.c

Completion criteria: Compare firmware timing selection, actual swap-completion cadence and physical scanout; expose usable timing diagnostics if existing tracepoints are silent. A supported120Hz mode must have correct presentation/completion cadence, and60Hz/external modes must retain correct timing. Keep this separate from vkQuake’s throughput deficit and do not change mode labels to conceal it.

Original reports/candidate: original #87

This ticket carries forward the remaining work; source inclusion, release delivery and hardware acceptance are recorded separately.

Activity

  1. added
    priority:P2Recovery, performance or hardware qualification
    status:investigationFailure is open; mechanism needs confirmation
    owner:kernelImplementation belongs to kernel
    area:displayAffected display subsystem
    on Oct 11, 2026
  2. aronvandepol commented on Oct 11, 2026

    @aronvandepol

    This separates the two: the panel scans out at 120 Hz, and the 60 Hz comes from the swap records on the 14.x path. Tested on the j516s with 2026.10.10.12 (a462e43). The patch below is rebased onto 5dcdeb8 and compiles there.

    iomfb_v26_6_swap.h already describes it: with the swap record's presentation timing words all zero, swaps on the 120 Hz ProMotion panel complete 16.7 ms apart, and a non-zero "target long past" value makes the firmware present at 120 Hz. The 26.6 path sets them for J613 (dcp_v26_swap_set_timing(swap, 120)), and the M1/M2 template does too. dcp_v14_encode_swap() zeroes the record and never sets them, so T6030 swaps complete on every second refresh.

    The patch adds two parameters, both default off:

    • t6030_swap_timestamps writes the three words (0x00, 0x08, 0x30, the 12.x/13.x/26.6 offsets) for T6030 swaps with a surface.
    • t6030_early_flip sends the flip event before dcp_v14_present(). dcp_v14_swap() blocks until the firmware completes the swap (about 2.75 ms with the timing words), so the compositor could not start its next frame until then. The next commit still waits on v14->lock. With Aquamarine's 3-buffer round-robin swapchain, the compositor renders into the buffer from two flips back, which is already off screen. A two-buffer client with direct scanout could see a released buffer early, which is why it is opt-in.
    Test Stock Timing words + early flip
    modetest -M apple -s 40@38:3456x2234 -v, sddm stopped 60.00 Hz 121.7 to 122.1 Hz
    vkgears -fullscreen (FIFO), Hyprland 0.56.2 60.0 FPS 80.0 FPS 120.3 FPS
    vkgears windowed (FIFO) 46 FPS 79 FPS 107 FPS
    mpv 30 s, 1080p60 AV1, fullscreen, dropped frames 153 32 (with batching, see #35)

    Over 5 s of fullscreen video with both on, all 600 swaps took 8.0 to 8.5 ms back to back, so the completion cadence is a steady 120 Hz. dcp-t6030 failed stayed 0, and there was no flip failed, GPU fault or DEVICE LOST across five boots with the module, both parameters on from boot in the last. I timed the swap steps with a local debugfs histogram (A406 under 0.5 ms, A407 about 2.75 ms when the compositor submits late, 8.0 to 8.5 ms back to back). It is not in this patch.

    Patch (against 5dcdeb8)
    diff --git i/drivers/gpu/drm/apple/iomfb_v14_7.c w/drivers/gpu/drm/apple/iomfb_v14_7.c
    index 9593cfb..824b981 100644
    --- i/drivers/gpu/drm/apple/iomfb_v14_7.c
    +++ w/drivers/gpu/drm/apple/iomfb_v14_7.c
    @@ -94,6 +94,20 @@ struct dcp_v14_board {
     	u32 ctm_set, ctm_get;
     };
     
    +static bool t6030_swap_timestamps;
    +module_param(t6030_swap_timestamps, bool, 0644);
    +MODULE_PARM_DESC(t6030_swap_timestamps,
    +		 "T6030 built-in panel: timing words in each swap, for 120 Hz presentation (test, default off)");
    +
    +/*
    + * Report the flip before the swap reaches the firmware. The next commit still waits for this
    + * swap (v14->lock), and a 3-buffer swapchain renders into the buffer from two flips back, which is
    + * already off screen. Saves the ~2.75 ms A407 round trip from the compositor's frame loop.
    + */
    +static bool t6030_early_flip;
    +module_param(t6030_early_flip, bool, 0644);
    +MODULE_PARM_DESC(t6030_early_flip, "T6030 built-in panel: send the flip event before the swap (test, default off)");
    +
     static const struct dcp_v14_board dcp_v14_board_t6030 = {
     	.name = "T6030",
     	.debugfs = "dcp-t6030",
    @@ -2484,6 +2498,9 @@ static int dcp_v14_swap(struct apple_dcp_v14 *v14, const u8 *surface, u64 iova,
     	if (!ret) {
     		dcp_v14_encode_swap(swap, id, DCP_V14_BLACK, surface, iova, width, height,
     				    dst_y, DCP_V14_LAYER);
    +		if (surface && v14->board == &dcp_v14_board_t6030 &&
    +		    READ_ONCE(t6030_swap_timestamps))
    +			dcp_v14_swap_set_timing(swap, 120);
     		ret = dcp_v14_call_guarded(v14, A(407), swap, DCP_V14_SWAP_SIZE, result, sizeof(result),
     				   id, dcp_v14_swap_admit, &admission);
     		/* The swap status sits at byte 5 of the reply. */
    @@ -2847,6 +2864,12 @@ void iomfb_v14_7_flush(struct apple_dcp *dcp, struct drm_crtc *crtc,
     		return;
     	}
     	dcp->swap_start = ktime_get();
    +	if (fb && dcp->v14 && !dcp->external && dcp->v14->board == &dcp_v14_board_t6030 &&
    +	    READ_ONCE(t6030_early_flip)) {
    +		dcp_drm_crtc_page_flip(dcp, ktime_get());
    +		dcp_v14_present(dcp->v14, fb, fb->width, fb->height, dcp->notch_height, cs);
    +		return;
    +	}
     	if (dcp->v14 && dcp_v14_present(dcp->v14, fb,
     					 fb ? (dcp->external ? p->src_w >> 16 : fb->width) : 0,
     					 fb ? (dcp->external ? p->src_h >> 16 : fb->height) : 0,
    diff --git i/drivers/gpu/drm/apple/iomfb_v14_7_swap.h w/drivers/gpu/drm/apple/iomfb_v14_7_swap.h
    index aab3351..bddf1b0 100644
    --- i/drivers/gpu/drm/apple/iomfb_v14_7_swap.h
    +++ w/drivers/gpu/drm/apple/iomfb_v14_7_swap.h
    @@ -11,6 +11,10 @@
     #define DCP_V14_SURFACE_SIZE		0x22c
     
     /* Offsets in the swap record. Rectangles are x, y, w, h (u32 each). */
    +/* u64 presentation timing words, at the 12.x/13.x/26.6 offsets. */
    +#define DCP_V14_SWAP_TS1		0x00
    +#define DCP_V14_SWAP_TS2		0x08
    +#define DCP_V14_SWAP_TS3		0x30
     #define DCP_V14_SWAP_ID			0x98
     #define DCP_V14_SWAP_SURF_ID(p)		(0x9c + (p) * 4)
     #define DCP_V14_SWAP_SRC(p)		(0xac + (p) * 16)	/* in the surface */
    @@ -115,4 +119,16 @@ static inline void dcp_v14_encode_swap(u8 *swap, u32 id, u32 background, const u
     	}
     }
     
    +/*
    + * As on 26.6 (dcp_v26_swap_set_timing()): with all timing words zero, swaps
    + * on the 120 Hz ProMotion panel complete 16.7 ms apart (60 Hz). A target long
    + * past makes the firmware show each swap at the next refresh.
    + */
    +static inline void dcp_v14_swap_set_timing(u8 *swap, u64 value)
    +{
    +	put_unaligned_le64(value, swap + DCP_V14_SWAP_TS1);
    +	put_unaligned_le64(value, swap + DCP_V14_SWAP_TS2);
    +	put_unaligned_le64(value, swap + DCP_V14_SWAP_TS3);
    +}
    +
     #endif /* __APPLE_IOMFB_V14_7_SWAP_H__ */
  3. added
    launch:follow-upRetained improvements or broader retests outside the initial launch
    on Oct 11, 2026
  4. JamesRoche commented on Nov 6, 2026

    @JamesRoche

    I had the same issue on a MacBook Pro M3 Max and found a workaround: boot into macOS, open Display Settings, and change the refresh rate from 60 Hz to ProMotion. After booting back into Omarchy, the direct-display test went from 60.02 FPS to 120.18 FPS.

    I verified that the fix in PR #182 was present and active in my Omarchy 4.5.0-3 installation. Before changing the macOS setting, I measured a consistent 15.18 ms between submitting a frame and the display firmware reporting completion, with completions arriving 16.67 ms apart. That’s consistent with 60 Hz pacing, though I cant really say at this stage how or where that's coming from.

    My suspicion is that the macOS refresh-rate setting leaves persistent display or firmware state that carries across reboots. That’s a hypothesis for now; I have an M1 Pro that I’ll use to try to reproduce the behaviour.

    Hardware isn’t my specialty, but an optional installer check recommending ProMotion or potentially just setting pro motion during install seems worth considering. I’ll keep digging and report back.

  5. knalekar commented on Nov 13, 2026

    @knalekar

    Kernel-side fix confirmed on J514S / T6030 (MacBook Pro 14", M3 Pro) — GNOME/mutter

    Machine: apple,j514s / T6030 DCP, same 14.7 firmware generation as the OP's j516s
    Stack: Fedora Aurora Remix, kernel 7.3.0-36.fc44.aurora.aarch64 (built from aurora-silicon/linux @ 9219565939723cd5bc381941bc3978d52610d753), GNOME 50.6 / mutter on Wayland

    Same behaviour as in the OP: the panel scans out at 120 Hz (T6030 display started: 3024x1890@120, 74 notch rows hidden) but mutter and everything on it pace at ~60 fps, because dcp_v14_encode_swap() zeroes the presentation timing words on the 14.x path.

    With t6030_swap_timestamps and t6030_early_flip on, presentation is back at 120 Hz: UFO tester in Firefox reports ~120 fps and it looks right in real use. Several boots with both parameters on from boot — no GPU faults, no flip failed, no display errors.

    Porting notes for this tree:

    • The aurora-silicon tree already ships the J613/25G83 equivalent — dcp_v14_swap_timestamps() in iomfb_v14_7_swap.h writes the same three offsets (0x00/0x08/0x30) with value 120 — so I wired the stamping hook to that instead of adding dcp_v14_swap_set_timing().
    • Condition: added !v14->external, dropped the surface check (blank swaps get stamped too). t6030_early_flip ported as-is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:displayAffected display subsystemlaunch:follow-upRetained improvements or broader retests outside the initial launchowner:kernelImplementation belongs to kernelpriority:P2Recovery, performance or hardware qualificationstatus:investigationFailure is open; mechanism needs confirmation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions