Skip to content

drm/apple: J716c display coprocessors over a deep sleep - #2124

Merged
DjDeveloperr merged 9 commits into
integration/aurorafrom
j716c/drm-apple-sleep
Nov 17, 2026
Merged

DjDeveloperr merged 9 commits into
integration/aurorafrom
j716c/drm-apple-sleep

Conversation

@erikwb

@erikwb erikwb commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What this does

The display coprocessors on the J716c (16" M5 Max) over a firmware 27 deep sleep:

  • The J716c uses the T6050 sleep endpoint transport of DCP firmware 27.0.0 (new
    v27_sleep_transport flag; set on the J714s as before). The J714s's normal method table and panel
    profile stay J714s only. The transport no longer lets a superseded endpoint clear its
    replacement, refuses a control while a reply has failed or is pending, and quiesces the auxiliary
    sleep endpoints at unbind.
  • A cancelled suspend without a firmware resume no longer restarts the display coprocessors.
  • A Thunderbolt DP tunnel's route that a router sleeping in place tore down is released for the
    sleep, as a DP IN detach does.
  • An external coprocessor's AV interfaces on endpoint 0x2b are served, so that a display routed
    back after the wake gets its HPD.
  • A coprocessor (external or internal) that took its sleep step and whose suspend was then refused
    is restarted as a real wake does.
  • The J716c's internal panel is lit again after its sleep step: the backlight fallback is queued
    after any panel power-on that leaves the backlight unconfigured, and the internal coprocessor's
    sleep is refused while no level is known.

A display that runs as a pair of engines (4K240) relies on the existing upstream paired-display
sleep path (8ef6d2b, "stop a merged pair before its primary's HPD low, and give a stopped pair's
peer back for the sleep"). That case was not tested on the J716c.

Tested

  • drm/apple: J716c display coprocessors over a deep sleep #2124 (j716c/drm-apple-sleep) builds on its own base (Image.gz, modules and dtbs, arm64, LLVM).
  • A 4K240 paired display across a sleep was not tested.
  • All 17 branches merged on integration/aurora were built as one kernel and run on a J716c (16" M5 Max): one suspend-to-RAM with a USB4 dock attached, about 30 s asleep, woken by the RTC alarm (wake source 76). After the wake all 18 CPUs were online, the dock's router came back in place with its Ethernet up, and the SEP answered RNG reads. The sleep's log showed "secondary clusters down first: cores 6+6, cluster 1 0x1a in 353 us, cluster 2 0x1c01a in 448 us". The PMP was not running in that build.

Dependencies

Branch #2124 (j716c/drm-apple-sleep). Based on integration/aurora; no dependencies at build time. At run time the J716c deep sleep needs #2119 (j716c/sleep-j716c-profile) and #2123 (j716c/dts-deep-sleep).

Part of the J716c deep sleep set: #2118 (j716c/spin-table-release-cpus), #2119 (j716c/sleep-j716c-profile), #2120 (j716c/sleep-wake-source-names), #2121 (j716c/sleep-sep-auto-wake), #2122 (j716c/sep-t6050-profile), #2123 (j716c/dts-deep-sleep), #2124 (j716c/drm-apple-sleep), #2125 (j716c/dart-sleep), #2126 (j716c/thunderbolt-sleep), #2127 (j716c/usb-sleep), #2128 (j716c/phy-sleep), #2129 (j716c/pcie-sleep), #2130 (j716c/aic-sleep), #2131 (j716c/asahi-sleep), #2132 (j716c/spmi-sleep), #2133 (j716c/macsmc-sleep), #2134 (j716c/nvme-sleep).

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. The J716c path here uses the DCP 27.0.0 sleep transport; 27.2 renumbers the sleep method tags (see #2070), so please bring the J716c deep-sleep series up on the 27.2 stub.

@erikwb
erikwb marked this pull request as draft November 17, 2026 15:06
Let the J716c's display coprocessors use the sleep endpoint transport
of DCP firmware 27.0.0 that the J714s uses: the sleep endpoints'
inventory, their open and close controls and the replies to them. A
new per-processor flag, v27_sleep_transport, gates that path; it is set
on the J714s as before, and on the J716c for a T6050 display
coprocessor that adopts a live session, uses the default method table
and runs firmware 27.0.0. The J714s's normal method table and panel
profile stay J714s only.

The transport also gets stricter about the endpoints it hands out: a
superseded endpoint's release no longer clears its replacement, a
control is refused while a reply has failed or is pending, and the
auxiliary sleep endpoints are quiesced at unbind.

A cancelled suspend without a firmware resume no longer restarts the
display coprocessors: they keep their running firmware session.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
With a USB4 router that sleeps in place, the router's sleep entry tears
down its DP IN displays (the DPTX port disconnected, the tunnel clock
stopped) but leaves the tunnel route owned, and the display coprocessor's
sleep then refused it as a tunnelled display. Release such a route as a
DP IN detach does: retire its Thunderbolt binding and deactivate it. The
coprocessor then sleeps as an idle one, and the router hands the display
back after the wake. A tunnelled display still connected still refuses.

Developed with Claude Code.
Signed-off-by: Erik Bourget <erik@ebourget.net>
The sleep step starts every endpoint it closes. On a board whose external
display processors have no DP audio (J716c), nothing had started endpoint
0x2b before, so it came up with no services. From then on the firmware
announces its compact AV interfaces there at each plug
(dispextN:dcpav-video-interface-, -audio-interface-), nothing matches
them, and the unanswered announcement holds the plug: a display routed
back through its DP tunnel after the wake never gets its HPD.

Serve 0x2b as 0x29/0x2a are: open the video, audio and CEC interfaces
when announced, one of each live, replaced at the next plug.

Developed with Claude Code.
Signed-off-by: Erik Bourget <erik@ebourget.net>
…ep step

An external display coprocessor whose sleep step completed (A484, A500,
its sessions closed) and whose suspend was then refused by another
device kept that firmware session: a display routed back to it through
its DP tunnel was plugged by the firmware, which then went silent and
never reported it. A real wake restarts every external processor once.
Restart it the same way after such a refusal: the RTKit cycle and the
external wake round now also run for a processor still prepared.

On the J716c the restart needs the sleep controller's display power
words, which the soc: apple: sleep change "a full deep-sleep profile
for the J716c" serves there.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
Without a panel size in the DT the driver did not treat the J716c's
internal display as a panel: no backlight level was ever configured,
and after the internal display coprocessor's sleep step (the firmware
turns the backlight off) the panel stayed dark. The DT now gives the
panel its size. Also queue the backlight fallback after any panel
power-on that leaves the backlight unconfigured (an adopted, already
running pipe got none), and refuse the internal coprocessor's sleep
while no level is known.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
…step

After the internal display coprocessor's completed sleep step, a refused
suspend left its firmware session in place: the panel's power-on then
failed to open its video interface and its mode set and first present
timed out, so the panel stayed dark. Restart it as a real wake does,
like the external processors: the wake's RTKit cycle runs for a
processor still prepared.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb force-pushed the j716c/drm-apple-sleep branch from 6d6356a to 0ad81c9 Compare November 17, 2026 15:08
…ecks

Preserve the existing J613 firmware gate. Require a known restorable
backlight level, keep the host regression fixture aligned with the
current callback layout, and retire the released DP-IN slot so the
USB4 display route can attach again after resume.

Signed-off-by: Diljit Singh <hey@djdev.me>
…rement

Keep the host fixture declarations aligned with the production DCP fields.
Cover clearing the released endpoint slot while preserving a replacement
owner. The Clang build also checks the native AFK announcement fixtures.

Signed-off-by: Diljit Singh <hey@djdev.me>
Keep integration's native26 fixture assertion and the J716c tests for
restorable backlight and retired routes. Retain the tested production
source and the other host fixtures unchanged.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 17, 2026 19:42
@DjDeveloperr
DjDeveloperr merged commit 170be7a into integration/aurora Nov 17, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the j716c/drm-apple-sleep branch November 17, 2026 23:52
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.

3 participants