Repository navigation
drm/apple: m4: wake an idle T8132 external DCP without a DPTX re-announcement - #4040
Open
DjDeveloperr wants to merge 2 commits into
Open
DjDeveloperr wants to merge 2 commits into
DjDeveloperr wants to merge 2 commits into
Conversation
A monitor plugged into a T8132 Mac on firmware 26.6.2 more than 5 s after boot stays dark, and its external DCP is lost until a reboot: external DCP restart failed at DPTX ready: -110 Retained DCP session quarantined: -110 The wake from the runtime idle stop takes the CPU out of reset, withdraws both DPTX ports and then waits 1 s for the firmware to announce them again. The firmware does not: apple_rtkit_wake_retained() restarts the image it kept, with no INIT and no endpoint start, so its AFK endpoints and the services on them are the ones of before the stop. On a J713 with 26.6.2 no AFK message arrives and the wait times out. That the firmware keeps the ports was known: one left connected across the stop is still connected when the CPU restarts, see dcp_t8132_sleep_release(). And until the idle stop was added, a port that was announced again could not bind, as dptx_service_bind() refuses a port that has a service. All the 26.6.2 deep sleeps that brought an external display back did so over the service of before the sleep. A deep sleep stops and wakes the DCP with the same two functions, so the same wait fails the wake of every deep sleep with a live external DCP. s2idle leaves the firmware running and is not affected. Keep the ports published over the stop and wait for nothing at the wake, as before. What may use a stopped DCP is already fenced: AFK transmission is closed until the wake is done, and a route wakes the DCP before its first DPTX call. Nothing needs to bind a second service to a port, or a second service to an interface, so remove the code that did: rebind_allowed, dptx_service_rebind(), compact_rebind_gen and compact_start_err. Receive words held back over the wake are still replayed, and calls left over from an earlier teardown still dropped. The new m4-ext-wake test runs the stop and both wakes with no announcement. Fixes: e2b3bb8 ("drm/apple: m4: power down idle external DCPs at runtime") Signed-off-by: DjDeveloperr <hey@djdev.me>
A quarantined T8132 external DCP cannot drive a display until a reboot, but the route selection for a direct DP alt mode display does not look at that: services_ready is only worked out for tunnels. A replug therefore takes the failed DCP again, as the port's last pipeline or the lowest free one, and fails with its error each time, while the other external DCP is idle. Work out services_ready for direct streams too, from the session's failure alone, and let only a pipeline with it take one. A stream with no other pipeline waits, as it does when the others drive displays, and a modeset no longer moves a stream to the failed pipeline. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
RyanTheTide
approved these changes
Dec 3, 2026
RyanTheTide
left a comment
Contributor
There was a problem hiding this comment.
Reviewed aad3a85. The retained wake preserves the DPTX service, clears sink AV state and still replays AFK before checking the session error. Direct route selection skips a quarantined M4 pipeline while preserving the existing tunnel readiness check. The reported fixtures cover retained wake and alternate route selection. The 26.6.2 hardware row is pending.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: On a T8132 Mac with firmware 26.6.2, a monitor plugged in more than 5 s after boot stays dark, and that external DCP is gone until a reboot (
external DCP restart failed at DPTX ready: -110). #3321 stops an idle external DCP after 5 s, and its wake waits for the firmware to announce its DPTX ports again, which it never does. Commit 1 keeps the ports over the stop, as before #3321, and drops the wait. Commit 2 makes a replug take the other external DCP when one has failed.Tested: no hardware yet. Host tests:
--only dcp103/103,apple-dcp --group m410/10 (newm4-ext-wake),afk-compact-start11/11,dcp-tunnel-prepare18/18,apple-afkv22/2,dcpext26-startup-tests.py --mutants. Fabric KUnit on UML 118/118. W=1 ofdrivers/gpu/drm/apple/with the T8132 backend built, LLVM and GCC: no new warnings.Risk: two-way door · M4 (T8132) external displays on firmware 26.6.2; a plain revert undoes it.
Not yet: the hardware row: J713 (or J773g or J604) on firmware 26.6.2, external monitor plugged in more than 5 s after boot, replug, DPMS off/on, one s2idle, with 0
external DCP restart failed. A deep sleep with the monitor attached is worth adding, as the same wait broke that too.Details
What breaks.
iomfb_m4_ext_stop()withdrew both DPTX ports (port->enabled = false), andiomfb_m4_ext_start()ended iniomfb_m4_ext_reset_finish(), which waited 1 s for unit 0 to be announced and started under a newafk_power_gen. In the J713 report on #3454 every step before that works (power domain, both DARTs, RTKit to ON), then no AFK message arrives at all and the wait times out. The session is quarantined for the rest of the boot.Why the ports are still there.
apple_rtkit_wake_retained()restarts the firmware image that was kept: it answers the endpoint map with the endpoints already started, sends no INIT and starts nothing. Two things from before #3321 show that the firmware's DPTX session goes on:dcp_t8132_sleep_release()exists.dptx_service_bind()refuses a port that already has a service, and nothing cleared it, so a port announced again could not have been bound. All 26.6.2 deep sleeps that brought an external display back (drm: apple: t8132: publish the sink's EDID on external outputs #2166, drm: apple: t8132: keep an external display across a deep sleep #2200, iommu/apple-dart, drm/apple: support 64 MiB T8132 external scanout up to 5120x2880 #3258) connected over the service from before the sleep.So the AFK endpoints do not need an INIT, and there is nothing to wait for.
What this does. The ports stay published over the stop. The wake replays the receive words it held back, drops leftovers of an earlier teardown, opens transmission and is done. Anything that tries to use a stopped DCP gets
-EBUSYfrom the AFK transmit fence, and a route wakes the DCP before its first DPTX call. The code that only existed for the second announcement goes away:rebind_allowed,dptx_service_rebind(),compact_rebind_gen,compact_start_err.Sleep. Deep sleep uses the same stop and wake, so by the code every deep sleep with a live external DCP on 26.6.2 fails the same way since #3321 (nobody has run one since); before it, those rows passed. s2idle leaves the firmware running, so a monitor that is on survives it. An external DCP that was already stopped for idle stays stopped through either sleep and today fails at the next plug.
Commit 2.
services_readywas only worked out for Thunderbolt tunnels, so a direct DP alt mode display kept getting the failed DCP, as the port's last pipeline. It is now false for a direct stream when the session failed, anddcp_fabric_free_route()passes such a pipeline over. With no other pipeline left the display waits, as it does when all of them are in use.If the row shows that the firmware does not answer DPTX calls after the idle wake, the next step is to stop setting
ext_idle_capable, so that the idle stop stays off.Evidence
aad3a8509d3d, base main5f32aa72fa7e.m4-ext-wakerunsiomfb_m4_ext_stop(),iomfb_m4_ext_start()andiomfb_m4_ext_reset_finish()from the source, for the idle stop and for a deep sleep, with no announcement. It fails with the port withdrawn at the stop, with the wake timing out, and on main'siomfb_m4.c.tunnel-route-tests.py: new case and the negative controlsnapshot-ignores-failure.fabric_direct_services_test.apple_drv.c,dcp-m4-profile.h).checkpatch.pl --strict: 0 errors, 0 warnings.