Skip to content

drm: apple: dcp-fabric: give an idle port's pipeline to a waiting display - #357

Open
ericjuta wants to merge 1 commit into
omacom:integration/aurorafrom
ericjuta:t8122/idle-port-pipeline
Open

ericjuta wants to merge 1 commit into
omacom:integration/aurorafrom
ericjuta:t8122/idle-port-pipeline

Conversation

@ericjuta

@ericjuta ericjuta commented Nov 4, 2026

Copy link
Copy Markdown

A USB-C hub with a DP output (Genesys 05e3:0610/0626 here) enters DP alt mode with nothing plugged in and takes the only T8122 external pipeline. A monitor on the other port then waits (… waits for a free external display pipeline) until the hub is unplugged, so it depends on which port came up first at boot.

When a port with HPD up finds no free pipeline, dcp_typec_reclaim_idle() frees one held by a direct DP-alt port whose sink never asserted HPD and that has no display connected. The idle port keeps DP mode and is routed again once a pipeline is free and its own sink asserts HPD. Nothing changes when the holder has a display, for tunnels, or for ports in SAFE.

Tested on J615 (with the J615 dcpext PR), hub on left-back, C49G95T on left-front:

allocated Type-C DPTX PHY 0
external display pipeline moves from USB-C Left-back (no display) to the display on USB-C Left-front
allocated Type-C DPTX PHY 1
dcp_hotplug() connected:1 valid_mode:0 nr_modes:32

Picture at 5120x1440@120, USB behind the hub kept working, 0 faults. Same path on J613 (one dcpext pipe); not tested there.

Disclosure: written with an AI coding agent (Claude); tested by me on the machine.

@ericjuta

ericjuta commented Nov 8, 2026

Copy link
Copy Markdown
Author

Combined-stack J615 hardware update: #356 (comment) . The user reports stable unplug/replug and lid-open/closed use on 7.2.11-dcpexp-usb-recovery-20261108, which carries this idle-port handover alongside display, thermal and USB-recovery changes. This supports the combined configuration but does not isolate this PR or constitute an exact-branch boot test.

@ericjuta

ericjuta commented Nov 8, 2026

Copy link
Copy Markdown
Author

Source-review follow-up on the combined stack: dcp_typec_reclaim_idle() currently returns false both when no idle route is found and when dcp_typec_route_deactivate(owner) fails. If no free route exists afterward, dcp_typec_route_set() returns the display-busy result. With the #163-style TIPD handling, -ENOSPC is treated as benign pipeline exhaustion rather than a retryable error. This can therefore lose a genuine teardown error during reclaim.

Before treating the combined recovery work as ready, I recommend preserving the deactivation errno separately from the no-idle-route result and adding a failure-injection regression. This is a source-derived concern, not a failure reproduced on the live machine; the reported successful lid/replug use does not exercise it. The local no-HPD routing and TIPD changes overlap #186 and #163, so I am not opening a duplicate PR.

@ericjuta

Copy link
Copy Markdown
Author

Rebased onto integration/aurora 39d5f88ab4e5 (the branch was 62 commits behind) and force-pushed; new head 68ececa2d62d. No conflicts, and the change itself is the same (drivers/gpu/drm/apple/dcp-fabric.c, +49). The commit now carries a Signed-off-by, which it lacked.

Tested at this head on an arm64 host (clang 23.1.5, QEMU):

  • Full tools/aurora-ci/aurora.kunitconfig KUnit run: 1768 tests, 1765 passed, 3 skipped; run-kunit.py --check-only against kunit-expected.json passes. apple-dcp-fabric passes.
  • tools/aurora-ci/check-commits.py: clean.

Not tested: this exact head has not been booted on hardware. The J615 results reported earlier are from a combined local kernel that carries this change with others.

…play

A USB-C hub with a DP output enters DP alt mode with nothing behind it and
takes the only T8122 external pipeline; a monitor on the other port then
waits until the hub is unplugged. When a port with HPD up finds no free
pipeline, take one from a direct DP-alt port whose sink never asserted HPD
and that has no display connected. The idle port keeps DP mode and is
routed again once a pipeline is free and its sink asserts HPD.

If releasing the idle port's pipeline fails, that error is returned and
the idle port keeps its pipeline; the waiting display is not reported as
waiting for a free pipeline.

Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
@ericjuta

Copy link
Copy Markdown
Author

Pushed 263ef537f45b (was 68ececa2d62d), still one signed-off commit on the same base.

It fixes the ambiguity I noted on 11-08. dcp_typec_reclaim_idle() returned false both when no port held an idle pipeline and when dcp_typec_route_deactivate() failed, so a real teardown error came out of dcp_typec_route_set() as "waits for a free external display pipeline" (-ENOSPC). It now returns 1 (released), 0 (nothing idle) or the errno, and dcp_typec_route_set() returns that errno. The idle port keeps its owner in that case, as before, and applied_valid stays false so the next update retries.

Not tested: this head is not compiled or booted here. CI is the compile check, and I'll report a J615 lid/replug boot at this head. The failure path itself has no injection test.

@ericjuta
ericjuta force-pushed the t8122/idle-port-pipeline branch from 68ececa to 263ef53 Compare November 19, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant