Repository navigation
drm/apple: dcp: release an adopted fixed-port DPTX display before IOMFB - #3765
Conversation
Commit d00e528 ("drm/apple: dcp: release adopted DPTX display after starting IOMFB") moved the HPD-low and release_display of a DPTX display handed over running (dcp-live-v1) from before iomfb_start_rtkit() to after it, for every adopted DCP. A Type-C output needs that: released before, the firmware never sees the disconnect over IOMFB and the next Type-C connect gets no connect hotplug. A fixed HDMI port handed over live does not: with the release after iomfb_start_rtkit(), some boots never display a swap on it, so the boot scanout is never retired and whatever waits for that (the system level cache enable in apple-mcc) waits for the whole boot. Releasing it before iomfb_start_rtkit(), as before that commit, does not show this. Choose the point from the output: after iomfb_start_rtkit() for a Type-C output (dcp_is_typec_output(): a "USB-C" apple,connector-type, or a Type-C route already bound), before it for a fixed HDMI or DisplayPort output. The choice is read once, so that a route binding while IOMFB starts cannot skip both. The NULL-connector guard in dcp_connector_update_dict() from that commit stays. Add a KUnit case to apple-dcp-handoff for the choice. Fixes: d00e528 ("drm/apple: dcp: release adopted DPTX display after starting IOMFB") Signed-off-by: Satya Benson <satya@benson.earth>
|
Tested at
Details
|
|
Tested at exact head
Comparison on the same J775c (same userspace and Stage 2):
Note on boot 2 (the 1/6 deferred boot): Regression checks across all 6 boots: HDMI-A-1 connected (2560x1440@60), 0 failed systemd units, 0 new kernel errors compared to baseline. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…se-hdmi Signed-off-by: Satya Benson <satya@benson.earth>
Signed-off-by: Satya Benson <satya@benson.earth>
|
Hardware row at exact head
|
sithglan
left a comment
There was a problem hiding this comment.
Reviewed at exact head 510a838db7a7:
dcp_adopted_release_after_iomfb()cleanly keys offdcp_is_typec_output()(DT connector type / active Type-C route, no model gating) and snapshotsrelease_after_iomfbonce indcp_start()before endpoint startup, preventing a concurrent Type-C route bind from skipping or double-runningdcp_release_adopted_dptx().- Fixed HDMI/DP outputs restore the pre-
d00e528aa06bpre-IOMFB release while USB-C outputs keep the post-IOMFB release, preserving#3567's NULL-connector guard andret = 0error semantics. - KUnit coverage (
dcp_handoff_adopted_release_order), all CI checks, and the exact-head J775c 3/3 boot hardware row at510a838db7a7are in place.
There was a problem hiding this comment.
Verdict: MERGE at 510a838
Checked:
release_after_iomfbis read once, before the endpoints start, so exactly one of the two release points can run. The early release sits in thedptxep_init()success branch and is still well-formed withDCP_DPTX_DISCONNECT_ON_INITboth defined and undefined (itselse if (!rtkit_adopted ...)arm doesn't overlap).- The release body is unchanged (HPD low, then release_display). The old
ret = 0is not needed, because the helper leavesretalone andiomfb_start_rtkit()'s ret has already been checked. - Scope:
rtkit_adoptedonly. USB-C/T8103 dcpext keep d00e528's order. Fixed HDMI/DP go back to the pre-#3567 order. The KUnit case covers USB-C, HDMI-A, DP, Unknown and hybrid-with-active-route. - Row: J775c 3/3 clean boots with #3682 @bb01f44f on aura main. HDMI-A-1 is live via dcpext0,
boot scanout retired by displayed swapappears, SLC is on, and s2idle is clean.
Follow-ups: a T8103 Type-C live-handoff row at this head (USB-C connect hotplug), and an M1/M2 mini HDMI live-handoff row.
RyanTheTide
left a comment
There was a problem hiding this comment.
Code-owner approval at 510a838. Checked: the release point is chosen once, before the endpoints start, so exactly one of the two releases runs. The early release builds with and without DCP_DPTX_DISCONNECT_ON_INIT. It applies to adopted DCPs only, and USB-C keeps the #3567 order. J775c 3/3 row paired with #3682 @bb01f44f. Follow-up: T8103 Type-C and M1/M2 mini HDMI live-handoff rows. Merge before or with #3682.
What: Release a DPTX display handed over running (
dcp-live-v1) afteriomfb_start_rtkit()only on a Type-C output, and before it again on a fixed HDMI or DisplayPort output. d00e528 (#3567) moved the release after IOMFB for every adopted DCP; on the J775c's HDMI port (dcpext0, a fixed output) that leaves 2 of 3 boots with no displayed swap, so the boot scanout is never retired and apple-mcc never enables the system level cache (evidence). Required for daily-use stability on J775c.Tested: build and KUnit only at
836c1955db87: Apple driver build (CI configuration: defconfig +asahi.config, LLVM) ofdrivers/gpu/drm/apple/compiles with 0 warnings (alsoW=1);display.kunitconfigon arm64 QEMU 190 tests, 189 passed, 1 skipped, 0 failed;apple-dcp-handoff4/4 including the new case. No hardware row at this head yet.Risk: two-way door · Macs whose boot loader hands a DCP over running on a DPTX port: fixed HDMI/DP outputs (J775c dcpext0 with #3682, the M1/M2 Mac mini HDMI
dcp) go back to the release order from before d00e528; USB-C outputs (T8103 dcpext) keep d00e528's order.Not yet: J775c row at this head (HDMI, live dcpext0 handoff, several boots: boot scanout retired, SLC on). T8103 Type-C row at this head (USB-C DP Alt Mode connect hotplug after a live handoff), asked of the #3567 author.
Details
dcp_is_typec_output(), the existing helper the Type-C code already uses: true for aUSB-Capple,connector-typeor a Type-C route already bound to the DCP. It is read once indcp_start(), before the endpoints start, so a route that binds while IOMFB starts cannot make it skip both release points.apple,connector-type = "USB-C"withtypec-routes, so it keeps the release afteriomfb_start_rtkit(), the order drm/apple: admit DCPDPService/AppleDCPPS186 on 0x28 and fix live DPTX handoff hotplug #3567 tested. The J775c's dcpext0 is described (arm64: dts: apple: t6050-j775c: drive HDMI from dcpext0 and describe the boot framebuffer #3682) as"HDMI-A"with adp-phyand no Type-C routes, so it releases before, as it did up to d00e528.release_display) is unchanged and moved intodcp_release_adopted_dptx(). d00e528's NULL-connector guard indcp_connector_update_dict()stays.apple-dcp-handoff.dcp_handoff_adopted_release_orderpins the choice for USB-C, HDMI-A, DP, unknown, and a hybrid with an active Type-C route.Evidence
836c1955db874a905b03a64b49f4076cadaefe82onmain7d5b4e31d.make LLVM=1 ARCH=arm64 defconfig;scripts/kconfig/merge_config.sh -m .config arch/arm64/configs/asahi.config;olddefconfig(CONFIG_DRM_APPLE=m);make LLVM=1 ARCH=arm64 W=1 drivers/gpu/drm/apple/: rc 0, no warnings.tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig:Ran 190 tests: passed: 189, skipped: 1;[PASSED] dcp_handoff_adopted_release_order.scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.boot scanout retired by displayed swap; with it reverted, 4 of 4 did at 5.2-5.6 s.