Skip to content

drm/apple: power off idle firmware-27 external display processors - #3410

Open
erikwb wants to merge 10 commits into
mainfrom
feat/dcp-v27-ext-idle-off
Open

erikwb wants to merge 10 commits into
mainfrom
feat/dcp-v27-ext-idle-off

Conversation

@erikwb

@erikwb erikwb commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What: Power off unattached Type-C-only firmware-27 external display processors (dcpext) after 5 seconds of inactivity once no route, cable, display connector, active open DP-audio DMA stream, or Type-C work is active, waking synchronously on attach, DP-audio DMA setup, or system suspend. Defer ADMA channel setup on unplugged dcp-dp-audio PCM opens with a vmalloc void buffer fallback and pin idle-capable external DCPs across open DMA-backed PCM lifetimes so probing /dev/snd/pcm* while DISPEXT*_SYS is powered off does not fail -ENODEV (0xb4f).

Tested: At current head f39fdeec3e43 (with origin/main 41ab8f546874 merged at c53590aa9533, re-applying feef88606c29):

  • Offline ARCH=arm64 LLVM=1 W=1 KCFLAGS="-Werror" object builds (audio.o, av.o, dcp.o, dcp-fabric.o, iomfb.o, iomfb_v27.o, iomfb_h17p.o, iomfb_v26_6_desktop.o), checkpatch.pl --strict --git origin/main..HEAD (0 errors, 0 warnings, 0 checks), and git diff --check origin/main..HEAD (0 issues) pass.
  • arm64 QEMU KUnit: drivers/gpu/drm/apple/tests/display.kunitconfig (191 run: 190 passed, 1 skipped apple_g17_rx_util_min_test needing CONFIG_UCLAMP_TASK, including apple-dcp-firmware 7/7: dcp_ext_idle_s2r_disp_dart_gate and dcp_ext_idle_audio_dma_pin), display.kunitconfig with CONFIG_SOUND=y + CONFIG_SND=y (277 run: 275 passed, 2 skipped, including apple-dcpaud-legacy 10/10: dcpaud_legacy_unplugged_void_buffer, dcpaud_legacy_unplugged_hotplug_managed_buffer), drivers/gpu/drm/apple/tests/topology.kunitconfig (217 run: 216 passed, 1 skipped), and drivers/gpu/drm/apple/tests/.kunitconfig (117/117 passed).
  • Host & selftests: dcpaud host suite (20/20 passed including dcpaud-open-fallback-tests + 10/10 mutants killed and dcpaud-sleep-hold-tests), dart host suite (24/24 passed), dcpext26-startup-tests.py + --mutants (PASS), backlight-coldboot-tests.py (PASS), display-sleep-merge-tests.py (17/17 passed), and selftests/drivers/gpu/apple-dcp/run.py --group audio (2/2 passed).

Prior rows (predate the 41ab8f546874 merge at c53590aa9533 / f39fdeec3e43):

  • J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line) at feef88606c29 (429e7e15f122 merged, before #2673 merged): unaffected-main smoke passes: boots with 0 failed units (system and user), 0 AppArmor denials, 0 oops/WARN, eDP-1 2560x1664@60 enabled, 3 internal-panel DPMS off/on cycles and one 15 s s2idle clean; kernel err lines are the 3 on the default boot plus 2 from the external display processors, which did not probe on 429e7e15f122 (-ENODEV, "no IOMMU domain"). That tree had no dcp-dp-audio PCM (aplay -l lists only the jack and speaker cards), so the unplugged DP-audio PCM open / hw_params / hw_free / close path was not exercised on J713; it is covered by KUnit and the host suite above and needs a Mac with a probed external display processor (J813, or refreshed J713 on 41ab8f546874 with #2673 now merged).
  • J716c (T6050) at c4797d399ba0 with #3398 + #3662: TS5 dock with two 3840x2160 displays, 30 s deep sleep resume clean.
  • J313 (T8103) USB-C hot-plug pass on stacked #3334 (93c1460e0500), J813 (T8142, appledrm.s2r_untested=1) deep-sleep pass at 944b0ba788d2 (later failed unplugged DP-audio probe at c4797d399ba0), and J713 (T8132) combined trial build (05d728d91d68 + companion PRs #2673, #3297, #3300).

Risk: two-way door · Type-C-only firmware-27 external display processors with driver-profile s2r_ext, !s2r_disp_dart_with_dcp, DT apple,display-power, and dcp-dp-audio PCM opens (apple_dcp_hw_t8142_dcpext with appledrm.s2r_untested=1; apple_dcp_hw_t8132_dcpext_v27 on main via #2673 alongside #3297, #3300; apple_dcp_hw_t8103_dcpext keeps runtime idle-off disabled via !s2r_disp_dart_with_dcp until #3334 lands).

Revert: git revert -m 1 <merge_commit> on main (or revert f39fdeec3e43, 38c26d8a6b57, 8dfc3f8783aa, and 3daae875ba72 in reverse order). Kernel driver and test changes only; no persistent on-disk, ESP, Stage 2, or DT state is modified.

Not yet:

  • Live hardware verification at current head f39fdeec3e43:
    • J813 (T8142, fw 27.2, appledrm.s2r_untested=1) unplugged dcp-dp-audio PCM probe after idle-off (PipeWire/WirePlumber cold boot), physical USB-C hot-plug DP audio + display playback, unplug, re-gate, and default-command-line T8142 qualification (hardware not on site; failed at c4797d399ba0).
    • J716c (T6050) unaffected main smoke and docked hot-plug/deep sleep.
    • J713 (T8132, now with #2673 on main, and combined with #3297 + #3300) refreshed smoke + external DCP idle-off/S2R/hotplug wake + DP audio row at f39fdeec3e43.
    • J313 (T8103) unaffected main smoke (runtime idle-off on s2r_disp_dart_with_dcp remains disabled in #3410 until stacked #3334 lands).
  • Hosted CI on f39fdeec3e43; stacked PRs #3334 and #3398 must be retargeted to main before #3410 merges.
Details

Replaces #3308 targeting main (origin/main 41ab8f546874 merged at c53590aa9533). Four PR commits (3daae875ba72, 8dfc3f8783aa, 38c26d8a6b57, f39fdeec3e43):

  • Introduces an explicit idle state machine (DCP_EXT_IDLE_ON, OFF, FAILED, CLOSED) under ext_idle_lock strictly inner to dcp_typec_fabric_lock, scoped to dcp_ext_idle_capable(dcp) pipelines (dcp_s2r_ext_capable(), !dcp->hw.s2r_disp_dart_with_dcp, DCP_FIRMWARE_V_27_0, DRM_MODE_CONNECTOR_USB, !hdmi_hpd).
  • Keeps dcp_ext_idle_capable() false when dcp->hw.s2r_disp_dart_with_dcp is set (38c26d8a6b57) so landing #3410 alone on main never triggers T8020 dark-DART power-gating without #3334's fixes, while preserving dcp_s2r_ext_capable() for system sleep.
  • Resolves origin/main (41ab8f546874) in c53590aa9533: preserves both dcp_ext_idle_kick(dcp) and fixed_deselected = true on mux_control_deselect() in dcp-fabric.c, and preserves dcp_ext_idle_suspend() ahead of the firmware-27 deep-sleep refusal for external processors without a stop in dcp.c.
  • Defers dcp-dp-audio ADMA channel request and DMAengine setup (f39fdeec3e43) when dcp_pcm_open() opens while disconnected (open_unplugged = !dcpaud->connected), moving snd_pcm_set_managed_buffer() out of dcpaud_init_dma() (which dcpaud_before_modeset() can invoke mid-open on hotplug) into the plugged DMA-backed path of dcp_pcm_open() so managed_buffer_alloc is never armed while an unplugged PCM is open. Unplugged streams use a SNDRV_DMA_TYPE_VMALLOC void-playback buffer fallback (dcpaud_alloc_void_buffer() / dcpaud_free_void_buffer(), tracking the exact allocated void_dmab pointer and freeing it symmetrically via snd_dma_free_pages() + kfree(dmab) on hw_free, hw_params reallocation, and close without calling snd_pcm_lib_free_pages() and detaching the runtime buffer only when runtime->dma_buffer_p == dmab) and integer period constraint so probing /dev/snd/pcm* when DISPEXT*_SYS is powered off does not resume ps_dispext*_adma or wake an idle DCP.
  • When dcp_pcm_open() opens plugged (DMA-backed), dcp_audio_dma_get(dcp_dev) wakes any idle-gated parent external DCP and increments dcp->ext_idle_audio_users under ext_idle_lock (gating dcp_ext_idle_eligible()). Plugged opens on an external DCP whose idle state latched DCP_EXT_IDLE_FAILED return ext_idle_err (or -EIO if unset). On open failure after channel acquisition or on PCM close, DMA is released (dcpaud_release_dma(), or dcpaud_release_dma_locked() inside dcp_pcm_native_close() / dcp_pcm_native_open() error cleanup) before dcp_audio_dma_put(dcp_dev) drops the pin and re-kicks idle power-off so unplugged PCM opens avoid requesting ADMAC channels and plugged streams hold the external DCP awake until their TX DMA channel is released. Non-apple_platform_driver test devices safely no-op.
  • Tracks idle admission pause via ext_idle_paused under hpd_mutex, checks pending Type-C work non-blockingly, adds dcp_push_try(), darkens/drains display and DCP DARTs before A500, polls iomfb_channels_idle() before RTKit stop, tracks ext_idle_domains_off, and wakes idle-gated pipes on suspend or unbind.
Evidence
  • Current head f39fdeec3e43 (origin/main 41ab8f546874 merged at c53590aa9533):
    • git diff --check origin/main..HEAD — 0 issues.
    • ./scripts/checkpatch.pl --strict --git origin/main..HEAD — 0 errors, 0 warnings, 0 checks across all 4 PR commits (3daae875ba72, 8dfc3f8783aa, 38c26d8a6b57, f39fdeec3e43).
    • make O=_build ARCH=arm64 LLVM=1 W=1 KCFLAGS="-Werror" drivers/gpu/drm/apple/audio.o drivers/gpu/drm/apple/av.o drivers/gpu/drm/apple/dcp.o drivers/gpu/drm/apple/dcp-fabric.o drivers/gpu/drm/apple/iomfb.o drivers/gpu/drm/apple/iomfb_v27.o drivers/gpu/drm/apple/iomfb_h17p.o drivers/gpu/drm/apple/iomfb_v26_6_desktop.o (defconfig + asahi.config, CONFIG_RUST=n): 0 errors, 0 warnings.
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig: 191 run: 190 passed, 1 skipped (apple_g17_rx_util_min_test needing CONFIG_UCLAMP_TASK), including apple-dcp-firmware 7/7 (dcp_ext_idle_s2r_disp_dart_gate, dcp_ext_idle_audio_dma_pin).
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig --kconfig_add CONFIG_SOUND=y --kconfig_add CONFIG_SND=y: 277 run: 275 passed, 2 skipped (apple_g17_rx_util_min_test, dcpaud_no_sio_test), including apple-dcpaud-legacy 10/10 (dcpaud_legacy_unplugged_void_buffer, dcpaud_legacy_unplugged_hotplug_managed_buffer) and apple-dcp-firmware 7/7.
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/topology.kunitconfig: 217 run: 216 passed, 1 skipped (apple_g17_rx_util_min_test).
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/.kunitconfig: 117/117 passed (apple-dcp-fabric).
    • python3 -I tools/asahi/run-host-tests.py --only dcpaud: 20/20 passed (dcpaud-open-fallback-tests + 10/10 mutants killed: no-retry, wait-any, gone-fails, keep-cookie, mask-all, drop-put-dma, void-lib-free, void-alloc-lib-free, managed-in-init-dma, void-free-runtime-dmab; dcpaud-sleep-hold-tests + 7 mutants + ref).
    • python3 -I tools/asahi/run-host-tests.py --only dart: 24/24 passed.
    • python3 -I tools/asahi/dcpext26-startup-tests.py and --mutants: PASS.
    • python3 -I tools/asahi/backlight-coldboot-tests.py: PASS.
    • python3 -I tools/asahi/display-sleep-merge-tests.py: PASS (17/17).
    • python3 tools/testing/selftests/drivers/gpu/apple-dcp/run.py --group audio: 2/2 passed (compact-audio-reply-bounds, cec-only-av-endpoint).
  • Prior hardware runs (predate c53590aa9533 / f39fdeec3e43):
    • J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line) at feef88606c29 (429e7e15f122 merged): unaffected-main smoke passed (0 failed units, 0 AppArmor denials, 0 oops/WARN, eDP-1 2560x1664@60, 3x DPMS, 15 s s2idle clean; external DCPs did not probe on 429e7e15f122).
    • J716c (T6050) at c4797d399ba0 with #3398 + #3662: TS5 dock with two 3840x2160 displays, both lit and survived 30 s deep sleep, 0 oopses.
    • J813 (T8142, fw 27.2, appledrm.s2r_untested=1) at 944b0ba788d2: 2x deep sleep/resume clean (boot object resumes 0 -> 1 -> 2). Later at c4797d399ba0, PipeWire/WirePlumber's unplugged /dev/snd/pcmC*D0p probe failed PS dispext0_adma / PS dispext1_adma (0xb4f -> -ENODEV), which f39fdeec3e43 fixes.
    • J313 (T8103, fw 27.2.1) USB-C hot-plug pass on stacked #3334 (93c1460e0500) and J713 (T8132) combined candidate (05d728d91d68 + companion PRs #2673, #3297, #3300).

Power off unattached Type-C-only firmware-27 external display processors
(dcpext) after 5 seconds of inactivity once no Type-C route, cable,
display connector, or Type-C background work is active.

Use an explicit idle state machine (ON, OFF, FAILED, CLOSED) serialized
under ext_idle_lock strictly inside dcp_typec_fabric_lock and scoped to
idle-capable pipelines:
- dcp_ext_idle_wake() never blocks on cancel_delayed_work_sync() while
  holding fabric locks, and dcp_ext_idle_off_work() checks pending Type-C
  work non-blockingly under hpd_mutex without calling
  dcp_disable_typec_work(), avoiding fabric/worker lock inversions and
  workqueue disable-depth imbalance.
- Poll iomfb_channels_idle() after A500 instead of an unconditional sleep,
  restore admission on pre-send A500 allocation failure (-ENOMEM), abort
  before cutting power if quiescence or DART stream shutdown fails,
  recover only domain power-off failures via dcp_s2r_ext_cycle(), latch
  FAILED across subsequent wake attempts and dcp_poweron(), and reconcile
  state on a successful sleep restart.
- Initialize ext_idle state early at probe, close admission (waking an
  idle-gated pipe before unbind/remove tears down resources) on component
  unbind, platform remove, and shutdown, and wake an idle-gated pipe
  before system suspend so DART PM never accesses registers while the
  display domains are powered off, re-arming the idle timer on resume.

On main, this remains gated by dcp_s2r_ext_capable() (currently requiring
s2r_ext and s2r_untested on firmware-27 external processors) until J713
v27.2 external display support lands.

Signed-off-by: Erik Bourget <[email protected]>
…in' into feat/dcp-v27-ext-idle-off

# Conflicts:
#	drivers/gpu/drm/apple/dcp.c
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 27, 2026 16:49
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (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 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merge readiness at c7e82c63: not ready yet

Check Detail
CI at head running running: apple-build, KUnit plan
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head no no line with the head SHA c7e82c63, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · Type-C-only firmware-27 external display processors with driver-profile s2rext, !s2rdispdartwithdcp, DT apple,display-power, and dcp-dp-audio PCM opens (appledcphwt8142dcpext with appledrm.s2runtested=1; appledcphwt8132dcpextv27 on main via #2673 alongside #3297, #3300; appledcphwt8103dcpext keeps runtime idle-off disabled via !s2rdispdartwithdcp until #3334 lands). Revert: git revert -m 1 <merge_commit> on main (or revert f39fdeec3e43, 38c26d8a6b57, 8dfc3f8783aa, and 3daae875ba72 in reverse order). Kernel driver and test changes only; no persistent on-disk, ESP, Stage 2, or DT state is modified.

Areas: area:display, area:gpu

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

dcp_push() now delegates to dcp_push_try() in iomfb.c, so extract
dcp_push_try() alongside dcp_push() in
tools/asahi/dcpext26-startup-tests.py.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the host-tests failure (dcpext26-startup-tests) in 8dfc3f8783aa.

3daae875ba72 moved the dcp_push() implementation into dcp_push_try() in drivers/gpu/drm/apple/iomfb.c, which left tools/asahi/dcpext26-startup-tests.py failing to compile dcp_push() without dcp_push_try(). Commit 8dfc3f8783aa extracts dcp_push_try() alongside dcp_push() in tools/asahi/dcpext26-startup-tests.py and makes no changes to any kernel or driver source files, so the J813 hardware run at 944b0ba788d2 and the J713 combined trial run (#3308 component 05d728d91d68 combined with #2673 7a8022a6d24d, #3297 2b1bab104938, #3300 6a84c1d95460, #3307 eab8b5157340, and 3daae875ba72; combined build SHA unrecorded) remain valid for the built kernel.

Verified at 8dfc3f8783aa:

  • python3 -I tools/asahi/dcpext26-startup-tests.py and --mutants: PASS
  • python3 tools/asahi/backlight-coldboot-tests.py: PASS
  • ./scripts/checkpatch.pl --strict --git 9dd8b87b003c..8dfc3f8783aa: 0 errors, 0 warnings, 0 checks
  • python3 -I tools/asahi/run-host-tests.py --jobs 32: 726/727 passed (apple-dcp failed 5/96 subtests locally under clang 23.1.5, including cpuidle-s2idle on -Werror,-Wunused-but-set-global; CI host-tests passed apple-dcp on clang 18 at 944b0ba788d2)

@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: FINISH, then merge at 8dfc3f87

Blockers:

  1. Hosted CI is not yet complete at 8dfc3f87 (readiness was cancelled and KUnit suites from asahi onward are still queued; wait for all checks to finish green).
  2. External Type-C/Thunderbolt display hot-plug verification after an external DCP has been powered off idle is still needed (carried forward from the review on closed #3308), and confirm default-command-line behavior without appledrm.s2r_untested=1 on the targeted boards (note companion PRs #2673/#3297/#3300 for J713).

Checked: PR body and commit delta (8dfc3f87 only extracts dcp_push_try in tools/asahi/dcpext26-startup-tests.py, leaving driver files identical to 944b0ba7 reviewed on #3308), no AI attribution, human Signed-off-by, apple-build/host-tests/kunit/pr-text status.

Evidence
  • 8dfc3f87 fixes the dcpext26-startup-tests structural failure without changing any kernel C file relative to 944b0ba7.
  • apple-build, host-tests, kunit, pr-text, and KUnit ane-boot/ane-pm/dcp-fabric/dcp-topology PASS at 8dfc3f87; readiness was cancelled and remaining KUnit jobs are queued.
  • Carrying forward the remaining gates noted on #3308 (full green CI + real external Type-C/TB hotplug after idle power-off).

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 28, 2026
@sithglan

Copy link
Copy Markdown
Contributor

CI at 8dfc3f8783aa is now 21/21 green (all KUnit jobs finished), so this and the stacked #3334 (fix/t8103-dcpext-idle-dart) look very close to ready to merge.

To help close Blocker #2 from review, I have an M5 Air (J813 / T8142, fw 27.2) and an M1 Air (J313 / T8103, fw 27.2.1) here with a physical USB-C DisplayPort monitor (EIZO) and Thunderbolt NVMe enclosure. If an exact-head 8dfc3f8783aa J813 hot-plug-after-idle-off row (boot unplugged -> confirm both external DCPs idle-off -> plug USB-C monitor -> confirm wake + output -> unplug -> confirm re-gating, with appledrm.s2r_untested=1) or a J313 row on #3334 (93c1460e0500) helps unblock #3410 + #3334 for merge, let me know and I can run it.

@sithglan

Copy link
Copy Markdown
Contributor

Ran physical USB-C display (EIZO 2560x1440@60) hot-plug-after-idle-off tests on both J313 and J813:

  1. M1 Air (J313 / T8103, fw 27.2.1, default cmdline, s2r_untested=N) at stacked #3334 head 93c1460e0500 (carrying #3410 driver code unchanged over 944b0ba788d2):
    • Unplugged EIZO (t=65.15 s) -> 271c00000.dcp powered off idle.
    • Re-plugged EIZO (t=304.106 s): dcpext idle: woke in 1 ms, Switched dpphy to dispext0,0, set_digital_out_mode finished:8274 (2560x1440@60, card1-DP-1: connected, enabled), 0 DART/IOMMU faults, 0 Oops/BUG/WARNING/SError.
    • On a subsequent active unplug hitting the pre-#3523 (#3157) setPowerState(0) timeout 1000 ms, iomfb_queue_settle() safely deferred idle power-off (dcpext idle: updates pending, deferring).
  2. M5 Air (J813 / T8142, fw 27.2) at exact head 8dfc3f8783aa:
    • Boot hit an asynchronous SError in n1-up (x21=0xbc2020018, 0000:01:00.2 Beta BAR0) because 8dfc3f8783aa is based on e12e25d49a76, predating d77eb3148dd1 (wifi: apple: centauri: enable function memory space before polling Beta BAR0) on main.
    • Happy to re-run the exact-head J813 idle-off -> hot-plug -> unplug -> re-gate row as soon as #3410 is rebased onto current main.

External display processors whose display DART shares the coprocessor
power domain (s2r_disp_dart_with_dcp) require T8020 dark-DART state
saving, post-restore wake ordering, and layout-wide domain-off tracking
before runtime idle power-gating can safely power-cycle the display
DART.

Keep dcp_ext_idle_capable() false when s2r_disp_dart_with_dcp is set so
system suspend continues to work on main while runtime idle-off remains
gated on dark-DART wake support, and add a KUnit test covering the
capability gate.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Added commit 38c26d8a6b57 on top of 58e5de18ccba (which merged origin/main 18058ea228e2, including d77eb3148dd1 for the T8142 Wi-Fi Beta BAR0 SError) so #3410 is safe to land on main independently:

  • dcp_ext_idle_capable() now requires !dcp->hw.s2r_disp_dart_with_dcp so pipelines whose display DART shares the coprocessor power domain keep runtime idle-off disabled until stacked #3334 lands with T8020 dark-DART save/restore and wake-ordering fixes, while dcp_s2r_ext_capable() continues to handle system sleep.
  • Added dcp_ext_idle_s2r_disp_dart_gate to drivers/gpu/drm/apple/dcp-firmware-test.c verifying s2r_disp_dart_with_dcp does not arm idle-off while non-coupled pipelines arm and disarm cleanly.

Verified at 38c26d8a6b57:

  • ./scripts/checkpatch.pl --strict --git 18058ea228e2..HEAD: 0 errors, 0 warnings, 0 checks across 3daae875ba72, 8dfc3f8783aa, and 38c26d8a6b57; git diff --check 18058ea228e2..HEAD clean.
  • make ARCH=arm64 LLVM=1 W=1 (defconfig + asahi.config, CONFIG_RUST=n) for drivers/gpu/drm/apple/{iomfb,iomfb_v27,iomfb_h17p,iomfb_v26_6_desktop,dcp,dcp-fabric}.o: 0 errors, 0 warnings.
  • arm64 QEMU KUnit: drivers/gpu/drm/apple/tests/display.kunitconfig 168 passed, 1 skipped (apple_g17_rx_util_min_test, needs CONFIG_UCLAMP_TASK, including apple-dcp-firmware 6/6); topology.kunitconfig 209 passed, 1 skipped; drivers/gpu/drm/apple/tests/.kunitconfig (apple-dcp-fabric) 117/117 passed.
  • Host tests at 38c26d8a6b57: tools/asahi/dcpext26-startup-tests.py PASS (including --mutants), tools/asahi/backlight-coldboot-tests.py PASS, tools/asahi/run-host-tests.py --only dart 16/16 passed, and tools/testing/selftests/drivers/gpu/apple-dcp/run.py --group quiesce --group lifecycle 30/35 passed (same 5 pre-existing local clang 23.1.5 failures as origin/main). Preserved the prior 726/727 host-test result and 21 successful old-head CI checks (distinct from the cancelled readiness check) at 8dfc3f8783aa.

Hardware status & open items:

  • J716c (T6050, batched trial kernel 3545ebecb76f at 58e5de18ccba with stacked #3398 b963090c1f2d): unaffected smoke row for #3410 (J716c idle-off behavior came from #3398 layered on #3410). All four dcpext instances returned to fControllerPowerState 0 after the pm_test cycles, 3x DPMS cycles (samples DCP state 0 during DPMS-off and records display re-enable during DPMS-on) passed, smoke clean, and 0 new failed system units (aurora-peripherals.service fails on default Stage 2 after warm reboots on this Mac).
  • J313 (T8103, Group E at 58e5de18ccba): trial kernel was built and parity-checked against main ee36fbdcd1c8 (all changed PR files IDENTICAL), and never booted because J313 became unreachable after the second deep-sleep cycle on baseline main (awaiting physical recovery; baseline s2idle also hard-resets J313).
  • Prior runs (predating 38c26d8a6b57): J313 USB-C physical hot-plug pass on stacked #3334 93c1460e0500 (iommu/apple-dart, drm/apple: fix T8020 display DART save/wake #3334 (comment)), J813 944b0ba788d2 deep-sleep pass with appledrm.s2r_untested=1 alongside the later 8dfc3f8783aa J813 boot failure before d77eb3148dd1 (drm/apple: power off idle firmware-27 external display processors #3410 (comment)), and the J713 combined trial build (historical combined build SHA unrecorded).
  • Current-head 38c26d8a6b57 hotplug and default-command-line qualification (J713, J813, J313 unaffected smoke) plus real s2idle / attach on J716c stay under **Not yet:**. Hosted CI must run on the final diff, and both #3334 and #3398 must be retargeted to main before #3410 merges.

@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: FINISH at 38c26d8

The power-domain capability gate keeps runtime idle-off disabled for coupled display DARTs while preserving system sleep. The new KUnit exercises both sides of that gate. The prior J313 hot-plug is from the stacked series; the standalone revision needs default-command-line hot-plug on an eligible pipeline, unaffected coupled-pipeline smoke, and current hosted CI. Keep the two dependent branches coordinated before landing.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 29, 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: HOLD at c4797d399ba0

Blockers:

  • Hosted CI at c4797d399ba0 is still queued (1 passed, 0 failed, 20 queued/in-progress). Note that c4797d39 merged main at 94104a69 (just before #3672 / ae5505be fixed the apple-dcp probe-transaction-rollback host test on main), so host-tests may report that pre-existing main failure unless merged forward past ae5505be.
  • Standalone exact-head hardware verification on the default command line (external Type-C display hot-plug wake after idle-off on a non-coupled pipeline plus confirming coupled s2r_disp_dart_with_dcp pipelines remain disabled without #3334, as noted in the prior 38c26d8a review) is still pending.

Checked:

  • Forward-merge c4797d399ba0 (38c26d8a + origin/main 94104a69): verified clean conflict-free integration across all 12 PR files with human Signed-off-by and MERGEABLE status on main.
  • Verified dcp.c, dcp-fabric.c, dcp-internal.h, and dcp-firmware-test.c: !dcp->hw.s2r_disp_dart_with_dcp capability guard in dcp_ext_idle_capable(), dcp_ext_idle_s2r_disp_dart_gate KUnit coverage, dcp_ext_idle_close(dcp, false) before dcp_comp_unbind() on shutdown, and dcp_ext_idle_wake()/dcp_ext_idle_kick() hooks in dcp_typec_route_activate()/deactivate() survive intact.
  • Verified iomfb.c/iomfb_template.c (dcp_push_try() + iomfb_s2r_500() refcount cleanup) and all four host-test harnesses (backlight-coldboot-tests.py, dcpext26-startup-tests.py, lifecycle.py, quiesce.py); no Apple material or AI attribution.
Evidence
  • Head: c4797d399ba023bd6c22a50c8b5caab6b1c80a2d (base: main, MERGEABLE, +515/-20, 12 files, 7 commits).
  • Merge parents: 38c26d8a + 94104a69.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026
@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 30, 2026
@sithglan

Copy link
Copy Markdown
Contributor

Hardware test row: J813 (13-inch M5 MacBook Air, T8142, fw 27.2) at exact head c4797d399ba0 — FAIL (regression on unplugged dcp-dp-audio PCM open)

Setup:

  • Machine: Apple MacBook Air 13-inch M5 (J813 / T8142), firmware 27.2, appledrm.s2r_untested=1 on kernel command line, no external displays connected (DP-1 and DP-2 disconnected, eDP-1 lit at 400/500).
  • Kernel: 7.3.0-aurora-j813-pr3410+ built from exact PR head c4797d399ba0 (one-shot aura-try).

Observed:

  1. Both 506e00000.dcp (dcpext0) and 3aae00000.dcp (dcpext1) powered down cleanly at idle (506e08000.mailbox-recv stayed at 348 IRQs and 3aae08000.mailbox-recv stayed at 344 IRQs over a 10 s window, 0 new IRQs; 0 failed systemd units, internal eDP-1 lit cleanly).
  2. Regression when userspace probes external DP audio (audio-controller-1 / audio-controller-2) after dcpext0/dcpext1 have idled off:
    At t = 22.46 s when PipeWire/WirePlumber probed /dev/snd/pcmC0D0p and /dev/snd/pcmC1D0p (and reproduced manually with open("/dev/snd/pcmC0D0p", O_WRONLY|O_NONBLOCK) -> -ENODEV), dcp_pcm_open() called dcpaud_init_dma() -> admac_alloc_chan_resources() -> pm_runtime_resume_and_get(), which tried to power on ps_dispext0_adma (@420) and ps_dispext1_adma (@3b0). Because #3410 had already lowered their parent DISPEXT0_SYS (0x308) / DISPEXT1_SYS (0x2b8) power domains, both PMGR transitions failed with 0xb4f and dcp_pcm_open() returned -ENODEV (-19):
    [   22.464799] apple-pmgr-pwrstate 380700000.power-management:power-controller@420: PS dispext0_adma: Failed to reach power state 0xf (requested 0xf, now: 0xb4f)
    [   22.464980] dcp-dp-audio audio-controller-1: audio TX DMA channel request failed: -19
    [   22.469366] apple-pmgr-pwrstate 380700000.power-management:power-controller@3b0: PS dispext1_adma: Failed to reach power state 0xf (requested 0xf, now: 0xb4f)
    [   22.469534] dcp-dp-audio audio-controller-2: audio TX DMA channel request failed: -19
    
    Per tools/asahi/dcpaud-open-fallback-tests.py, PipeWire/PulseAudio drop a DP audio output permanently when its initial unplugged PCM open fails.

Root cause / fix hint:
On T8142 (t8142-j813-dpaudio.dtsi), ps_dispext0_adma / ps_dispext1_adma sit under DISPEXT0_SYS / DISPEXT1_SYS. Either dcp_pcm_open() should defer dcpaud_init_dma() when !dcpaud->connected (unplugged open only needs the fixed dcp_pcm_hw_unplugged caps), or dcpext runtime idle-off needs to wake DISPEXT*_SYS around audio-controller-* DMA channel init (and coordinate with releasing idle DMA channels, cf. #3712).

@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: CHANGES_REQUESTED at c4797d39

Blockers:

  • Hardware regression on unplugged dcp-dp-audio PCM open (J813, M5 MacBook Air, T8142, fw 27.2 at c4797d399ba0): After dcpext0 (506e00000.dcp) and dcpext1 (3aae00000.dcp) power down at idle (lowering DISPEXT0_SYS / DISPEXT1_SYS), PipeWire/WirePlumber's initial unplugged probe of /dev/snd/pcmC0D0p and /dev/snd/pcmC1D0p enters dcp_pcm_open() -> dcpaud_init_dma() -> admac_alloc_chan_resources() -> pm_runtime_resume_and_get() for ps_dispext0_adma / ps_dispext1_adma. Both PMGR power-state transitions fail (0xb4f) and dcp_pcm_open() returns -ENODEV (-19), which causes PipeWire/PulseAudio to permanently drop the external DP audio outputs. Either defer dcpaud_init_dma() in dcp_pcm_open() when !dcpaud->connected or wake the parent DISPEXT*_SYS domain around external DP audio DMA channel setup, and re-verify unplugged PCM open + hotplug playback on J813.
  • T8142 hotplug/active-display proof still pending: Re-test on J813 once the unplugged DP audio open regression is fixed, covering both unplugged pcmC*D0p open after dcpext* idle-off and external DP display + audio wake/playback.

Checked:

  • Confirmed CI=24P/0F/0Q is green at c4797d39.
  • Reviewed the J813 exact-head c4797d399ba0 failure report showing apple-pmgr-pwrstate PS dispext0_adma (@420) and PS dispext1_adma (@3b0) failing with now: 0xb4f followed by dcp-dp-audio audio-controller-{1,2}: audio TX DMA channel request failed: -19.
Evidence
  • J813 (T8142, fw 27.2) exact-head c4797d399ba0 hardware test comment (2026-11-30T21:27:35Z):
    • dcpext0/dcpext1 idled off cleanly (0 new mailbox IRQs over 10 s, internal eDP-1 lit).
    • Unplugged open("/dev/snd/pcmC0D0p", O_WRONLY|O_NONBLOCK) and PipeWire probe at t = 22.46 s failed with -ENODEV (-19) because ps_dispext0_adma / ps_dispext1_adma sit under powered-down DISPEXT0_SYS / DISPEXT1_SYS.

@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: REQUEST CHANGES at 5f747ff0c727

Blockers:

  • Unfixed J813 unplugged dcp-dp-audio PCM open regression (reported at c4797d399ba0): Commit 5f747ff0c727 merges #3289 (feat/dcp-v27-idle-cache) cleanly, but does not yet fix the J813 (T8142, fw 27.2) regression where PipeWire/WirePlumber's unplugged probe of /dev/snd/pcmC0D0p / pcmC0D1p after dcpext0/dcpext1 idle power-off fails with -ENODEV / PMGR errors (0xb4f). Please gate/handle dcp-dp-audio PCM open while the external DCP is powered off at idle and re-verify on J813.
  • Queued hosted CI at 5f747ff0c727 (22 jobs queued): wait for apple-build, host-tests, pr-text, readiness, and KUnit suites to complete green once the regression is fixed.

Checked:

  • Audited merge commit 5f747ff0c727 (MERGEABLE against main): cleanly combines #3289's internal idle-cache fields and dcp_push_context(..., unwind_on_err) KUnit wrapper with #3410's external idle-off state (dcp_push_try() passes false).
Evidence
  • Head: 5f747ff0c727092223e691af72ebf1da9bd88c04 (base main, MERGEABLE).
  • Status checks at review time: 22 queued, 4 skipped, 0 failed.

@erikwb
erikwb force-pushed the feat/dcp-v27-ext-idle-off branch from 5f747ff to c4797d3 Compare December 1, 2026 00:32
@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 1, 2026
When an external DisplayPort pipeline powers off at idle, the ADMA
power domain in the same display power island turns off too. Probing
the ALSA PCM device while unplugged then fails
of_dma_request_slave_channel() when ADMAC tries to runtime-resume that
power domain.

Defer ADMA channel setup on unplugged PCM opens using a vmalloc void
buffer fallback (SNDRV_DMA_TYPE_VMALLOC), and wake/pin any
idle-capable external DCP across open DMA-backed PCM lifetimes so
runtime idle-off cannot drop ADMAC's power domain while a stream is
open or before its TX DMA channel is released on close or open error.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged live origin/main (41ab8f546874) at c53590aa9533 and re-applied the J813 unplugged dcp-dp-audio PCM open fix at f39fdeec3e43:

  • Conflict resolutions in c53590aa9533:
    • drivers/gpu/drm/apple/dcp-fabric.c: keep both dcp_ext_idle_kick(dcp) on mux_control_deselect() error and fixed_deselected = true on success.
    • drivers/gpu/drm/apple/dcp.c: keep dcp_ext_idle_suspend() before the firmware-27 deep-sleep refusal for external display processors without a stop.
  • drivers/gpu/drm/apple/audio.c: in dcp_pcm_open(), evaluate open_unplugged = !dcpaud->connected before ADMA setup and defer dcpaud_init_dma() / snd_dmaengine_pcm_open() when unplugged, constraining periods and serving hw_params/hw_free via a SNDRV_DMA_TYPE_VMALLOC void buffer fallback so probing /dev/snd/pcm* after dcpext powers down never requests a DMA channel or resumes ps_dispext*_adma.
  • drivers/gpu/drm/apple/audio.c: move snd_pcm_set_managed_buffer() out of dcpaud_init_dma() (which dcpaud_before_modeset() can invoke mid-open on hotplug) into the plugged DMA-backed path of dcp_pcm_open() (shared by both legacy and dcp_pcm_native_open()), ensuring managed_buffer_alloc is never set while an unplugged PCM is open.
  • drivers/gpu/drm/apple/audio.c: replace bool void_buffer with struct snd_dma_buffer *void_dmab (the exact allocated pointer) so dcpaud_free_void_buffer() (called from dcp_pcm_hw_free(), dcp_pcm_native_hw_free(), dcpaud_alloc_void_buffer() reallocation on hw_params re-entry, and dcp_pcm_close()) only calls snd_dma_free_pages() + kfree() on dmab == dcpaud->void_dmab (clearing dcpaud->void_dmab = NULL and calling snd_pcm_set_runtime_buffer(substream, NULL) only if runtime->dma_buffer_p == dmab) without calling snd_pcm_lib_free_pages(), preventing card->total_pcm_alloc_bytes underflow and making kfree(&substream->dma_buffer) structurally impossible.
  • drivers/gpu/drm/apple/audio.c, dcp.c, dcp-internal.h, audio.h: integrate dcp_audio_dma_get() / dcp_audio_dma_put() cleanly with #3712. Plugged opens wake and pin an idle-capable external DCP before dcpaud_init_dma() (returning ext_idle_err / -EIO if the DCP latched DCP_EXT_IDLE_FAILED). On open failure, dcp_pcm_open() runs dcpaud_release_dma() before dcp_audio_dma_put(). On close, dcp_pcm_close() runs snd_dmaengine_pcm_close(), then dcpaud_release_dma(), then dcp_audio_dma_put(), while dcp_pcm_native_close() (and dcp_pcm_native_open() error cleanup) runs dcp_audio_dma_put() after dcpaud_release_dma_locked() and dcp_audiosrv_close().
  • Tests (dcp-firmware-test.c, audio-legacy-test.c, dcpaud-open-fallback-tests.py, run-host-tests.py): add KUnit dcp_ext_idle_audio_dma_pin, dcpaud_legacy_unplugged_void_buffer, and dcpaud_legacy_unplugged_hotplug_managed_buffer (unplugged hw_params 8K -> hotplug/dcpaud_init_dma() -> hw_params 16K -> hw_free -> close plus &substream->dma_buffer guard), extract real dcpaud_init_dma() into dcpaud-open-fallback-tests.py to test the full mid-open hotplug path with ALSA snd_pcm_lib_malloc_pages()/snd_pcm_lib_free_pages() simulation, and add mutants drop-put-dma, void-lib-free, void-alloc-lib-free, managed-in-init-dma, and void-free-runtime-dmab (10/10 killed).

Verified offline at f39fdeec3e43: W=1 KCFLAGS="-Werror" object builds (0 warnings), checkpatch.pl --strict --git origin/main..HEAD (0 errors/warnings/checks), KUnit (display.kunitconfig 190 passed / 1 skipped including apple-dcp-firmware 7/7, display.kunitconfig + CONFIG_SOUND=y CONFIG_SND=y 275 passed / 2 skipped including apple-dcpaud-legacy 10/10, topology.kunitconfig 216 passed / 1 skipped, tests/.kunitconfig 117/117), dcpaud host tests (20/20, 10/10 open-fallback mutants killed), dart (24/24), dcpext26-startup-tests.py (--mutants), backlight-coldboot-tests.py, display-sleep-merge-tests.py (17/17), and apple-dcp selftest --group audio (2/2).

Prior J713 (M4 MacBook Air, T8132, 27.2 firmware) smoke at feef88606c29 (429e7e15f122 merged, before #2673 merged, default command line): booted clean (0 failed units, 0 AppArmor denials, 0 oops/WARN), 3 internal-panel DPMS off/on cycles and a 15 s s2idle passed; external display processors did not probe on 429e7e15f122 so no dcp-dp-audio card existed there. J813 live re-test (dcp-dp-audio unplugged probe after dcpext idle-off + hotplug audio/display playback + unplug), refreshed J713 verification on 41ab8f546874 (with #2673 merged), and hosted CI on f39fdeec3e43 remain pending; stacked #3334 and #3398 should be retargeted to main before merging #3410.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) ci-failing A check failed at the PR head (bot) labels Dec 1, 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.

The new idle-wake and re-arm calls in drivers/gpu/drm/apple/dcp-fabric.c break the host fixture that extracts dcp_typec_route_activate(). At f39fdeec, dcp-tunnel-prepare-tests.py fails to compile because dcp_ext_idle_wake() and dcp_ext_idle_kick() have no stubs. Please update that fixture and verify the normal and mutation runs. The J813 unplugged DP-audio PCM open should also be rerun on this head to verify the earlier regression fix.

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Dec 1, 2026
@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Dec 1, 2026
@erikwb

erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

We carry this PR in our J313 (M1 Air, T8103), J713 (M4 Air, T8132), and J716c (M5 Max, T6050) daily kernels.

Unattached Type-C-only firmware-27 external display processors (dcpext) previously stayed powered continuously at idle even with no cable or monitor connected, adding unnecessary idle power draw across firmware-27 laptops.

Running smoothly across all three daily kernels: directly on J713, on J313 with stacked #3334 enabling s2r_disp_dart_with_dcp, and on J716c with stacked #3398 wiring T6050 external DCPs.

This branch has not been deployed

No deployments
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) area:gpu Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants