Repository navigation
Conversation
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]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
This was referenced Nov 26, 2026
…in' into feat/dcp-v27-ext-idle-off # Conflicts: # drivers/gpu/drm/apple/dcp.c
Contributor
|
Hardware verification row on J813 (M5 MacBook Air 13-inch, T8142, macOS 27.2 firmware,
|
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Review at 944b0ba788d2: READY on the code, 0 blockers. Commenting for now rather than approving: the hotplug-wake row and post-retarget build CI are still owed (below). This PR is stacked on #3307 and merges after it. Build CI has not run here because the base is the feature branch.
- Gating:
dcp_ext_idle_capable()needsdcp_s2r_ext_capable(), firmware 27, a USB-C connector and no HDMI HPD. So onmainthis stays off by default, as the body says. - Locking:
- The order is fabric lock →
ext_idle_lock→hpd_mutex. The route activate and apply paths calldcp_ext_idle_wake()under the fabric lock, and the wake takeshpd_mutexinsideext_idle_lock. - The off-work never takes the fabric lock (only HDMI and mux callbacks do).
- Route deactivate kicks without holding
hpd_mutex. - Close and suspend drop
ext_idle_lockbeforecancel_delayed_work_sync(), and wake uses the non-sync cancel under the lock. No inversion that I can see.
- The order is fabric lock →
- Power-off sequence:
- It checks for pending Type-C work without blocking (
work_busy()). - It pauses presentation, then darkens the display and DCP DARTs (and reopens both on any entry error).
- It sends A500, polls
iomfb_channels_idle(), then stops RTKit and the streams, and only then lowers the domains. - A domain power-off failure restarts through
dcp_s2r_ext_cycle(). Every other failure latches FAILED withcrashed.
- It checks for pending Type-C work without blocking (
dcp_push_try(): it hands back the queue error without calling the callback, so the twokref_put()s on-ENOMEMbalance the wait cookie.- Wake:
- Display attach (
dcp_dptx_connect*(), route activate),dcp_poweron(), system suspend, unbind, remove and shutdown all wake or close the pipe. - Resume,
PM_POST_SUSPENDand route deactivate re-arm the idle timer.
- Display attach (
- Checks:
checkpatch.pl --strictis 0/0/0. The commit is signed off, with no attribution, and it merges cleanly ontomainwith #3307. - CI: 2/2 checks pass. The Apple build and KUnit don't run on a PR against a feature branch. sithglan's exact-head J813 kernel (
7.3.0-aurora-j813-pr3308+) is the build evidence. - Question, not blocking: once a pipe is FAILED with
ext_idle_domains_offset,dcp_ext_idle_suspend()returnsext_idle_err ?: -EIOon every later system sleep. A single failed idle power-off then keeps the Mac awake until reboot. If refusing sleep is the intent (so DART PM never touches powered-off registers), a log line saying so would help whoever hits it. - Hardware: the J813 (T8142,
s2r_untested=1) row at this head covers idle power-off, two deep sleep cycles and re-gating after resume. - Owed before merge:
- Hotplug wake from idle-off: attach a USB-C or Thunderbolt display while the pipe is gated, check it lights, unplug and check it re-gates. This is the main path the feature adds, and the PR's Not yet lists it.
- Build CI: after #3307 merges and this PR is retargeted to
main.
This was referenced Nov 27, 2026
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: 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, waking synchronously on display attach or system suspend. Stacked on #3307 (feat/apple-dart-display-dark-drain). Onmain, this remains gated bydcp_s2r_ext_capable()(requirings2r_extand either a DT power layout orappledrm.s2r_untested) until J713 v27.2 external display support lands.Tested: Built
drivers/gpu/drm/apple/{iomfb,iomfb_v27,iomfb_h17p,iomfb_v26_6_desktop,dcp,dcp-fabric}.o(ARCH=arm64 LLVM=1 W=1, 0 warnings), strictcheckpatch.pl(0 errors, 0 warnings, 0 checks),tools/asahi/backlight-coldboot-tests.pyPASS, andtools/testing/selftests/drivers/gpu/apple-dcp/run.pyhost suite PASS at05d728d91d68. Hardware-verified on J713 (M4 MacBook Air, macOS 27.2 firmware, default cmdline,s2r_untested=N) in a combined trial build mergingj713-dcpext/air-dcpext-272(7a8022a6d24d) with #3297 (2b1bab104938), #3300 (6a84c1d95460), #3307 (eab8b5157340), and #3308 (05d728d91d68): both286e00000.dcpand48ae00000.dcppowered off in 1 ms after boot, woke in 1 ms onpm_test=devicesdeep suspend, recovered cleanly across refused-sleep power cycle, and re-gated in 1 ms after resume (0 warnings/errors, 0 failed units).Risk: two-way door · Type-C-only firmware-27 external display processors with
s2r_ext(currently gated behinddcp_s2r_ext_capable()onmain).Not yet: External Type-C/Thunderbolt display hotplug wake from idle-off and full hardware S2R wake cycle on J713; verification on T8142; retarget base to
mainonce #3307 merges.Details
DCP_EXT_IDLE_ON,OFF,FAILED,CLOSED) underext_idle_lockstrictly inner todcp_typec_fabric_lock, scoped todcp_ext_idle_capable(dcp)pipelines (dcp_s2r_ext_capable(),DCP_FIRMWARE_V_27_0,DRM_MODE_CONNECTOR_USB,!hdmi_hpd).ext_idle_pausedflag underhpd_mutex(avoidingdcp_disable_typec_work()/dcp_enable_typec_work()disable-depth imbalance) and checks pending Type-C work non-blockingly before quiescing.dcp_push_try()so pre-send A500 queue allocation failure (-ENOMEM) releases wait-cookie references without markingdcp->crashed, allowing DART reopen and deferral.iomfb_channels_idle()before RTKit stop, aborts before lowering domains if stream shutdown fails, tracksext_idle_domains_offstrictly from the first power-control write until domains and DARTs are confirmed restored, and wakes idle-gated pipes before system suspend or component unbind/remove.PM_POST_SUSPEND.main, J713 uses theiomfb_m4.cexternal DCP path and its firmware-27 profile does not enables2r_ext, while T8142 external profiles still requireappledrm.s2r_untested. Once J713 v27.2 external display support lands (as verified in thej713-dcpext/air-dcpext-272trial build), this path activates automatically on the default command line with the DT power layout.Evidence
make O=build/j713 ARCH=arm64 LLVM=1 W=1 M=drivers/gpu/drm/apple iomfb.o iomfb_v27.o iomfb_h17p.o iomfb_v26_6_desktop.o dcp.o dcp-fabric.o— 0 errors, 0 warningsscripts/checkpatch.pl --strict --no-tree— 0 errors, 0 warnings, 0 checkspython3 tools/asahi/backlight-coldboot-tests.py— PASStools/testing/selftests/drivers/gpu/apple-dcp/run.py --group quiesce --group lifecycle— matchesorigin/mainbaselines2r_untested=N,j713-dcpext/air-dcpext-2727a8022a6d24d+ pmdomain: apple-pmc: resolve display interfaces via consumer-switched power-domains #32972b1bab104938+ drm/apple: toggle display pipe PMC interfaces across S2R domain transitions #33006a84c1d95460+ iommu/apple-dart: drain TLB flushes and fault IRQs when display DART goes dark #3307eab8b5157340+ drm/apple: power off idle firmware-27 external display processors #330805d728d91d68):t=6.11s:apple-dcp 286e00000.dcp: display domains off: CPU 0xf000300 FE 0x2300 SYS 0x2100apple-dcp 286e00000.dcp: dcpext idle: powered off in 1 msapple-dcp 48ae00000.dcp: display domains off: CPU 0xf000300 FE 0x2300 SYS 0x2100apple-dcp 48ae00000.dcp: dcpext idle: powered off in 1 mspm_test=devicesdeep suspend/resume cycle:dcpext idle: woke in 1 ms), stopped cleanly for sleep (firmware stopped for sleep: control 0x0 status 0x6e), completed refused-sleep power-cycle recovery (sleep refused: firmware back after a power cycle: 0), and re-gated automatically 5 s after resume in 1 ms each.apple-panel-bl 150/500, 30 samples @ 2 s): avg-3.921 W(min-3.962 W, max-3.853 W) vs-4.084 Wavg (floor-3.943 W) on daily7.3.0-j713-272tbwithout idle gating. 0 failed systemd units, 0 kernel warnings/errors.