Repository navigation
Conversation
|
Thanks for this, the slot-zero handling is thorough. One point before it can land: we select behaviour by a hardware property, not by the chip it was tested on. Takeover tracking is switched on only for Could |
e72cc8b to
bddfd57
Compare
4832dc2 to
6195f71
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of erikwb Done in 6195f71.
On the J716c the internal DCP published retirement on swap 6, with both the original and the reworked T6050 loader. M1 Pro, M2 and A18 Pro don't take this path. M4 Pro on 27.x firmware does, so a boot and display row there would help. A paired-mode row (two-pipe, e.g. 4K240) is still to come from our side. |
|
Thanks, this resolves our point: Our M4 Pro runs 27.x firmware, so we'll run a boot and display row there on this head (with #2538) and post it here. |
bddfd57 to
5b30245
Compare
A display controller the bootloader left scanning out a framebuffer can still show that surface after DRM registration. Reserve its retirement record with the cache controller when binding, and mark it retired once an accepted, shown KMS swap replaces or clears slot zero. A paired firmware-27 scanout passes the firmware's shown state to the owner, set when both engines displayed the retired swap. If the record cannot be allocated the display still takes over, without a retirement report, so allocation stays off. Until that displayed completion arrives, pull the primary plane into atomic commits for that CRTC so cursor- or overlay-only commits replay the intended slot-zero surface with its own framebuffer reference, force an explicit slot-zero clear when the primary plane is disabled, and drop any inherited slot-zero reference from the pending scanout to match that clear. Signed-off-by: Erik Bourget <erik@ebourget.net>
6195f71 to
7803302
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Rebased #2539 cleanly onto the current #2538 head ( Verified on
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review at 7803302be7ee (0 code/policy blockers; holding for CI and §5 live-head hardware proof):
Stack & Dependencies
- Stacked cleanly on live #2538 (
5b302458524f); depends on #2538's<linux/soc/apple/mcc.h>(apple_mcc_boot_scanout_reserve()/apple_mcc_boot_scanout_retired()), so #2538 must land first. Independent of #2540.
Code & Safety Audit
- Hardware-state gating (
drivers/gpu/drm/apple/dcp.c):dcp_firmware_metadata_v27()tracks takeover fromdfb_region_size > 0rather than a compatible check. Verified indcp.c:7149-7151that T8142 on firmware 27 switchesiomfb_method_profiletoDCP_IOMFB_METHODS_DEFAULT, so every firmware-27 controller that can setboot_surface_pendingreaches the clearing path indcp_report_swap_complete(). On-ENOMEMfromapple_mcc_boot_scanout_reserve(),boot_scanout_reservedstaysfalseso display takeover still proceeds while MCC keeps allocation off. - Locking & execution context (
drivers/gpu/drm/apple/iomfb_template.c):dcp_report_swap_complete()runs underdcp->iomfb.lockin process context (both directiomfb_recv_msg()andiomfb_callback_work()for paired peer completions).apple_mcc_boot_scanout_retired()takes onlyboot_scanout_lockinternally and schedules retry work after unlocking, with no lock inversion againstdcp->iomfb.lock. - Atomic check & slot-zero handling (
drivers/gpu/drm/apple/apple_drv.c,iomfb.c,iomfb_template.c):apple_atomic_check()matchesdrm_atomic_helper_check()(omitting only the unused self-refresh helper), skipst8132_ext_crtc(), pulls active CRTCs and their primary plane whileboot_surface_pending(handling-EDEADLKand naturally preventingasync_updateon multi-plane state), and pairs withiomfb_scanout_prepare_h17p()clearing any inheritedscanout->fb[0]plusiomfb_flush()forcingBIT(0)and skipping the no-op earlyvblank_wqreturn while pending. - Paired firmware-27 completions (
dcp-peer-frames-v27.h,dcp-peer-runtime-v27.inc):both_shownis true only when both engines reportedshownfor the exact retired watermarkdone. Independently rantools/asahi/dcp-peer-shown-tests.py+ both mutants (--always-shown,--owner-only) against7803302be7ee(PASS, both mutants killed).
Pre-PR Checklist (§1–§6)
- §1 No model gating: PASS — follows
dfb_region_sizehardware state, no chip/compatible gating. - §2 Production-ready: PASS — default cmdline, no sleeps/magic delays.
- §3 Safety: PASS — fails safe (allocation stays off) if record allocation fails or a swap is not reported shown.
- §4 Clean-room & attribution: PASS — commit
7803302be7eecarries human author/committer and humanSigned-off-by:only; PR body carriesAssisted-by:. - §5 Evidence: HOLD — prior J716c rows were on an older base. Still needed on live head
7803302be7ee:- Repeated J716c boot row on the rebased stack (
#25385b302458+#25397803302b+#25402bd59c88) + regression row (0 SELinux denials, 0 failed units, 0 new kernel errors). - M4 Pro (27.x firmware) boot and display row.
- Paired two-pipe (e.g. 4K240) live trace exercising
dcp_peer_swap_complete_v27().
- Repeated J716c boot row on the rebased stack (
- §6 Naming: PASS.
CI Status
- 0 GitHub Actions checks ran on
7803302be7eebecause this PR targets stacked branchj716c/t6050-mcc-display-ready(host-tests.ymlonly triggers onintegration/aurora/aurora-wip).host-testsCI will need to run and pass once retargeted after #2538 lands.
Assisted-by: LLM (Gemini 4 Neon)
|
Re-checked at 7803302: a rebase onto #2538 at 5b30245 plus the commit-message cleanup. The patch is identical to 6195f71 (same patch-id), so our earlier review stands, and the commit now has only your Signed-off-by. The M4 Pro boot and display row we offered is still to come, and we'll run it on 7803302 with #2538 at 5b30245. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR re-review at live head 7803302be7ee: requesting changes on stack/CI/§5 blockers (0 code, locking, safety, or attribution defects found).
Verification Summary
- Code, locking & safety (§1–§3): Clean.
boot_surface_pendingfollows hardware state (dfb_region_size > 0) rather than chip/compatible gating, fails safe on-ENOMEMfromapple_mcc_boot_scanout_reserve(), serializesDCP_FW_SWAP(dcp)anddcp_report_swap_complete()underdcp->iomfb.lockwith no lock inversion againstapple_mcc_boot_scanout_retired(), and handles slot-zero replay/clear cleanly acrossapple_atomic_check(),iomfb_scanout_prepare_h17p(), andiomfb_flush(). Independently verifiedtools/asahi/dcp-peer-shown-tests.py(PASS +--always-shownand--owner-onlymutants killed) andtools/asahi/dcpext26-queue-tests.py(PASS +--drop-v27-closemutant killed) on7803302be7ee. - Attribution & naming (§4, §6 naming): Clean — commit
7803302be7eecarries human author/committer + humanSigned-off-by:only; PR body carriesAssisted-by:.
Blockers
- Unmerged stack dependency & base branch: Targets stacked branch
j716c/t6050-mcc-display-ready(#2538 @5b302458524f, still open and stacked on open #2518 @e6fdaf6d4b23). #2518 and #2538 must land first and this PR must be retargeted ontointegration/aurora. - Live CI (§6): 0 GitHub Actions checks ran on
7803302be7eebecause the PR targets a stacked branch (host-testsandapple-drm-kunitonly trigger onintegration/aurora/aurora-wip). Green live CI is required once retargeted. - Live-head hardware & regression proof (§5): Prior J716c rows were on an older base; still required on the exact live head
7803302be7ee(matchingStill to run):- Repeated J716c boot row on the rebased stack (
#2538+#2539+#2540) plus full regression row (0 SELinux denials, 0 failed units, 0 new kernel errors). - M4 Pro (27.x firmware) boot and display row.
- Paired two-pipe (e.g. 4K240) live trace exercising
dcp_peer_swap_complete_v27().
- Repeated J716c boot row on the rebased stack (
Assisted-by: LLM (Gemini 4 Neon)
|
Note 🤖 Gemini 4 Hydrogen responding on behalf of erikwb Confirmed
Updated the PR description to standard Problem/Change/Testing/Still-to-run sections and folded in the J716c (M5 Max) boot of the stacked Retargeting to |
Problem
A display controller that the bootloader left scanning out a boot framebuffer can still display that surface after DRM registration. Without tracking boot scanout retirement and keeping slot zero synchronized during early atomic commits, a memory cache controller waiting on boot DMA retirement cannot know when the native driver has taken over the display, and cursor- or overlay-only commits before the first primary-plane swap can leave or drop slot-zero state inconsistently.
Change
dcp->dfb_region_size > 0indcp_firmware_metadata_v27()indrivers/gpu/drm/apple/dcp.c), without chip or compatible gating. Reserve the retirement record at bind (apple_mcc_boot_scanout_reserve()) and report retirement (apple_mcc_boot_scanout_retired()) indcp_report_swap_complete()(drivers/gpu/drm/apple/iomfb_template.c) only once an accepted, displayed KMS swap replaces or clears slot zero. If the record cannot be allocated (-ENOMEM), display takeover still proceeds and no retirement is reported, so cache allocation stays off.shown) state through paired firmware-27 completions (dcp-peer-frames-v27.h,dcp-peer-runtime-v27.inc) soboth_shownis true only when both engines reported the retired watermark swap as displayed.boot_surface_pendingis set,apple_atomic_check()(drivers/gpu/drm/apple/apple_drv.c) pulls touched active CRTCs and their primary plane into atomic commits so cursor- or overlay-only commits replay the intended slot-zero surface with its own framebuffer reference. When the primary plane is disabled while takeover is pending,iomfb_scanout_prepare_h17p()(drivers/gpu/drm/apple/iomfb.c) drops any inheritedscanout->fb[0]reference andiomfb_flush()forces an explicit slot-zero update (BIT(0)).Stack:
satchlj/mcc-t6050-slc-allocate-20261120)j716c/t6050-mcc-display-ready@5b302458524f)j716c/display-takeover-ready)j716c/t6050-cache-planes)Testing
Verified at
7803302be7ee(stacked cleanly on #25385b302458524fwith human-onlySigned-off-by:):python3 tools/asahi/run-host-tests.py --only dcp-peer-shown(3/3 passed: baseline +--always-shownand--owner-onlymutants killed) andpython3 tools/asahi/run-host-tests.py --only dcpext26-queue(2/2 passed: baseline +--drop-v27-closemutant killed).make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/withCONFIG_DRM_APPLE=m): 0 errors, 0 new warnings in modified files (appledrm.olinked cleanly; 2 pre-existing kernel-doc warnings remain atdcp.c:776)../scripts/checkpatch.pl --strict --git 5b302458524f..7803302be7ee: 0 errors (1 pre-submission MAINTAINERS note for the new test file).Prior hardware tests on J716c (M5 Max, 27.2 firmware) at
6195f71c(#2539), paired withbddfd572(#2538) andf3a64c0ed945(the earlier#2540board-local 32-planet6050-j716c.dtscommit carrying themccnode andframebuffer@0display = <&dcp>phandle):apple-dcp 48ae00000.dcp: boot scanout retired by displayed swap 6, thenapple-mcc 2220000000.memory-controller: system level cache allocation enabled on 32 planes0.4 ms later (vs enabling at 0.66 s, before display takeover, prior to this stack).simpledrm): simpledrm kept the panel andapple-mccstayed deferred (apple-mcc: waiting for /soc@200000000/dcp@48ae00000 to retire boot scanout), keeping allocation off.J716c (M5 Max) boot of
08fa25353657(stack#2518e6fdaf6d4b23+#25385b302458524f+#25397803302be7ee+#254008fa25353657on merge-base26294e82e9c8, arm64 kernel config,LLVM=1,clang23.1.4, default kernel command line, current Aura loader):/sys/class/drm/card2-eDP-1connected and enabled at 3456x2234;apple-dcp 48ae00000.dcp: boot scanout retired by displayed swap 6) and desktop started, confirming DCP retired boot scanout on swap 6./proc/device-tree/soc@2220000000/memory-controller@2220000000/statusreadsdisabledwith noapple-mccdevice bound because#254008fa25353657leavesmccstatus = "disabled"until the companion loader populatesreg, so the MCC wait and enable path remains untested on this head.0SError / synchronous external abort / oops / BUG / call-trace / unhandled-fault / panic lines indmesg,0MMIO fault lines,0AVC denials (Arch ARM without SELinux),0takeover/mcc/boot-dmaerrors, and0kernel errors attributable to the stack (1pre-existing failed unitaurora-peripherals.service, and the 28err..emergjournal lines belong to error groups seen on earlier same-day J716c boots on trees without#2185/#2187/#2162underneath; no bare26294e82e9c8baseline boot was taken).Still to run
integration/auroraand confirm green live CI (host-tests,apple-drm-kunit) once soc: apple: mcc: let the T6050 system level cache allocate #2518 and soc: apple: mcc: wait for display controllers to retire boot scanout #2538 land.#2538(5b302458524f) +#2539(7803302be7ee) +#2540(08fa25353657) withmccenabled (regpopulated from/arm-io/mccamcc-enable-maskandstatus = "okay") on default kernel command line with regression counts (0SELinux/AVC denials,0failed units,0new kernel errors); the current-loadermcc-disabled boot at08fa25353657is already verified above.dcp_peer_swap_complete_v27().Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon, Google:Gemini 4 Hydrogen)