Skip to content

drm/apple: dcp: release an adopted fixed-port DPTX display before IOMFB - #3765

Merged
DjDeveloperr merged 3 commits into
mainfrom
fix/dcp-adopted-release-hdmi
Dec 1, 2026
Merged

DjDeveloperr merged 3 commits into
mainfrom
fix/dcp-adopted-release-hdmi

Conversation

@satchlj

@satchlj satchlj commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

What: Release a DPTX display handed over running (dcp-live-v1) after iomfb_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) of drivers/gpu/drm/apple/ compiles with 0 warnings (also W=1); display.kunitconfig on arm64 QEMU 190 tests, 189 passed, 1 skipped, 0 failed; apple-dcp-handoff 4/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
  • The choice is dcp_is_typec_output(), the existing helper the Type-C code already uses: true for a USB-C apple,connector-type or a Type-C route already bound to the DCP. It is read once in dcp_start(), before the endpoints start, so a route that binds while IOMFB starts cannot make it skip both release points.
  • T8103 dcpext is described apple,connector-type = "USB-C" with typec-routes, so it keeps the release after iomfb_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 a dp-phy and no Type-C routes, so it releases before, as it did up to d00e528.
  • A hybrid DCP (a fixed HDMI output first, Type-C routes after) has its fixed output live at handoff, so it releases before unless a Type-C route is already active.
  • The release itself (HPD low, then release_display) is unchanged and moved into dcp_release_adopted_dptx(). d00e528's NULL-connector guard in dcp_connector_update_dict() stays.
  • Why the late release breaks a fixed HDMI handoff is not known; this restores the order that worked there, as measured.
  • New KUnit case apple-dcp-handoff.dcp_handoff_adopted_release_order pins the choice for USB-C, HDMI-A, DP, unknown, and a hybrid with an active Type-C route.
Evidence
  • Head 836c1955db874a905b03a64b49f4076cadaefe82 on main 7d5b4e31d.
  • Build (aarch64 Arch VM, clang/lld/rustc), as the Apple build job configures it:
    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.
  • KUnit: 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.
  • J775c regression and revert rows that this follows: drm/apple: admit DCPDPService/AppleDCPPS186 on 0x28 and fix live DPTX handoff hotplug #3567 (comment 7304906988): with d00e528, 2 of 3 boots never logged boot scanout retired by displayed swap; with it reverted, 4 of 4 did at 5.2-5.6 s.

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>
@satchlj
satchlj requested review from a team as code owners December 1, 2026 08:27
@satchlj
satchlj requested review from LiamRay11 and malik-na December 1, 2026 08:27
@sithglan

sithglan commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Tested at 836c1955db87 on J813 (MacBook Air M5, T8142, fw 27.2) with an external Type-C DisplayPort monitor attached: PASS (no regression; note scope below).

Machine SoC Head Test Result
J813 T8142 836c1955db87 Boot with internal eDP (286e00000.dcp, live handoff) + Type-C DP (506e00000.dcp, EIZO EV2780 2560x1440@60) + DPMS off/on PASS
Details
  • One-shot aura-try boot (7.3.0-aurora-j813-pr3765+, in-tree t8142-j813.dtb).
  • apple-mcc 220000000.memory-controller: system level cache allocation enabled on 4 planes
  • Internal eDP (286e00000.dcp, live boot handoff): boot scanout retired by displayed swap 4, 2560x1600 @ 60.000 Hz.
  • External Type-C DP (506e00000.dcp, no boot framebuffer): allocated Type-C DPTX PHY 0, card2-DP-1 connected (Eizo Nanao Corporation EV2780, 2560x1440 @ 59.951 Hz, dpms=On), set_digital_out_mode finished:2125.
  • swaymsg output DP-1 power off -> power on: clean dpms=Off -> dpms=On recovery back to 2560x1440 @ 59.951 Hz, 0 new kernel errors.
  • Scope note: on J813 the live boot handoff is on internal eDP (286e00000.dcp), not the Type-C dcpext (506e00000.dcp). My T8103 Mac mini (J274) currently only has HDMI attached (no USB-C DP sink connected), so this row covers J813 Type-C DP + live eDP handoff rather than a T8103 live-handoff Type-C hotplug.

@satchlj

satchlj commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Tested at exact head 836c1955db87 (with #3682 carried for the board DTB) on J775c (Mac Studio M5 Max, T6050, fixed HDMI on dcp@2b2e00000, default kernel command line, 6 boots): 5/6 fast SLC, 1/6 deferred (different cause — see below).

Boot boot scanout retired apple-mcc SLC (32 planes) llama-bench tg128 (Llama-2-7B Q4_0, fa=1, Borealis) Failed units
1 displayed swap 3 (~5.0 s) enabled — 0
2 deferred until shutdown swap 3 deferred until shutdown 109.80 ± 0.02 tok/s 0
3 displayed swap 4 (5.29 s) enabled (5.29 s) 112.38 ± 0.03 tok/s 0
4 displayed swap 4 (5.25 s) enabled (5.25 s) 112.12 ± 0.04 tok/s 0
5 displayed swap 3 (7.33 s) enabled (7.33 s) 112.37 ± 0.04 tok/s 0
6 displayed swap 3 (5.10 s) enabled (5.10 s) 112.15 ± 0.10 tok/s 0

Comparison on the same J775c (same userspace and Stage 2):

  • Baseline before #3567 (e6c7b032): 10/10 fast SLC (tg128 ~111.6)
  • main (a171afd2) with #3567 (d00e528a): 1/4 fast SLC, 3/4 deferred (tg128 ~109)
  • a171afd2 with d00e528a reverted: 4/4 fast SLC (5.2–5.6 s, tg128 111.82 median)
  • This PR (836c1955db87): 5/6 fast SLC (5.0–7.3 s, tg128 112.12–112.38)

Note on boot 2 (the 1/6 deferred boot): 836c1955db87 did execute the pre-IOMFB release cleanly (dcp_hotplug() connected:0 valid_mode:0 nr_modes:0 followed by dcp_fixed_hdmi_reconnect), identical to baseline boots. On that boot, the second DP2HDMI HPD bounce (connected:0 -> compact service rebind -> connected:1) arrived right after appledrmfb registered and before any initial modeset, and the display manager (sddm / Hyprland) did not issue a modeset after the second connected:1; as soon as sddm stopped at reboot, fbcon called dcp_poweron() + set_digital_out_mode() and immediately retired the boot scanout (displayed swap 3) and enabled SLC.

Regression checks across all 6 boots: HDMI-A-1 connected (2560x1440@60), 0 failed systemd units, 0 new kernel errors compared to baseline.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at 510a838d: ready to merge

Check Detail
CI at head ok 10 checks passed
Review ok approved by RyanTheTide, sithglan
Requested changes ok none
Hardware row at head ok comment at 510a838d
Conflicts ok none
PR text ok Risk: two-way · 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.

Areas: area:display
Merge: gh pr merge 3765 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 1, 2026
…se-hdmi

Signed-off-by: Satya Benson <satya@benson.earth>
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Dec 1, 2026
Signed-off-by: Satya Benson <satya@benson.earth>
@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Dec 1, 2026
@satchlj

satchlj commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Hardware row at exact head 510a838db7a7 on J775c (Mac Studio M5 Max, T6050, fixed HDMI on dcp@2b2e00000, Aura main d8eb8ad4ae70, default command line, with #3682 bb01f44ff47e applied to t6050-j775c.dts for live HDMI handoff): 3/3 consecutive boots PASS.

  • Boot 1: HDMI-A-1 2560x1440@60 active via dcpext0, boot scanout retired by displayed swap 4, apple-mcc system level cache enabled on 32 planes, Borealis Vulkan device up, 0 failed units, 0 DCP/IOMFB/DART/MCC/GPU faults.
  • Boot 2: HDMI-A-1 2560x1440@60 active via dcpext0, boot scanout retired by displayed swap 3 at 5.100 s, apple-mcc SLC enabled on 32 planes at 5.100 s, Borealis Vulkan up, 0 failed units, 0 faults.
  • Boot 3: HDMI-A-1 2560x1440@60 active via dcpext0, boot scanout retired by displayed swap 3 at 5.353 s, apple-mcc SLC enabled on 32 planes at 5.354 s, Borealis Vulkan up, 0 failed units, 0 faults.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 1, 2026

@sithglan sithglan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at exact head 510a838db7a7:

  • dcp_adopted_release_after_iomfb() cleanly keys off dcp_is_typec_output() (DT connector type / active Type-C route, no model gating) and snapshots release_after_iomfb once in dcp_start() before endpoint startup, preventing a concurrent Type-C route bind from skipping or double-running dcp_release_adopted_dptx().
  • Fixed HDMI/DP outputs restore the pre-d00e528aa06b pre-IOMFB release while USB-C outputs keep the post-IOMFB release, preserving #3567's NULL-connector guard and ret = 0 error semantics.
  • KUnit coverage (dcp_handoff_adopted_release_order), all CI checks, and the exact-head J775c 3/3 boot hardware row at 510a838db7a7 are in place.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 510a838

Checked:

  • release_after_iomfb is read once, before the endpoints start, so exactly one of the two release points can run. The early release sits in the dptxep_init() success branch and is still well-formed with DCP_DPTX_DISCONNECT_ON_INIT both defined and undefined (its else if (!rtkit_adopted ...) arm doesn't overlap).
  • The release body is unchanged (HPD low, then release_display). The old ret = 0 is not needed, because the helper leaves ret alone and iomfb_start_rtkit()'s ret has already been checked.
  • Scope: rtkit_adopted only. 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 swap appears, 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 RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@DjDeveloperr
DjDeveloperr merged commit 2b269b8 into main Dec 1, 2026
15 of 16 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/dcp-adopted-release-hdmi branch December 1, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants