Skip to content

drm/apple: T8142: stop the DCP firmware on DPMS off (firmware 27.2) - #1941

Closed
gig3m wants to merge 5 commits into
aurora-silicon:integration/aurorafrom
gig3m:j813/dcp-dpms-stop-t8142
Closed

gig3m wants to merge 5 commits into
aurora-silicon:integration/aurorafrom
gig3m:j813/dcp-dpms-stop-t8142

Conversation

@gig3m

@gig3m gig3m commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

On the M5 (T8142), turning the screen off blanks the panel but leaves the display coprocessor running. This series lets hw.s2r stop it on DPMS off and restart it on DPMS on, as T8140 already does.

  • Builds on drm/apple: iomfb: firmware 27.2: the AP link's release is A550 #2063 (merged): firmware 27.2 moved the AP link release from A500 to A550.
  • A per-SoC layout for the display power words and DART streams (T8140's values unchanged).
  • T8142's layout and the firmware 27 stop calls: set_power_state, the AP link release (A500 on 27.0, A550 on 27.2) and D572. A build whose table has no tag for the release (27.3 so far) isn't offered the stop.
  • T8142 has no DCP secure mailbox, so the stop doesn't require one there.
  • apple-dart: T8142's PS write-disable bit in place of a GAPF slice.
  • J813 device tree.

Off by default on T8142: appledrm.s2r_untested=1 enables 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 for apple,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:

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

m0d16l14n1 added a commit to m0d16l14n1/linux that referenced this pull request Nov 15, 2026
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.
m0d16l14n1 added a commit to m0d16l14n1/linux that referenced this pull request Nov 15, 2026
…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>
@m0d16l14n1

Copy link
Copy Markdown
Contributor

@gig3m thanks for carving this out. Two things from carrying it in the J815 tree (m0d16l14n1/linux j815/test-next):

  1. 27.2 stubs: the stop needs the AP link release, 27.0's A500 (dcpep_unnamed_500). Firmware 27.2 moved the AP methods up by 50, so the 27.2 table had no tag for it and dcp_s2r_capable() refused the stop on every 27.2 stub. In t8142dcp 1317.40.16, the one special-cased compare that 1317.1.1 makes against 'A500' (then 'A500' | 1, two handlers) is made against 'A550', in the same code shape, and nothing builds 'A500' any more (A500 is set_parameter_dcp there). Mapping IOMFB_METHOD("A550", dcpep_unnamed_500) in dcp_methods_27_2 is commit e7faf08. D572 is unchanged. Not run yet; the J815 boots it next, with appledrm.s2r_untested=1.
  2. That tree lacked s2r_no_secure_port for T8142 (the J815 sleep work predates your fix), and without it dcp_s2r_check_dt() dropped the stop at probe. So that part of your series is a real fix on our side too.

I'll post the J815 DPMS cycle and SMC power numbers here once it has run.

Assisted-by: Claude Opus 5.5

@m0d16l14n1

Copy link
Copy Markdown
Contributor

@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 j815/test-next. It merges this PR as it stands (a24ce18) with:

  • e7faf08: IOMFB_METHOD("A550", dcpep_unnamed_500) in dcp_methods_27_2 (see my comment above). 27.2 runs as V_27_0 with its own table, so without the tag dcp_s2r_capable() refuses the stop on every 27.2 stub.
  • J815 DT: the same display-power@380724000 node (pwrgate 0x380724000, ps 0x380700000), and the DCP DART's ps-wr-dis bit 6 at pmgr + 0x3fdc. ADT dart-dcp clock-protection-wr-dis-id is 0x1f here too, so the values match your J813 commit.
  • A merge fix-up only: our tree already had struct dcp_s2r_layout from the sleep work, so we dropped the duplicate. The three driver commits are otherwise as you wrote them.

Result with appledrm.s2r_untested=1: 3 boots, 4 DPMS off/on cycles, all good.

  • Probe logs firmware stop on DPMS off enabled (appledrm.s2r_untested), and no stop refused follows.
  • DPMS off: the firmware's own syslog shows IOMFB: power on -> off, then power_down_M3: disabling M3.
  • DPMS on: a fresh RTKit: Initializing (protocol version 12) (so the firmware really was stopped and rebooted), then IOMFB: power off -> on. The panel came back each time with its mode and backlight (eDP-1 enabled dpms=On, apple-panel-bl at the session's level, bl_power=0).
  • One cycle was a plain screen blank (off for 53 s, no system sleep). The other three were lid closes: KWin's DPMS off came 0-2 s before s2idle, and one of those sleeps lasted 4 h. No DCP crash, timeout or DART fault in any of the three boots.

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

@RyanTheTide

Copy link
Copy Markdown
Contributor

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).

@gig3m
gig3m force-pushed the j813/dcp-dpms-stop-t8142 branch from 48aab64 to 8079314 Compare November 17, 2026 13:14
@gig3m gig3m changed the title drm/apple: T8142: stop the DCP firmware on DPMS off (firmware 27.0) drm/apple: T8142: stop the DCP firmware on DPMS off (firmware 27.2) Nov 17, 2026
@gig3m

gig3m commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@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

m0d16l14n1 and others added 5 commits November 17, 2026 13:16
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>
@gig3m
gig3m force-pushed the j813/dcp-dpms-stop-t8142 branch from 8079314 to 58d40fd Compare November 17, 2026 19:19
@gig3m

gig3m commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Closing: #2135 carried this series into integration/aurora (the DPMS-off stop, the T8142 layout, the DART PS write-disable bit and the J813 device tree), together with #1683's "Drive the macOS 27.2 firmware". With #2063's A550 entry merged as well, the stop is offered on firmware 27.2. What's left here is wording only: comments and the s2r_untested description still say 27.0. That isn't worth a PR of its own.

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

@gig3m gig3m closed this Nov 17, 2026
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