Skip to content

drm/apple: enable AFK name fallback on T6041 internal DCP - #4070

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
allanclempe:fix/t6041-dcp-afk-name-fallback
Dec 3, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
allanclempe:fix/t6041-dcp-afk-name-fallback

Conversation

@allanclempe

Copy link
Copy Markdown
Contributor

What: Set .afk_name_fallback = true on apple_dcp_hw_t6041 so the T6041 internal DCP on macOS 27.2 (26B123, DCP_FIRMWARE_V_27_0) accepts AFK ep:20 infrastructure announcements that omit EPIC identity properties instead of failing with AFK[ep:20]: failed to extract init props: -2.
Tested: J616c (MacBook Pro 16" M4 Max, macOS 27.2 / 26B123 stub) at a1218aef0: scripts/checkpatch.pl --strict --no-tree (0 errors, 0 warnings, 0 checks) and tools/asahi/dcpext26-startup-tests.py PASS; identical .afk_name_fallback = true change booted live on J616c (linux-aurora 7.3.0-1-3.1-ARCH, built on db6da7821954) with 0 err..emerg kernel messages, 0 failed systemd units, and 402e00000.dcp AFK ep:20 channel 1 (system) bound.
Risk: two-way door · T6041 Macs (apple,t6041-dcp internal DCP only; external dcpext and other SoCs untouched).
Not yet: Kernel rebuild and cold boot directly at rebased head a1218aef0 (live boot verification ran on db6da7821954 with the identical T6041 flag); J614c (14" M4 Max) and T6040 (M4 Pro) hardware runs.

Details

apple_dcp_hw_t6030, apple_dcp_hw_t6031, and apple_dcp_hw_t8122 already enable .afk_name_fallback = true for firmware-27 internal DCPs, while apple_dcp_hw_t6041 still omitted it. On J616c (402e00000.dcp) running 26B123 (DCP_FIRMWARE_V_27_0), afk_recv_handle_init() logged:

apple-dcp 402e00000.dcp: AFK[ep:20]: failed to extract init props: -2

on every boot and left ep:20 channel 1 (system) unbound, while the four external apple,t6041-dcpext instances already took the dcp_has_external_output() fallback and bound cleanly. Setting .afk_name_fallback = true on apple_dcp_hw_t6041 matches the other firmware-27 internal DCPs and keeps non--ENOENT parse errors untouched. Also updates the stale comment in drivers/gpu/drm/apple/afk.c.

Evidence
  • git format-patch -1 --stdout | perl scripts/checkpatch.pl --strict --no-tree -: 0 errors, 0 warnings, 0 checks, 16 lines checked
  • python3 tools/asahi/dcpext26-startup-tests.py:
    • PASS native AFK announcements through deferred OPEN
    • PASS native D121 through actual shared-memory command and ACK bodies
  • Live J616c (apple,j616c, apple,t6041, os-fw-version / system-fw-version 26B123) running 7.3.0-1-3.1-ARCH (db6da7821954 + .afk_name_fallback = true on apple_dcp_hw_t6041):
    • journalctl -k -b -p err..emerg: 0 lines (AFK[ep:20]: failed to extract init props: -2 gone)
    • systemctl --failed: 0 failed units
    • 402e00000.dcp internal display (3456x2234, notch shown) and external display outputs operate normally

On the MacBook Pro 16-inch M4 Max (J616c, apple,t6041-dcp) booting with
macOS 27.2 (26B123, DCP_FIRMWARE_V_27_0) firmware, the internal DCP's
AFK ep:20 announces infrastructure services without EPIC identity
properties. Without .afk_name_fallback set on apple_dcp_hw_t6041,
afk_recv_handle_init() rejects the -ENOENT parse result with:

  apple-dcp 402e00000.dcp: AFK[ep:20]: failed to extract init props: -2

leaving ep:20 channel 1 (system) unbound on every boot, whereas the four
external apple,t6041-dcpext instances already take the external-output
fallback and bind cleanly, and T6030/T6031/T8122 internal DCPs already
set .afk_name_fallback = true.

Enable .afk_name_fallback = true on apple_dcp_hw_t6041 and update the
matching comment in afk.c.

Signed-off-by: Allan Clempe <allan.clempe@gmail.com>
@allanclempe
allanclempe requested review from a team as code owners December 3, 2026 06:11
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Merge readiness at a1218aef: ready to merge

Check Detail
CI at head ok 4 checks passed
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head ok in the PR body at a1218aef
Conflicts ok none
PR text ok Risk: two-way · T6041 Macs (apple,t6041-dcp internal DCP only; external dcpext and other SoCs untouched).

Areas: area:display
Merge: gh pr merge 4070 --merge (Owners and Core through the bypass: add --admin).

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

@RyanTheTide RyanTheTide 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 flag only changes the missing-property fallback on the T6041 internal DCP under firmware 27. Existing firmware and other AFK parse errors keep their current handling. The J616c backport demonstrates the missing identity announcement now binds. Exact-head cold boot is still pending.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Read at a1218aef: the flag only opens the missing-identity path for the T6041 internal DCP on firmware 27 (fw_compat == DCP_FIRMWARE_V_27_0), so 26.x and the external DCPs keep their path. It applies cleanly to main c09b61228e62.

One row before the merge, since binding ep:20 system is new on this DCP and main's firmware-27 sleep for it (#3687, #3861) was only run without it. J616c on 27.2 at this head: one cold boot (ep:20 channel 1 bound, 0 err lines), DPMS off/on, s2idle x1 and rtcwake -d rtc1 -m mem -s 20 x2 with the panel, backlight and external displays back. With that it merges.

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor

J616c (16" M4 Max, T6041, 32-core) — 27.2 receipt (a05d99c9dbc21 + a1218aef079f)

  • Setup: MacBook Pro 16" M4 Max (J616c, 27.2 / 26B123 stub), Aura Stage 2 1.0.0b19-g70d844e3 (aura-try one-shot), kernel main a05d99c9dbc21 + cherry-pick of a1218aef079f (7.3.0-j616c-4157-j616c-4070, default command line). Note: no external displays physically attached during this run.
  • Cold boot:
    • apple-dcp 402e00000.dcp: AFK[ep:20]: new service system on channel 1 (previous AFK[ep:20]: failed to extract init props: -2 gone)
    • All four external dcpext instances (306e00000, 3a2e00000, 602e00000, 606e00000) also bound ep:20 channel 1 (system) and channel 3 (powerlog-service)
    • journalctl -k -b -p err..emerg: 0 lines
  • DPMS off/on (Hyprland dpms off -> dpms on): card2-eDP-1 transitioned On/enabled -> Off/disabled -> On/enabled, backlight restored (30/600), 0 kernel errors.
  • s2idle x1 (rtcwake -d rtc1 -m freeze -s 15): woke cleanly, eDP-1 On/enabled, backlight 30/600, 0 kernel errors.
  • Deep sleep x2 (mem_sleep=s2idle [deep], rtcwake -d rtc1 -m mem -s 20 x2): both cycles woke cleanly, eDP-1 On/enabled, backlight restored (30/600), journalctl -k -b -p err..emerg: 0 lines.

@DjDeveloperr

DjDeveloperr commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Merging a1218aef079f. AxxzyWasTaken's J616c row (11:22Z, main a05d99c9dbc2 + this commit) covers the cold boot, DPMS, s2idle x1 and deep x2. drivers/gpu/drm/apple hasn't changed on main since.

The external-display half of my 08:28Z ask was not run (nothing was attached). It isn't needed for this change:

  • Comparing .text, .rodata and .data with main: afk.o is the same, and dcp.o differs in one .rodata byte, inside apple_dcp_hw_t6041. apple_dcp_hw_t6041_dcpext is unchanged, and the four dcpexts already took this path and bind ep:20 system.
  • Binding fills one service slot in this DCP's own ep:20 and sends one OPEN on its own mailbox. system does nothing on init unless enable_verbose_logging is set, has no report or teardown handler, and firmware calls to it are refused as before.
  • The stop and start in deep sleep, s2idle and DPMS (dcp_t6041_stop_dev(), dcp_t6041_internal_*) don't look at AFK services. Unbind shuts ep:20 down whether or not a service is bound.
  • My ask was also wrong for deep sleep: on T6041 main leaves the dcpexts stopped after a deep wake (only apple,t6040-display-power restarts them), and s2idle leaves them alone.

Still untested: an external display attached during any of these, J614c, and T6040. Nothing here shows how the firmware itself treats the opened service with an external display lit. The code only shows that no host path crosses over.

Checked on the merge with main (c5bdd6820568; main has since moved only in the scaler driver):

  • make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/{afk,dcp}.o: 0 warnings on main and on the merge.
  • tools/asahi/run-host-tests.py, in the hosted image: every group that names these two files (56 runs) and a wider dcp/dcpext/afk pass (160 runs). All pass, including apple-dcp and dcpext26-startup-tests. The exception is ave-recovery-old, an encoder test that needs a git work tree my copy didn't have (it fails the same way on main there).

@DjDeveloperr
DjDeveloperr merged commit dbfe45a into aurora-silicon:main Dec 3, 2026
5 checks passed
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) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants