Repository navigation
drm/apple: t6030: swap timing words for 120 Hz - #1969
Conversation
|
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 ( The driver already has per-board panel data for this: We can run pacing rows on our M1 Pro, M2, M4 Pro and A18 Pro if the early flip becomes the default. |
4cf4a44 to
0136657
Compare
|
Thanks — reworked along those lines.
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. Update: the early flip described above was dropped after review at |
|
Thanks for the rework: |
|
On 110861f, the T6030 record still has no swap_timestamps and iomfb_v14_7.c is unchanged since this branch's base. The commit applies cleanly on 110861f. #2805 (draft) also stamps the T6030 swaps: it derives stamping from the record's promotion bit and drops the swap_timestamps field. If #2805 lands first, this PR reduces to the early-flip hunk and its test edits need rebasing. Because the early flip is now the default for every internal 14.x panel, it still needs pacing rows on more than the J514s and a CI run on 0136657. Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches. Host tests (tools/asahi/run-host-tests.py --only) on 110861f plus this change: apple-dcp passes (1/1). |
There was a problem hiding this comment.
Formal §1–§6 pre-PR review on live head 0136657c82677ac7c698efa73cc38dde3767a3f3 (against live integration/aurora 70a00e583b03, not superseded; live CI host-tests green).
Blockers
- Correctness / DRM flip-completion & error-handling bugs in
iomfb_v14_7_flush()(drivers/gpu/drm/apple/iomfb_v14_7.c:3366-3385):- Broken failure path (
dcp_v14_cancel_eventis dead code): Line 3369 callsdcp_drm_crtc_page_flip(dcp, ktime_get())beforedcp_v14_present().dcp_drm_crtc_page_flip()(dcp.c:942-949) immediately deliversDRM_EVENT_FLIP_COMPLETEand setscrtc->event = NULL. Ifdcp_v14_present()then fails (returns false),dcp_v14_cancel_event(dcp)findscrtc->event == NULLand does nothing — userspace has already received a bogus successful flip completion and signaled out-fence for a failed swap. - Premature buffer reuse / tearing & fabricated flip timestamp: Delivering
DRM_EVENT_FLIP_COMPLETEbeforedcp_v14_present()even acquiresv14->lockor submits the swap tells userspace that the previous front buffer is no longer being scanned out while IOMFB is still scanning it. Althoughdcp->swapped_out_fbsdelays kerneldrm_framebuffer_put(), it does not stop a 2-buffer client or direct-scanout compositor from immediately overwriting that buffer's pixel memory mid-scanout (producing tearing/corruption). In addition, callingdcp_drm_crtc_page_flip(dcp, ktime_get())immediately afterdcp->swap_start = ktime_get()reports a pre-swap timestamp (delta ≈ 0 µs) rather than presentation completion, skewing compositor frame pacing across every internal 14.x panel — including 60 Hz panels (J613,J615,J514C). - Note: Setting
.swap_timestamps = trueondcp_v14_board_t6030(and updatingv14-board-test.c) is clean and aligns withdcp_v14_board_j516c(and draft #2805). The early-flip path needs to be either dropped/split out or replaced with real asynchronous swap completion rather than signalingFLIP_COMPLETEahead ofdcp_v14_present().
- Broken failure path (
- §4 Attribution (hard blocker): Commit
0136657c82677ac7c698efa73cc38dde3767a3f3has noSigned-off-by:, uses handleknalekarinstead of human full name, and carries a forbidden AI trailer (Assisted-by: LLM) in the git commit message. Commits must carry human identity and humanSigned-off-by:only, with zero AI trailers in commit messages. - Stale PR description: The PR body still documents the removed
t6030_swap_timestampsandt6030_early_flipmodule parameters instead of the current commit's behavior. Please update it to match the commit. - §5 Evidence & §1 multi-Mac coverage (blocker): Because the early-flip path changes every internal 14.x panel by default, testing only on one
j514swith mutter (with KUnit compile-checked only, no regression tuple, no kernel build ID, and no non-T6030 14.x panel checks such as J613/J615 60 Hz or J516C/J514C, nor a 2-buffer/direct-scanout check) is insufficient. After fixing the flip-completion semantics, provide exact-head hardware + regression rows (0 SELinux denials, 0 failed units, 0 new kernel errors) across the affected internal 14.x panels and confirm KUnit execution.
Verdict
REQUEST_CHANGES — blocked on the early-flip correctness/error-handling bugs, missing human Signed-off-by: and forbidden commit Assisted-by: trailer (§4), stale PR body, and §5 hardware/regression coverage.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 0136657c8267
Blockers:
- Commit
0136657chas noSigned-off-byand carries an attribution trailer. Fix:git commit --amend -s, removing the trailer, then force-push your branch.
Rows before merging: iomfb_v14_7.c is shared by every Mac on 14.7 firmware, so besides your J514s row it needs one boot on a 14.7 Mac from another generation, presenting as before.
Checked: thank you for this; 120 Hz on the J514s is a nice result. No Apple material, and no module parameters anymore. The swap timestamps are a board property now, and the early flip is deliberate and explained in the code. Your J514s row shows 120 fps with no flip failures. Question, not blocking: after the early flip, a failed dcp_v14_present() reaches dcp_v14_cancel_event() for an event that was already sent. Is that call still needed?
Superseded by the review at 0136657
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. Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
0136657 to
f8d4163
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Code approved at f8d416342d70. The replacement commit has a human sign-off and the same patch ID as the reviewed change. Thanks for the fix. Before merge, tie the 120 Hz target result to this patch and check presentation on a second generation using the shared 14.7 path.
Superseded by the review at f8d4163
|
This branch now conflicts with |
Forward merge after the 24 h rebase ask (fasttrack policy); the author's commit and authorship are kept. Conflict in iomfb_v14_7_flush(): main computes the scanout size once (dcp_v14_plane_scanout_size() -> width/height). The early internal-panel flip from this PR now passes those values instead of fb->width/height; the rest of main's swap path is unchanged. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
@knalekar the 24 h window passed, so per the fast-track policy I forward-merged
Tested at 4bcadee: KUnit Still needed: a 120 Hz row on a T6030 Mac at this head. Our lab has no M3 Pro/Max, so if you can post one, that's the last item. |
There was a problem hiding this comment.
Verdict: FINISH at 4bcadee28e98
The current diff signals the flip before dcp_v14_present() even starts. A directly scanning double-buffered client can reuse the displaced framebuffer after that signal while firmware is still scanning it. Retaining the framebuffer pins its memory but does not prevent userspace writes. A failed present also cannot retract the flip already delivered. The condition applies to every internal v14.7 panel, although the reported test is T6030. Please split the timestamp fix for independent review and keep flip completion tied to a successful presentation or an explicit safe release point. Update the description for the current default behavior and post an exact-head 120 Hz row with compositor pacing and direct-scanout checks for any revised early-completion path.
The early flip reported page-flip completion before dcp_v14_present() submitted the swap. A two-buffer client with direct scanout could then reuse the displaced framebuffer while the firmware was still scanning it, and a failed present could not retract the event. It also changed every internal 14.x panel, not just the T6030. Keep the T6030 swap timestamp fix on its own. With the timestamps set, the firmware presents each swap at the next refresh instead of every second refresh, so flip completion after dcp_v14_present() no longer holds the panel at 60 Hz. Flip completion stays tied to a successful presentation. Signed-off-by: Krish Nalekar <53238848+knalekar@users.noreply.github.com>
|
Reworked at
Still needed: a timestamp-only 120 Hz row at |
There was a problem hiding this comment.
Verdict: HOLD at 9181db40 — code is clean and the early-flip blocker from 4bcadee2 is resolved; awaiting fork CI workflow approval/green checks and the exact-head timestamp-only T6030 (j514s) 120 Hz hardware row.
Blockers:
- Exact-head hardware verification at
9181db40on a T6030 internal panel (j514s/j516s) confirming.swap_timestamps = truedelivers 120 Hz compositor pacing and clean direct scanout without the dropped early flip, plus fork CI workflow approval and green checks.
Checked: Full 2-file diff (drivers/gpu/drm/apple/iomfb_v14_7.c, drivers/gpu/drm/apple/v14-board-test.c), commit Signed-off-by lines across all 3 commits, and board-scope isolation.
Evidence
- Prior early-flip blocker resolved (
9181db401c):iomfb_v14_7_flush()is restored tomainverbatim, so flip completion again waits for a successfuldcp_v14_present()(no premature framebuffer reuse on double-buffered direct scanout, no un-retractable flip event on failed present, and no change to other 14.x internal panels).
- Remaining diff (
+10/-8):drivers/gpu/drm/apple/iomfb_v14_7.c:107-108: sets.swap_timestamps = trueondcp_v14_board_t6030only, matching the existingdcp_v14_board_j516cmechanism.drivers/gpu/drm/apple/v14-board-test.c: updatesv14_board_swap_timestampsand comments to expectt6030_b->swap_timestamps == trueanddcp_v14_board_stamps_swaps(t6030_b, false) == true, while assertingj514c,j613, external role, andNULLremainfalse.- All three commits carry valid human
Signed-off-bylines.
- Remaining merge gate: Once the timestamp-only T6030 row at
9181db40and fork CI checks pass, this is ready to approve and merge.
DjDeveloperr
left a comment
There was a problem hiding this comment.
At 9181db4 the early flip is gone. The only driver change enables swap timestamps in the existing T6030 board record. The test covers the internal panel and preserves the external-pipe behavior. Code approved. The T6030 presentation-timing row and the pending fork workflows still need verification before merge.
There was a problem hiding this comment.
Verdict: MERGE at 9181db401c48
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: Full 2-file diff (drivers/gpu/drm/apple/iomfb_v14_7.c, drivers/gpu/drm/apple/v14-board-test.c), commit Signed-off-by lines across all 3 commits, and board-scope isolation.
Follow-ups (not blocking): fork CI approval/green, exact-head T6030 120 Hz row
|
Merging at |
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 #31). Set the existing per-board .swap_timestamps flag on dcp_v14_board_t6030 and update the v14-board-test KUnit assertions accordingly. With the timestamps set, the firmware presents each swap at the next refresh (120 Hz) while flip completion stays tied to a successful presentation. Squashed 4a42f31 carry of merged upstream aurora-silicon/linux#1969 (f8d4163 + 9181db4, merge commit 546464e). Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com> Signed-off-by: Krish Nalekar <53238848+knalekar@users.noreply.github.com> Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
What: The 14.x firmware on the T6030 ProMotion panel completes swaps every second refresh: the presentation timing words in the swap record are zero, so the panel scans out at 120 Hz but compositors pace everything at 60 fps. Set the existing per-board
.swap_timestampsflag ondcp_v14_board_t6030;dcp_v14_swap_timestamps()then stamps the three words, and the firmware presents each swap at the next refresh.The early internal-panel flip from the earlier revision is dropped after review. It reported flip completion before
dcp_v14_present()submitted the swap, which lets a double-buffered direct-scanout client reuse a framebuffer while firmware is still scanning it, and a failed present cannot retract the event. Flip completion is back after a successful present, as on the existing path.Tested: No runtime row at
9181db40yet. The earlier j514s (M3 Pro) run was on the timestamp + early-flip combination, not this head.Risk: Two-way · T6030 (M3 Pro/Max) internal panel. A plain revert undoes it.
Not yet: A timestamp-only 120 Hz row at
9181db40on j514s, with compositor pacing and a direct-scanout check.Details
dcp_v14_board_t6030now sets.swap_timestamps = true, sodcp_v14_board_stamps_swaps()selects it. Both module parameters and the board special-case check from the first revision are gone.v14-board-test.cexpects the T6030 to stamp its swaps.dcp_v14_present()completes first, thendcp_drm_crtc_page_flip()reports the flip and the displaced framebuffers are released.9181db40; the final diff againstmainis the timestamp change only.Companion PR for the 14.7 panel colour fix: #1970