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) |
Summary
dfb_region_size), not onlyapple,t6050-dcp. Reserve its retirement record at bind (apple_mcc_boot_scanout_reserve()) and report it (apple_mcc_boot_scanout_retired()) only when an accepted, shown KMS swap replaces or clears slot zero. If the record cannot be allocated, the display still takes over and no retirement is reported, so cache allocation stays off.dcp-peer-frames-v27.h, host testtools/asahi/dcp-peer-shown-tests.py).apple_atomic_check()pulls touched active CRTCs and their primary plane into atomic commits, so cursor- or overlay-only commits replay the intended slot-zero surface. When the primary plane is disabled while takeover is pending,iomfb_flush()forces an explicit slot-zero clear.Stack
satchlj/mcc-t6050-slc-allocate-20261120)j716c/t6050-mcc-display-ready@5b302458524f)j716c/display-takeover-ready)j716c/t6050-cache-planes)Testing
5b302458524f) with identicaldrivers/gpu/drm/apple/and test changes.python3 tools/asahi/dcp-peer-shown-tests.py(paired first modeset shown, one half not shown, engine drift, stale shown, duplicate completion; two mutants caught) andpython3 tools/asahi/dcpext26-queue-tests.pypass.ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/);scripts/checkpatch.plreports 0 errors (only the MAINTAINERS note for the new test file).Prior hardware test on the J716c (M5 Max) with this stack on a kernel built from the J716c's current base, with 27.2 firmware:
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. Before this stack, allocation was enabled at 0.66 s, before the display had taken over.apple-mcc: waiting for /soc@200000000/dcp@48ae00000 to retire boot scanout), so allocation stays off.Still to run
#25385b302458+#2539+#2540).Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon)