Skip to content

drm/apple: admit DCPDPService/AppleDCPPS186 on 0x28 and fix live DPTX handoff hotplug - #3567

Merged
DjDeveloperr merged 3 commits into
mainfrom
fix/dpavservep-t8103-dcpdpservice
Dec 1, 2026
Merged

DjDeveloperr merged 3 commits into
mainfrom
fix/dpavservep-t8103-dcpdpservice

Conversation

@sithglan

@sithglan sithglan commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What: Admit DCPDPService and AppleDCPPS186 (unit 0) on DPAVSERV_ENDPOINT (0x28) so T8103 dcpext exposes the sink EDID over USB-C DP Alt Mode and PS186 USB-C-to-HDMI docks, and release a boot-adopted DPTX display after iomfb_start_rtkit() (guarding dcp_connector_update_dict() against a NULL connector) so live dcp-live-v1 DPTX handoff delivers the connect hotplug immediately — fixing USB-C display EDID, live handoff, and DCP audio on both HDMI and USB-C outputs on the M1 Mac mini (J274).
Tested: J274 M1 Mac mini at f75c5e8ecf41 (firmware 27.2, 7.3.0-j313-272+, default cmdline): full 6-case autonomous live handoff matrix from Aura (749dd6de) — USB-C port 0 (card1-DP-1, EV2780, 2560x1440@60, edid=256), USB-C port 1 (card1-DP-2, EV2780 & Parade PS186 USB3/HDMI dock, 2560x1440@60, edid=256), two-USB-C live pipeline handover, HDMI only (card1-HDMI-A-1, 2560x1440@60, edid=256), HDMI + USB-C live hotplug and dual live dcp+dcpext cold boot (both 2560x1440@60, edid=256), audible DCP audio on both HDMI (Apple HDMI, 238330000.audio-controller) and USB-C (Apple USB-C DisplayPort, 238334000.audio-controller) via ALSA and PipeWire (s24-32le 2ch 48000Hz), DPMS off/on, and dual-display Sway, 0 failed units, 0 new kernel errors; arm64 KUnit apple-*: 143/143 passed; checkpatch.pl --strict --git: 0 errors, 0 warnings.
Risk: two-way door · M1–M4 Macs with external DisplayPort over apple-dcp (dcpext / DPAVSERV_ENDPOINT).
Not yet: Tested on J274 (T8103); M2/M3/M4 Macs with live DPTX handoff or DPAVSERV_ENDPOINT not yet re-run at this head.

Details
  1. dpavservep.c / dpavservep-identity-test.c: On T8103 dcpext with firmware 27.2, DPAVSERV_ENDPOINT (0x28) advertises native DP Alt Mode EDID services as class DCPDPService and Parade PS186 USB-C-to-HDMI dock EDID services as class AppleDCPPS186 with EPICUnit 0 (while channel 7 is rejected as optional/unsupported). Admitting both with unit == 0 alongside DCPDP13Service and AppleDCPMCDP29XX/AppleDCPMCDP2900 (keeping the bounded dynamic interface-id check and rejecting unit != 0 and non-DP classes) allows dcpext to read the 256-byte sink EDID (and populate the audio ELD) on both native DP and PS186 HDMI docks.
  2. dcp.c / connector.c: When Aura hands dcpext on running via dcp-live-v1, releasing the adopted DPTX display (dptxport_set_hpd(false) + dptxport_release_display()) before iomfb_start_rtkit() prevented firmware from observing the disconnect over IOMFB; on the subsequent Type-C connect firmware trained the link and enumerated sink modes, but never delivered dcpep_cb_hotplug(1). Moving the release to immediately after iomfb_start_rtkit() delivers connected:0 followed by connected:1 right away (t~2.55s). Because IOMFB can deliver boot-display dictionary updates during iomfb_start_rtkit() before a Type-C route binds a connector to dcpext, dcp_connector_update_dict() now frees the incoming chunk buffer and returns cleanly when connector == NULL.
Evidence
  • Commits on main (37a9d68180b2):
    • b0f1acfc21d1 drm/apple: dpavservep: admit DCPDPService on DPAVSERV_ENDPOINT
    • d00e528aa06b drm/apple: dcp: release adopted DPTX display after starting IOMFB
    • f75c5e8ecf41 drm/apple: dpavservep: admit AppleDCPPS186 on DPAVSERV_ENDPOINT
  • ./scripts/checkpatch.pl --strict --git origin/main..HEAD: 0 errors, 0 warnings, 0 checks.
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --cross_compile=aarch64-linux-gnu- --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig 'apple-*': Ran 143 tests: passed: 143.
  • J274 autonomous 6-case matrix (dcp-live-v1 from Aura 749dd6de):
    • Native USB-C DP (port 0 card1-DP-1 & port 1 card1-DP-2): AFK[ep:28]: new service DCPDPService on channel 5, dcp_hotplug() connected:1 nr_modes:18, boot scanout retired by displayed swap 3, edid=256, 2560x1440@60.
    • Parade PS186 USB3/HDMI dock (port 1 card1-DP-2): AFK[ep:28]: new service AppleDCPPS186 on channel 5, dcp_hotplug() connected:1 nr_modes:22, boot scanout retired by displayed swap 3, edid=256, 2560x1440@60.
    • HDMI only (card1-HDMI-A-1): boot scanout retired by displayed swap 3, edid=256, 2560x1440@60; card1-DP-1/2 disconnected.
    • HDMI + USB-C (hotplug and dual live dcp+dcpext cold boot): both card1-HDMI-A-1 and card1-DP-1 connected, enabled, edid=256, 2560x1440@60, both boot scanout retired by displayed swap 3.
    • DCP audio on M1 Mac mini (J274): both card 8 (Apple HDMI, 238330000.audio-controller, ELD EV2780, 32–48 kHz) and card 9 (Apple USB-C DisplayPort, 238334000.audio-controller, ELD EV2780, 32–96 kHz) play audibly through ALSA (S16_LE) and PipeWire (s24-32le 2ch 48000Hz) via apple-sio, 0 kernel errors.
    • DPMS blank/unblank (fb0/blank 4 -> 0): cleanly powered off and restored 2560x1440@60.
    • Dual-display Sway: DP-2 (2560x1440 @ 59.951 Hz) + HDMI-A-1 (1920x1200 @ 59.950 Hz) active simultaneously, 0 failed units (systemctl --failed), 0 display/DART/SError kernel errors.

On T8103 external DisplayPort over USB-C (dcpext) with firmware 27.2,
DPAVSERV_ENDPOINT (0x28) announces the sink EDID service as class
DCPDPService with EPICUnit 0. Admit DCPDPService on DPAVSERV_ENDPOINT
alongside DCPDP13Service (still requiring unit 0 and a bounded dynamic
interface ID) so external DP Alt Mode displays expose their full sink
EDID instead of dropping the service as unsupported.

Update the dpavservep identity KUnit test cases accordingly.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
When a boot stage hands an active DPTX DCP (such as T8103 dcpext over
USB-C DP Alt Mode) over live via dcp-live-v1, releasing the adopted
display before iomfb_start_rtkit() prevents firmware from observing the
disconnect over IOMFB. On the subsequent Type-C connect, firmware trains
the link and enumerates sink modes but never delivers the connect hotplug,
leaving the connector stuck disconnected.

Move the adopted DPTX HPD-low and release_display sequence to right after
iomfb_start_rtkit(). Guard dcp_connector_update_dict() against a NULL
connector (freeing the incoming chunk buffer cleanly) because IOMFB can
deliver boot-display property updates during iomfb_start_rtkit() before
a Type-C route binds a connector to dcpext.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan requested review from a team as code owners November 28, 2026 21:59

@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 d00e528a (once queued CI checks pass; paired with aura#566)

Blockers: none

Checked:

  • Audited both commits (b0f1acfc, d00e528a) across all 4 touched files (+46/-27); zero code blockers found.
  • Verified dcpavserv_identity() in drivers/gpu/drm/apple/epic/dpavservep.c admits "DCPDPService" only on DPAVSERV_ENDPOINT (0x28) with unit == 0 and bounded dynamic interface-id (1..0xffff), matching DCPDP13Service, with full positive and negative unit/channel/class coverage added in dpavservep-identity-test.c.
  • Verified dcp_start() in drivers/gpu/drm/apple/dcp.c moves the dcp->rtkit_adopted && dptx_service_available(&dcp->dptxport[0]) dptxport_set_hpd(false) + dptxport_release_display() release to immediately after iomfb_start_rtkit() while keeping the #ifdef DCP_DPTX_DISCONNECT_ON_INIT branch gated with !dcp->rtkit_adopted.
  • Verified dcp_connector_update_dict() in drivers/gpu/drm/apple/connector.c safely frees and clears chunks->data (kvfree, NULL, length = 0) and returns when connector == NULL, preventing both a NULL dereference and a memory leak if IOMFB delivers boot-display dictionary updates before a connector is bound.
  • Verified exact-head J274 (T8103, firmware 27.2) live handoff and dual-display Sway (DP-2 2560x1440@60 with 256-byte EDID + HDMI-A-1 1920x1200@60, DPMS blank/unblank clean, 0 failed units, 0 kernel errors), 141/141 arm64 apple-* KUnit, checkpatch.pl --strict 0/0/0, and PR text (What/Tested/Risk two-way door).
Evidence
  • drivers/gpu/drm/apple/connector.c:333-348: if (!connector) frees chunks->data via kvfree() and clears data/length before locking connector->chunk_lock.
  • drivers/gpu/drm/apple/dcp.c:5180-5230: adopted DPTX release now runs after iomfb_start_rtkit() succeeds so firmware delivers connected:0 then connected:1 (t=3.35s on J274).
  • drivers/gpu/drm/apple/epic/dpavservep-identity-test.c: tests DCPDPService unit 0 (accept), unit 1 (reject), channel 0 (reject), channel 0x10000 (reject), and DCPUnknownService (reject).

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m4 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 Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at f75c5e8e: not ready yet

Check Detail
CI at head running running: KUnit asahi, KUnit spi-hid-apple, KUnit avd, KUnit ave, KUnit isp, KUnit jpeg
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at f75c5e8e
Conflicts ok none
PR text ok Risk: two-way · M1–M4 Macs with external DisplayPort over apple-dcp (dcpext / DPAVSERVENDPOINT).

Areas: area:display

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

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at d00e528a. App approved (NEON-PR-REVIEW2), T8103 row. The DPAVSERV admission, the adopted-DPTX release order and the dcp_connector_update_dict() guard are shared by every DCP Mac, so it needs one more family at this head (J316s, J413 or J616s: Type-C DP monitor attached at boot, hotplug out/in, internal panel unaffected, 0 DART faults). Merges under the 6-point rule after that and green CI, unless you object.

USB-C to HDMI docks using a Parade PS186 converter announce their AV
service on DPAVSERV_ENDPOINT (0x28) as class AppleDCPPS186 with
EPICUnit 0 on firmware 27.2. Admit AppleDCPPS186 alongside the MCDP29xx
DP-to-HDMI converter classes (requiring unit 0 and a bounded dynamic
interface ID) so displays behind PS186 docks expose their sink EDID.

Add KUnit identity cases for AppleDCPPS186 unit 0 and unit 1.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan sithglan changed the title drm/apple: admit DCPDPService on 0x28 and fix live DPTX handoff hotplug drm/apple: admit DCPDPService/AppleDCPPS186 on 0x28 and fix live DPTX handoff hotplug Nov 28, 2026

@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 f75c5e8ecf41 after hosted CI and the peer hardware row.

Blockers: The existing second-family Type-C display regression and hosted checks remain due. If the peer uses a PS186 dock on a laptop, also check that ordinary SDR hotplug still works with the HDR service bound.

Checked: The incremental change admits the named PS186 class on the classic AFKv2 endpoint at unit zero. The service-name, endpoint, channel bounds, and generation/epoch checks remain in force. The unit-one test rejects the new class outside its expected unit. HDR publication remains under the existing laptop and firmware checks. The exact J274 receipt covers native USB-C DP, the PS186 dock, EDID and hotplug and reports 143/143 display KUnit tests.

Evidence
  • One commit over the previously approved d00e528aa06b. Checked the two-file delta and the exact J274 receipt in the PR body.

@erikwb

erikwb commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

J716c (16-inch M5 Max) at f75c5e8ecf41: boots; internal panel unaffected, two external 4K displays come up with valid EDID and full mode lists, and two DPMS off/on cycles bring all three back with no kernel messages. The externals are on a Thunderbolt dock (CalDigit TS5), not a PS186 dock; physical replug not run.

Evidence

Batched kernel 7.3.0-ewb353+ = main 219311530ef0 + #3552 46d51a741dcf + #3566 74b7061e457b + #3567 f75c5e8ecf41 + #2070 81a7880e9f25, each head merged unchanged. One local change: the J716c DTB is built without #include "t6050-media.dtsi" in t6050-j716c.dts, because main since #2278 hangs the J716c at boot (#3618). One-shot trial boot on the default command line plus watchdog.open_timeout=120 (a recovery watchdog for test boots only); compared against the default 7.3.0-ewb342+ on the same Mac and cables.

  • eDP-1 3456x2234@120; DP-1 and DP-4 3840x2160@240, 256-byte EDID, 40 modes each; identical to the default kernel.
  • Two cycles of dpms off (10 s) / dpms on (15 s) on all displays: 3/3 off, 3/3 back on at the same modes each time, both externals connected, 0 kernel log lines during the cycles.
  • 0 DART faults; failed units: aurora-peripherals.service only, same as the default boot.

@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: HOLD at f75c5e8ecf41 pending the peer physical hotplug and hosted checks.

Blockers: Keep the J616s physical unplug/replug row. Confirm connector rediscovery, EDID and modes after reconnect, and check the kernel log for DART or DCP errors.

Checked: The J716c receipt adds a second-family attached boot and two DPMS cycles with both external displays returning and zero DART faults. DPMS exercises display power transitions. Physical disconnect and rediscovery remain untested on that peer. J274 already covers native USB-C DP and live PS186 hotplug. The J716c boot used a Thunderbolt dock and the documented media-DT workaround for #3618.

Evidence

#3567 (comment)

@sithglan

Copy link
Copy Markdown
Contributor Author

Hardware verification (second-family peer physical hotplug): MacBook Air (13-inch, M5, J813 / T8142) at f75c5e8ecf41 — PASS

  • Build & boot: exact PR head f75c5e8ecf41eab55dcee7d6e2a234675912295e (Linux air5 7.3.0-aurora-j813-pr3567+ #2 SMP PREEMPT Sun Nov 29 18:33:02 CET 2026 aarch64 GNU/Linux), booted via one-shot aura-try (aurora/boot-pr3567/Image.gz;aurora/boot-pr3567/t8142-j813.dtb;aurora/boot/initramfs.cpio.gz, default cmdline).
  • Internal display unaffected: card1-eDP-1 stayed connected / enabled (2560x1600) across boot, attach, physical unplug, and physical replug.
  • Initial physical USB-C attach (port1, 3aae00000.dcp, card1-DP-2, EIZO FlexScan EV2780):
    • Admitted apple-dcp 3aae00000.dcp: AFK[ep:28]: new service DCPDPService on channel 1 (on stock main+ this fails with -19 and falls back to 128-byte firmware-derived EDID; on f75c5e8ecf41 real 256-byte sink EDID is read, dcp_hdr_service_bind bound on laptop !dcp->desktop with ordinary SDR output working cleanly).
    • card1-DP-2: status=connected, enabled=enabled, dpms=On, edid=256B (ENC 0x2811 EV2780, 1 extension block, valid checksums cs0=0 cs1=0, sha256: 9a5d990e8cde14432b673424aee5cd7cf5d0db5d7fdde6b0c7eeb7c7e377452b), 18 modes (2560x1440@60 active, set_digital_out_mode finished:2056).
  • Physical unplug (t=139.57..139.72s on VT2):
    • Clean dcp_hotplug() connected:0 -> unplug_gated: display HPD removed -> dcp_poweroff() done -> dcp_dptx_disconnect(port=0).
    • card1-DP-2: status=disconnected, enabled=disabled, dpms=Off, edid=0B, nmodes=0.
  • Physical replug (t=167.72..168.30s on VT2, then switched back to Sway on VT1):
    • Re-admitted apple-dcp 3aae00000.dcp: AFK[ep:28]: new service DCPDPService on channel 5 (AFK optional dcpdp-service-epic (DCPDPService) is unsupported on channel 7).
    • dcp_hotplug() connected:0 valid_mode:0 nr_modes:18 -> dcp_hotplug() connected:1 valid_mode:0 nr_modes:18 -> set_digital_out_mode(color:75 timing:47) "2560x1440": 60 (finished:2050).
    • Rediscovered card1-DP-2: status=connected, enabled=enabled, dpms=On, identical 256-byte sink EDID (ENC 0x2811 EV2780, cs0=0 cs1=0, sha256: 9a5d990e8cde14432b673424aee5cd7cf5d0db5d7fdde6b0c7eeb7c7e377452b), 18 modes, active on both VT2 and Sway VT1.
  • Health & cleanup: 0 failed systemd units (systemctl --failed), 0 DART faults, 0 DCP/IOMFB timeouts or errors, 0 kernel warnings/BUGs/SErrors. Removed /mnt/esp/aurora/boot-pr3567/ and /lib/modules/7.3.0-aurora-j813-pr3567+, verified clean return to default stock boot (7.3.0-aurora-j813-main+, 0 failed units).

@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 f75c5e8e once the merge gates are satisfied.

Checked: The J813 physical replug receipt satisfies the outstanding request for a second DCP family. The internal panel stayed enabled, the external connector dropped on unplug, and the same 256-byte sink EDID and 18 modes returned after replug. The receipt reports zero DART faults or DCP/IOMFB errors and confirms return to the stock boot. The earlier J274 exact-head row covers native USB-C DP and the PS186 dock. Hosted Apple build, host tests, KUnit, and the latest PR-text and readiness jobs passed.

Please update the validation summary with the J813 receipt so the hardware gate can pick it up.

#3567 (comment)

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 30, 2026

@DjDeveloperr DjDeveloperr 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.

Approved at f75c5e8. The new DP service identities require unit zero and retain the interface ID bounds. An adopted port releases its display after IOMFB starts. The early connector callback frees its unclaimed chunks. The J274 runs covered native DisplayPort and the PS186 dock. The J813 physical replug restored the 256-byte EDID and all 18 modes without a DART fault or DCP error.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 1, 2026
@DjDeveloperr
DjDeveloperr merged commit 4703347 into main Dec 1, 2026
49 of 74 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/dpavservep-t8103-dcpdpservice branch December 1, 2026 06:46
@satchlj

satchlj commented Dec 1, 2026

Copy link
Copy Markdown
Member

Regression on J775c (M5 Max, HDMI through a live-handed-over dcpext0) from d00e528aa06b (drm/apple: dcp: release adopted DPTX display after starting IOMFB).

With linux main a171afd2 (+ #3689, #3682), on some boots no swap is ever displayed on dcpext0. Nothing then retires the boot scanout, so apple-mcc keeps waiting (deferred probe pending: apple-mcc: waiting for /soc/dcp@2b2e00000 to retire boot scanout) and the system level cache stays off for the whole boot. In 2 of 3 boots the SLC was still off after 3 minutes, and llama-2-7B tg128 dropped from about 111.7 to 109.0 t/s. The third boot logged boot scanout retired by displayed swap 4 at 5.5 s and was normal.

The same tree with only d00e528aa06b reverted: 4 of 4 boots retired the boot scanout at 5.2–5.6 s, SLC on, tg128 111.4–111.9, the same as the previous default (e6c7b032 base, 3 boots, SLC at 4.2–5.2 s, tg128 111.3–111.9). Alternating boots, default command line, display rows otherwise identical: DCP bound, HDMI connected, 0 failed units.

So moving the adopted-DPTX HPD-low and release after iomfb_start_rtkit() sometimes leaves a live HDMI handoff (not Type-C) with no first displayed swap. I haven't looked at why yet. A fix that keeps the Type-C behaviour could limit the late release to Type-C routes, chosen by a property of the route rather than the board. Happy to test candidates on J775c.

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:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants