Repository navigation
Conversation
gig3m: drm/apple: T8142: stop the DCP firmware on DPMS off (firmware 27.0) Resolved onto the J815 sleep work it was carved from: the DART keeps this tree's lazy GAPF/PS-wr-dis read, the DARTs stay in t8142.dtsi (J813 gets only the display-power node), and T8142 gets s2r_no_secure_port (without it the DCP stop was dropped at probe: T8142 has no secure mailbox). T8142's deep sleep keeps its firmware stop too, still behind appledrm.s2r_untested.
…merges aurora-silicon#1941 brought a second copy of struct dcp_s2r_layout (this tree had it from the J815 sleep work); aurora-silicon#1808 names nvme's sleep_traced, which this tree calls sleep_coproc (with sleep_untested, from the aurora-silicon#1477 rework). Assisted-by: Claude Opus 5.5 Signed-off-by: Nick <nekreshen@yandex.ru>
|
@gig3m thanks for carving this out. Two things from carrying it in the J815 tree (m0d16l14n1/linux
I'll post the J815 DPMS cycle and SMC power numbers here once it has run. Assisted-by: Claude Opus 5.5 |
|
@gig3m here are the J815 (MacBook Air 15" M5) results I promised above. These are on firmware 27.2 (macOS 27.2 stub, t8142dcp 1317.40.16), not 27.0. Tree: m0d16l14n1/linux
Result with
Power: no clean screen-off A/B on this Mac yet (no SMC PSTR run with and without the option). The closest numbers are lid-closed s2idle on battery, from the gauge: 8 h without the option averaged 1.54 W, 4 h with it 0.42 W. Not all of that is this PR: the second boot also paused the AOP ALS reports for sleep, which cut the wake-ups. The DCP no longer stays up through the sleep, which fits your J813 numbers. I'll post a PSTR A/B if we run one. Not tested on J815: external displays across a DPMS cycle, and firmware 27.0 (this Mac is on the 27.2 stub now). Assisted-by: Claude Opus 5.5 |
4f1ff79 to
48aab64
Compare
|
The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. This enables the DCP stop on firmware 27.0 only; please make 27.2 the supported case (with the 27.2 A550 release from #2063). |
48aab64 to
8079314
Compare
|
@RyanTheTide retargeted to 27.2. The branch now carries #2063's A550 entry, and the comments and option text name 27.0 and 27.2. I've tested it on my J813 on 26B123: the firmware stopped and restarted on 3 of 3 DPMS cycles, and screen-off power went from 4.84 W to 3.91 W. On 27.2 it needs #1683 for the DCP to run the firmware 27 interface at all. I've added that to the description. #1942 is rebased on #1923 too. 🤖 Generated with Claude Code |
T8142 has no GAPF slice for the DCP DART. Its SPTM (27.2.1) keeps a bit per DART in a shared PS write-disable register instead (/chosen/dart-ps-wr-dis-entries): set, the fabric rejects writes to the power word of the coprocessor CPU behind the DART. The driver clears that bit where it clears GAPF bit 4 on T8140, for a DCP firmware stop, and sets it again after. Only this DART's bit of the register is changed. A GAPF slice is handled as before. Nothing of the shared register's boot value is written back, only this DART's bit. From m0d16l14n1's J815 sleep work (m0d16l14n1#1, 192a56c), taken out on its own for the DPMS firmware stop. Assisted-by: Claude Opus 5.5 Assisted-by: Claude Fable 5.2 Signed-off-by: Kyle Arrington <kyle@arrington.co>
T8142's display power node has the power gate and power state words only: its PMC keeps no count of the powered coprocessors, so there is no pmc-dcp word. From m0d16l14n1's J815 sleep work (m0d16l14n1#1, 192a56c). Assisted-by: Claude Opus 5.5 Assisted-by: Claude Fable 5.2 Signed-off-by: Kyle Arrington <kyle@arrington.co>
hw.s2r stops the internal DCP's firmware and powers its domains off when the display is turned off, and restarts it warm on DPMS on. Only T8140 had the data for it. This adds what T8142 needs: - the power words and DART streams become a per-SoC layout (dcp_s2r_layout), with T8140's values unchanged and T8142's derived from the macOS 27.2.1 device tree and PMGR (DISP_SYS at 0x290, retention words 0x11cc/0x11f0, no exclave streams, no pmc-dcp); - the firmware 27 sleep calls: set_power_state, D572 (powerUpDART) and the AP link's release, which 27.0 dispatches as A500 and 27.2 as A550 (aurora-silicon#2063). A build whose table has no tag for the release (27.3 so far) is not offered the stop; - T8142 has no DCP secure mailbox (no dcp-exclave-mailbox in the 27.0 or the 27.2.1 device tree of a J813), so the stop no longer requires one on this SoC (s2r_no_secure_port). The stop stays off by default on T8142 (appledrm.s2r_untested=1 enables it). On firmware 27.2 it also needs the DCP to run the firmware 27 interface there, which aurora-silicon#1683 ("drm/apple: dcp: T8142: Drive the macOS 27.2 firmware") adds; without it a 27.2 J813 runs H17P and the stop is not offered. This is a screen-off (DPMS) power saving. A SoC behind appledrm.s2r_untested does not take the stop's system sleep path. Tested on a J813 (MacBook Air 13" M5) with appledrm.s2r_untested=1: - firmware 27.0, on this series with and without the option: DPMS off stops the firmware, DPMS on restarts it ("RTKit: Initializing") and the panel comes back at its brightness, 6 of 6 cycles. System power with the screen off (SMC PSTR, on battery, 12 and 15 samples): 2.72 W without the stop, 1.81 W with it. - firmware 27.2 (t8142dcp 26B123), with the A550 entry: DPMS off logs "IOMFB: power on -> off" and "power_down_M3: disabling M3", DPMS on restarts the firmware ("RTKit: Initializing") and the panel comes back at its brightness, 3 of 3 cycles. Screen-off system power (SMC PSTR, on AC at the charge limit, 8 samples per cycle, 3 cycles each, the same boot setup with appledrm.s2r_untested=0 for the other side): 4.84 W without the stop, 3.91 W with it. m0d16l14n1 ran it on a J815 on firmware 27.2 with the A550 entry: 4 DPMS cycles over 3 boots, the firmware stopped and restarted each time. The driver part is from m0d16l14n1's J815 sleep work (m0d16l14n1#1, 192a56c), without its hibernation and deep sleep pieces; the secure mailbox change and the J813 test are new. Assisted-by: Claude Opus 5.5 Assisted-by: Claude Fable 5.2 Signed-off-by: Kyle Arrington <kyle@arrington.co>
The power gate and power state words a DCP firmware stop writes, and the DCP DART's PS write-disable bit that protects DISP_CPU's power word (ADT dart-dcp clock-protection-wr-dis-id 0x1f: pmgr reg[1] + 0x3fdc, bit 6). Assisted-by: Claude Fable 5.2 Signed-off-by: Kyle Arrington <kyle@arrington.co>
The T8140 profile now names its firmware-stop layout. Give the unit's copy of apple_dcp_hw_data the pointer and an opaque layout so the extracted profiles compile; the unit does not read it. Assisted-by: Claude Fable 5.2 Signed-off-by: Kyle Arrington <kyle@arrington.co>
8079314 to
58d40fd
Compare
|
Closing: #2135 carried this series into Tested on a J813 on 26B123 with this series, #2063 and #1683: the firmware stopped and restarted on 3 of 3 DPMS cycles, and screen-off power went from 4.84 W to 3.91 W. 🤖 Generated with Claude Code |
On the M5 (T8142), turning the screen off blanks the panel but leaves the display coprocessor running. This series lets
hw.s2rstop it on DPMS off and restart it on DPMS on, as T8140 already does.Off by default on T8142:
appledrm.s2r_untested=1enables it. This is screen-off idle power, not system sleep; T8142 doesn't take the system sleep path.Depends on #1683 for firmware 27.2: on
integration/aurora, a T8142 DCP gets the firmware 27 interface only forapple,firmware-compat"27.0.0". #1683's "drm/apple: dcp: T8142: Drive the macOS 27.2 firmware" adds 27.2. Without it, a 27.2 J813 runs H17P and the stop is not offered.Tested on a J813 (MacBook Air 13" M5) with SMC PSTR and the screen off:
appledrm.s2r_untested=0for the other side: 4.84 W without, 3.91 W with. The firmware stopped ("power_down_M3: disabling M3") and restarted ("RTKit: Initializing") on every cycle, and the panel came back at its brightness, 3 of 3.m0d16l14n1 also ran it on a J815 on 27.2 with the A550 entry (4 cycles over 3 boots; results in the comments).
Not tested: J704, firmware 27.3.
The driver changes come from m0d16l14n1's J815 sleep work (m0d16l14n1#1), without its hibernation and deep sleep parts. Two fixes on top from review: only this DART's bit of the shared write-disable register is written, and the firmware limit.
🤖 Generated with Claude Code