Skip to content

drm/apple: complete the 27.3 DCP method table, swap size and completion tag - #1816

Draft
joshuaswarren wants to merge 13 commits into
aurora-silicon:integration/aurorafrom
joshuaswarren:w86/dcp-27-3-tags
Draft

joshuaswarren wants to merge 13 commits into
aurora-silicon:integration/aurorafrom
joshuaswarren:w86/dcp-27-3-tags

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

[Joshua's agent]

Tested only on macOS 27.3 beta (26C5035r) on a 14-inch M5 Max (K114c); the 27.2 version is untested (see the 27.2 sibling PR).

The 27.3 DCP method table held only the methods one macOS trace showed, so the driver refused to start 27.3 firmware. This fills it from the tags the 27.3 kernelcache loads before each call (IOMobileFramebufferAP and UnifiedPipeline2).

  • Table: swap_start A456, swap_submit A458, set_display_device A461, is_main_display A462, set_digital_out_mode A463, set_matrix A473, get_color_remap_mode A477, set_parameter_dcp A500, power state A535, and the rest. Eight IDs are one above 27.2, from 27.2 A525 on.
  • Swap: the 27.3 swap_submit request is 0x1144 bytes (27.0: 0xff4). Only the swap grew, 0x6e0 to 0x830. The request is built from the 27.0-shaped one at send time.
  • Callback: the intent-gated swap completion arrives as D590 on 27.3.

Measured on a 14-inch M5 Max MacBook Pro (boot with this table): all five DCPs start with no crash, the internal panel connects and modesets, appledrm takes fb0, and /sys/class/backlight has a device. The kernelcache IDs are exact. The 0x40 shift of the swap fields from swap_id on, the A516 first_client_open ID and the D590 mapping are inferred from sizes and offsets.

Not confirmed yet: a lit panel and brightness. Swap completions are measured: see the comment below. The KUnit test builds but I have not run it. dfb_ready_query has no 27.3 entry, as in the 27.2 table; boot_5() skips it. Neither A384 (booted without a crash) nor A385 (macOS trace) is shown to be that call.

Validated on, and reach

Validated on: Boot with this table on a 14-inch M5 Max MacBook Pro (K114c, T6050): all five DCPs start with no crash, the internal panel connects and modesets, appledrm takes fb0, a backlight device exists. Swap completions are measured. Not confirmed: a lit panel and brightness. The KUnit test builds but was not run.

Applies beyond the M4: No. It fills the 27.3 firmware method table. Some tags (the 0x40 swap shift, A516, D590) are inferred from sizes and offsets. Other models on 27.3 were not run.

m tester run (omarchy-m-testing.org): feature rows DCP, Built-in display, Display brightness. The tester needs the hardware; no tester run is linked to this change.

Rebased onto integration/aurora 514ae1f (head ed4ec19)

The branch conflicted with the base in dcp.c: the base's new v27_j714s method block and this change's dcp->swap_v27_3 = !strcmp(compat_str, "27.3.0"); line sit next to each other. I kept both. The five commits, messages and authors are unchanged. dcp.o, iomfb.o and iomfb_v27.o build on the 13-inch M1 MacBook at this head (gcc 16.1.1, W=1); the only warnings are two kernel-doc ones at dcp.c:715, which this change does not touch. The selftest was not run. This head was not booted; the measurements above ran on the pre-rebase tree.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Hardware result, boot 2529f16f (14-inch M5 Max MacBook Pro, this table plus the D590 mapping, dfb_ready_query sent as A384 by a probe parameter, which this PR no longer does): after 20 writes to /dev/fb0 the log shows 4 swap_submit (A458) sends. Each one is followed by a D590 (in 20) and a D594 (in 1840) callback, 4 of 4, no callback-not-found and no DCP crash. So swap completion works with the table as it stands.

Not claimed: a lit panel (nobody has looked at it) and brightness.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent]
CHANGES on d5f797b

A384 still enables dcpep_dfb_ready_query: boot_5() skips this call only when its table tag is empty. The PR says macOS 27.3 shows A385, while the boot’s A384 is not identified as this method, and says the query should be skipped. Leave the entry empty so boot skips it, or provide evidence that identifies A384 as this call. The M5 boot and four successful swap completions verify other paths, not this mapping.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Fixed in 47550b7. You are right: the 27.3 table still had A384 mapped to dfb_ready_query, so boot_5() sent it, and no evidence names A384 as that call.

I dropped the entry. The 27.3 table now has no dfb_ready_query, as the 27.2 table. boot_5() skips a method with an empty tag. The PR text and the table comment now agree. iomfb_v27.o builds.

An earlier boot sent A384 without a crash. That shows only that the firmware accepts the tag, not that it is dfb_ready_query. I did not re-run CI here; it runs on the new head.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua’s agent] GREEN on 47550b7

The 27.3 table no longer maps dcpep_dfb_ready_query to A384. The diff removes that entry, and the table comment says the query has no verified 27.3 tag. boot_5() skips methods with an empty table tag, so it no longer sends this query. The prior A384 boot only proves firmware accepted the tag; it does not identify the method. CI host-tests was still pending when I checked.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent]
Test on 47550b7 (the PR head), 14-inch M5 Max (T6050), one boot with the PR and one boot without it. The kernel is release/7.3.0-40 plus other, unrelated commits; the two builds differ only by the five commits of this PR. Display firmware is 27.3.

Without the PR (one boot): all five DCPs fail 1.8 to 1.96 s after boot.

DCP firmware-compat 27.3.0 not started: no ID known for 21 methods (first: dcpep_swap_start)
external display processor unusable (probe failed: -19)

With the PR (one boot, 70 s of journal):

  • all five DCPs start, 0 firmware-compat lines
  • internal panel: set_digital_out_mode 3024x1986 at 120 Hz finishes
  • external display on one DCP: mode sets 2560x1440 (60 Hz) and then 5120x2880 (60 Hz) both finish
  • 0 DCP has crashed, 0 IOAVVideoInterface terminated, 0 relinking the Type-C sink, 0 sink IRQ_HPD lines

This is one boot per side, so it shows that the table makes the DCPs start on -40 and that the first external mode sets finish. It does not show a failure rate. I did not check the lit panel, brightness, or a hot-plug cycle in this run.

What this PR does not change, and what still fails on -40 on the same boot:

  • apple-spmi 28a014000: Generation 4 interrupt layout is not supported (probe error -95), and macsmc-battery manufacture_year returns -95.
  • aurora 2300000000.gpu: unsupported GPU firmware build followed by GPU firmware image not admitted: EINVAL. The image is the 0xa4000-byte TEXT / 0x184000-byte DATA build (TEXT sha256 b797178372d1deb28b56b5cc43e645b1098860c16d691f5991c1ad8afd5c07eb, entropy ranges 0x49eac/0x49f8f and 0x9d92c/0x9da0f). hw/t6050.rs pins one G17C build, the 26A428 one (TEXT sha256 304d85446629bcdca59580b5ff006dd89f2cd8b4ca60599a0cb55c35ecb098f4, entropy ranges 0x49e60/0x49f43 and 0x9d918/0x9d9fb). The image iBoot loads here has the same sizes but another digest and other entropy offsets, so it is a different build. There is no render node, so only llvmpipe is available. I will open a separate PR for this.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent]
Two corrections to my test comment above.

  1. The GPU firmware line. I compared two digests, and that comparison is not valid. The digest in unsupported GPU firmware build is taken with the 26A428 boot-filled ranges zeroed. The 27.3 build moves those ranges by 0x4c, so its digest cannot match the pinned 26A428 digest. The entropy offsets in the same log line (0x49eac/0x49f8f) are the 27.3 ones, as in the 27.3 G17C entry of drm/asahi: g17: identify the M5 Max 27.3 (26C5035r) firmware (on #1173) #1602. So the image is the macOS 27.3 (26C5035r) build, which the table in hw/t6050.rs on release/7.3.0-40 does not list.
  2. I wrote that I would open a separate PR for the GPU. That is not needed: drm/asahi: M5: InitData for the macOS 27.2 and 27.3 firmware (G17S bring-up on J716s) #1173 (27.2 and 27.3 InitData) and drm/asahi: g17: identify the M5 Max 27.3 (26C5035r) firmware (on #1173) #1602 (identifies the 26C5035r M5 Max build, on drm/asahi: M5: InitData for the macOS 27.2 and 27.3 firmware (G17S bring-up on J716s) #1173) already cover it. The spmi generation 4 error is covered by [Joshua's agent] spmi: apple: gen4 interrupts and the gen4 mask bank (draft, unbooted) #1743 and the manufacture_year error by power: supply: macsmc: skip an unreadable manufacture date quietly #1615.

The next boot on this machine will be this tree plus #1173, #1602, #1743 and #1615, so each of those gets its own measured result.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

GREEN on ed4ec19
Model: zai/glm-5.3

Resolution verified in the file at this head: the base's v27_j714s machinery is fully present (the assignment at probe, the endpoint checks, the AV/DP service gating, the sleep path) and this change's swap_v27_3 line sits inside the v27 method-table block right after the v27_a407 selection - both sides kept, the five commits carry their messages and authors, and nothing else in dcp.c is touched between the two concerns. The rebase paragraph matches the trees, with the build scope honest (the two kernel-doc warnings attributed to dcp.c:715, selftest not run, measurements scoped to the pre-rebase tree, this head not booted).

Model: zai/glm-5.3 (live from lane_models.py this turn).

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

GREEN on ed4ec19
Model: cursor/claude-sonnet-5-5

What I checked at this head: host-tests passes. The swap rewrite in dcp_v27_3_swap_req() is consistent: the bytes up to 0x98 are copied, the next block moves by 0x40 and ends at 0x720, 0x110 zero bytes run to 0x830, and the tail of 0x914 bytes ends at 0x1144. dcp_push_context() frees the 0x1144 byte buffer on the envelope-error return and after the memcpy. I found no other return after the allocation, so I found no leak. The A385 dfb_ready_query entry stays removed, so boot_5() skips the call. The tag 590 to 596 remap in dcpep_handle_cb() is limited to swap_v27_3 && in_len == 0x14 && !out_len.

Notes, none blocking:

  • dcp_push_context() calls kmalloc(0x1144, GFP_ATOMIC) for every swap, and a failure sets crashed. A transient allocation failure then kills the display. One buffer in struct apple_dcp would remove both the per-frame allocation and this failure mode, if pushes are serialized.
  • The 0x40 shift, the zeroed 0x110 bytes and the 590 to 596 mapping are inferred, as the PR header says. The four swap completions in the earlier hardware comment ran on a tree before this rebase. A lit panel and brightness are not claimed.
  • The KUnit tests in iomfb_v27_3_test.c were built. I did not run them.

Not checked by me: any hardware run.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Follow-up to #1816 (27.3 DCP method table): offer XRGB on the panel primary with opaque X on 27.3.

What was wrong:
The K114c laptop panel primary (plane-2, id 48) offered AB4H AR30 AR24 AB24, no XRGB8888, because xrgb_is_alpha hid XRGB for firmware that blends X as alpha. The external pipe (id 35) already lists XR30 AR30 XR24 AR24 XB24 AB24. Hyprland 0.57.2 asks for XR24; aquamarine logs "GBM: XR24 not offered by the scanout plane, using AR24" and allocates AR24 while the monitor format stays XR24. Hyprland's CMontorState::ensureBufferPresent (src/output/Monitor.cpp:2585-2602) then substitutes the next swapchain buffer on every commit when the formats differ, so frame k draws into buffer j and the kernel shows buffer j+1: two frames late on the panel, every frame.

How it shows, measured (same session, same test, buffer memory read through a dma-buf mapping):

  • External DP-1 (XR24 buffers): the buffer on the plane holds the current frame, 34 of 34.
  • Laptop eDP-2 (AR24 buffers): the buffer on the plane holds the frame from two back, 34 of 34.
    Full trace: q13-hyprland.md in the lab notes. Software cursor, damage tracking off, external display off, and the driver hold band off change nothing; a bare GPU client (kmsgl, three linear ARGB buffers, page flip) shows the current frame 54 of 54, so the firmware and plain presentation are fine.

Fix (patch 0001 in this directory, against PR 1816 head ed4ec19):

  • apple_drv.c: on 27.3 (swap_v27_3, set where 27.3.0 compat is detected in dcp.c) the panel primary keeps the full list including XRGB8888, XR30, XB24; the T8142/H17G alpha guard stays for all other firmware.
  • iomfb_h17p.h/.c + iomfb.c: send the opaque-X enable as property 0x4f on 27.3, 0x49 elsewhere; the enqueue path skips pre-27 V_27_0 without the 27.3 table, and the present-complete path re-arms the opaque-X state on 27.3.
  • iomfb_h17p_test.c: KUnit case for both property ids (0x49 and 0x4f).
    Verified: drivers/gpu/drm/apple/ objects (including the KUnit test) compile clean against the PR 1816 tree on mesa-xbuild.

Camera test on the machine (a3l build, stock Hyprland, Main 20:27 CST): glass current on 121 of 121 screen changes, buffer read current 34 of 34, XRGB with X=0 stays white, 91 frames a second scrolling, 23.0 W idle (unchanged from before the fix).
15-minute run on the fix, all earlier workarounds off (Main 20:47 CST): glass current on 2987 of 2987 screen changes under stock Hyprland, 120 swaps a second reachable, idle 23.0 W against 23.2 W before (unchanged).
The 0x4f id is verified for 27.3 only: rtprops idx 79 of the 27.3 runtime property table (read from the 27.3 kernelcache) names enableGPAlphaDiv, and idx 73 names enableSBIM, which confirms 0x49 would be wrong on 27.3. Older firmware is untouched: pre-27 H17P keeps its 0x49 send, V_27_0 without the 27.3 table sends nothing, and the T8142/H17G alpha guard keeps hiding XRGB there.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Correction to my comment above. The "frames two updates late" symptom I described is not what a stock Hyprland does on such a plane: that lag came from our own downstream aquamarine patch (hyprwm/aquamarine#496, closed), which allocates AR24 when XR24 is missing so the desktop can start at all. Hyprland 0.57.2's ensureBufferPresent then assumes buffer format == monitor format and substitutes the next swapchain buffer on every commit. On a stock stack, a primary plane without XRGB8888 means Hyprland fails to start on that output ("GBM: Failed to allocate a GBM buffer: format XR24 isn't supported by primary backend"), not a two-frame lag. What stays valid: keep XRGB8888 on the primary (the 1816 fix does this with X opaque on 27.3), since without it the output either fails or needs a fallback like ours. Sorry for the wrong symptom description.

@RyanTheTide

Copy link
Copy Markdown
Contributor

We're focusing on the macOS 27.2 stub going forward, so please retarget this off the 27.3 beta (26C5035r). Please fill the T6050 27.2 DCP method table rather than the 27.3 beta one.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Agreed, the focus is 27.2. This PR stays draft and holds: the T6050 27.2 DCP method table needs values read on a T6050 machine running 27.2, which we do not have. Our machine runs the 27.3 beta and is down tonight, so no new reads come from us before it is back. We will fill the 27.2 table if a dump or a machine becomes available, or you may take the change over.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent]

The retarget is prepared as you asked. Outcome first: the 27.2 method table
in the driver needed no value changes. The layout we read from Apple's public
27.2.1 restore image for this board (T6050) matches what the 27.2 table
already had, method for method, so the retarget commit records that
confirmation instead of moving IDs. The 27.3 table stays in the branch
unchanged, so machines on the 27.3 beta keep working, and 27.2 is now the
table the read stands behind.

How the read went: static only, no hardware. We extracted the kernelcache
from the public signed 27.2.1 image for this model and read the framebuffer
and DCP-side classes: which methods exist, their layout, and how each
compares with the previous revision's 27.3 table. 107 of the 109 rows carry
over by method name; the addresses all move, as they do between any two
builds. The read also pins down why the 27.3 IDs sit one higher from
set_display_refresh_properties up: the methods 27.3 added there (the
fence-notify pair and the trace-source swap-wait parameter) do not exist in
27.2. Of the rows that do not carry: the fence-notify helper (row A521 in the
previous revision) has no 27.2 method, so it is dropped on retarget; the
vtable thunk row (A450) has no symbol in the 27.2 image, so it stays on the
offset basis.

What the read cannot show: tag values are registered by the firmware, not
stored in the kernelcache, and the swap request and reply sizes were measured
on a 27.3 boot. We have no 27.2 boot here, because our test machine runs the
27.3 beta. So the tags and swap sizes stay as the table had them until a 27.2
boot confirms them.

So a choice for you: merge on the static read now, or wait for a 27.2 boot by
someone who has one. On the static read, any tag the firmware sends that the
table lacks fails loudly in the boot log, as it does today, so a wrong or
missing entry cannot fail silently. Tell us which you prefer and we will post
accordingly.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Pull request 1816 boot checks for a 27.2 J775c (T6050) one-shot

Head to boot: 24893a3 (on
w86/dcp-27-3-tags; base integration/aurora 514ae1f). Nothing in the checks
below needs our tooling; dmesg and the panel are enough.

Preflight: the boot must run the DCP's own 27.2 firmware

The driver picks its method table from the firmware-compat the boot loader
hands it, so a boot through a 27.0 stub silently uses the 27.0 table and
proves nothing for 27.2. After the kernel is up, check what was handed over:

xxd /proc/device-tree/arm-io/dcp/apple,firmware-compat

Expected bytes: 0000001b 00000002 00000000 (the three u32s 27, 2, 0). If it
reads 27.0, stop and re-boot without the stub; the checks below only count
for a real 27.2.0 handoff.

Kernel log checks, in order

  1. Method table with every tag known. The driver checks at start-up: if any
    display method has no tag in the 27.2 table it refuses to start the
    display and names the first one. There is no per-tag success log, so the
    pass is silence plus a lit panel:

    dmesg | grep "DCP firmware-compat"
    

    Expect NO lines. Two failure lines exist:

    • "DCP firmware-compat 27.2.0 has no 27.x method table" (the compat was
      not recognized at all)
    • "DCP firmware-compat 27.2.0 not started: no ID known for N methods
      (first: X)" (a method has no tag; the display never starts)
  2. Tags the firmware sends that the table lacks. This is the one thing a
    static read cannot see, so it is the main thing to watch:

    dmesg | grep -E "received unknown callback|unqualified IOMFB callback"
    

    Expect NO lines. "received unknown callback Dxxx (in, out)" means the
    firmware sent a callback tag the table has no handler for. "unqualified
    IOMFB callback N (in, out)" means a callback arrived with sizes that do
    not match the table. Both crash the DCP shortly after; save the full
    dmesg if you see them.

  3. Swap request and reply sizes against 0xff4 and 0x6e0. This head pins the
    swap_submit request at 0xff4 bytes with the 0x6e0-byte swap payload at
    compile time, and on a 27.2.0 handoff it keeps exactly those sizes (the
    larger 27.3 shapes are gated to a 27.3.0 handoff only). If the 27.2
    firmware wanted other sizes, it shows as failed swaps, so:

    dmesg | grep "invalid IOMFB command envelope"
    

    Expect NO lines. A mismatch also lands in the check-2 lines with wrong
    in/out numbers. A clean run of check 2 and 3 together is the size
    verification.

What on screen counts as a pass

The internal panel lights during boot and stays up 10+ minutes with no
blanking or flicker; brightness controls respond; one sleep/wake cycle
returns the picture; desktop motion runs at full rate. If all four kernel
checks are silent and the panel holds, the head passes on this firmware.

If anything fails: save the whole dmesg and the exact byte read from the
preflight; do not retry with edits. The failure lines above are exactly the
report we need.

@satchlj

satchlj commented Nov 19, 2026

Copy link
Copy Markdown
Member

Claude Fable 5.2 on @satchlj's behalf. J775c (Mac Studio M5 Max) row for the 27.2 DCP method-table confirm requested here (regression request 64331ed1). System and handoff firmware 27.2 (26B123), one-shot boots, nothing installed.

Result: partly met, with a caveat about the tree.

  • This head with its own J775c DTB does not come up on this machine (no console, network or display; two attempts). Base 514ae1f predates arm64: dts: apple: port the boot-tested J775c compatibility layout #1619/arm64: dts: apple: support M5 Max Mac Studio (J775c) #2102, so t6050-j775c.dts there is the stub that leaves serial, PCIe/Ethernet, the display subsystem and both DCPs disabled. A control boot of our default kernel behind the same 27.2 display-enabled early stage came up clean, so the handoff stage is not the cause, and this is not a finding about the DCP changes.
  • The same unedited kernel image (head 24893a3) with the J775c DTB from arm64: dts: apple: support M5 Max Mac Studio (J775c) #2102 (4489ebd) boots, two runs:
    • Preflight apple,firmware-compat = 0000001b 00000002 00000000 on both DCPs.
    • dmesg | grep 'DCP firmware-compat': 0 lines.
    • dmesg | grep -E 'received unknown callback|unqualified IOMFB callback': 0 lines.
    • dmesg | grep 'invalid IOMFB command envelope': 0 lines (all three re-read at t = 779 s).
    • HDMI-A-1 2560x1440@59.95, held 621 s: 32/32 samples connected, enabled, DPMS On, no drops or retrains; a capture device on the HDMI output saw 2560x1440@60 throughout. 0 failed units. Warm return to the default was clean.
  • Not met: full-rate desktop motion. This head admits only the 26A428 GPU firmware, so with the 27.2 handoff there is no GPU; the desktop ran in software at about 3 fps and no page-flip rate was recorded.
  • Not run: sleep/wake retrain. s2idle is refused on J775c (the PCIe suspend path returns -EBUSY for this board) and there is no timed wake source, so it cannot be done unattended.

The same summary is on the regression claim. If a rebased head carrying the J775c DTB would be useful, we can repeat the row on it.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks to both of you: the J775c row covers the DCP half on 26B123 (HDMI 2560x1440 for 621 s, no dropped frames, compat 27.2.0), with this head paired with the #2102 J775c device tree.

To land it, the branch needs one refresh: its base 514ae1f is older than #1619 and #2102, and the PR is now conflicting. Could you rebase it (or merge current integration/aurora into it) once #2102 is in, and undraft it? The order we'd suggest is #2102, then this, then the GPU side.

The GPU on 27.2 is not covered here, since this head only admits the 26A428 GPU firmware. That part is already in review as #2185 (the 26B123 G17C firmware identity, stacked on #1650), so nothing new is needed for it.

satchlj and others added 4 commits November 19, 2026 08:49
Describe die-0 ATC0, ATC1 and ATC3 in the shared T6050 files using
acioN names and the integration ATC2 resource layout. ATC0/1/3
addresses and interrupts come from the retained J775c ADT description
(e579145cd); no open J716c display branch is a dependency.

Replace the disabled usb4_3_acio description with acio3 and update its
existing board references. Keep tunables, DROMs, PD endpoints and
activation in board files. Expose the existing acio2 to the other Max
boards disabled, preserving current J714c/J714s/J716c activation and
PCIe-tunnel wiring. The current integration driver foundations and
original authorship remain in ancestry.

Signed-off-by: Satya Benson <satya@benson.earth>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit cd3e03d)
Signed-off-by: Diljit Singh <hey@djdev.me>
Keep the required NHI DROM property on disabled shared instances. Existing board DROMs override the placeholder; no unit identity is embedded in the shared resource descriptions.

Signed-off-by: Satya Benson <satya@benson.earth>
(cherry picked from commit c88cd76)
Signed-off-by: Diljit Singh <hey@djdev.me>
Restore the adopted-host Clock PM policy from candidate44.
Integration boots J775c with this change alone; restoring bus-
number preservation alone does not return as a trial, and
restoring the NVMe driver alone does not return.

The host leaves CLKREQ# pads and reference-clock gating in
firmware state. Removing L0s/L1 capability bits does not mask
PCIE_LINK_STATE_CLKPM. Disable it before endpoint enable and walk
the enumerated bus to retain the policy.

Adapted from Satya Benson candidate44 PCIe adoption changes.
Tested on J775c with Aura b6e6faf4 and candidate44 DTB; other
boards untested.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
(cherry picked from commit ccdd14a)
Signed-off-by: Diljit Singh <hey@djdev.me>
Rebase Satya Benson's boot-tested M5 Max Mac Studio board series from
linux PR1619 onto current integration. Consolidate its incremental board
fixups and historical merge cleanups while retaining the original author,
copyright notices and compatibility contract.

Keep the one-die CPU/cache topology, board PCIe/N1/NVRAM/fan and USB/PD
wiring, installed-loader GPU paths/fallback, disabled MTP DART, three
ANE suppliers and omission of the desktop internal-panel DCP. Retain the
original disabled inventory and ANE trial wrapper without claiming new
hardware qualification.

Resolve the ANE binding against the current T8142/T8132 constraints:
retain the explicit T6050 backend/full-inventory distinction and known
0x210/0x220 platform types. Preserve K114c's active ATC2 guards in the
shared router definitions. Do not weaken the modern GPU binding; the
legacy-loader GPU warning gate remains visible.

The original PR1619 and its branch remain open and unchanged.
Source head: 0075a00.
Shared-router and Clock PM dependencies are separate preceding commits.

Based on the J775D board by Jeff Queisser and the single-die J716c work
by Erik Bourget; their foundations remain in integration ancestry.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr and others added 9 commits November 19, 2026 08:49
The shared T6050 router declarations default their status to disabled. J714s and J716c previously enabled their board-specific mailbox and router definitions implicitly, which now inherit the disabled property. Explicitly enable the six existing board nodes to preserve their prior effective status.

Signed-off-by: Diljit Singh <hey@djdev.me>
Run the production Clock PM helpers through root-bus and capability admission, locked and unlocked calls, PCI errors, host initialization failure and the adopted-link host gate. Reject mutations that change the mask or remove the gate. Document the rebase and the outstanding loader and hardware qualification limits.

Signed-off-by: Diljit Singh <hey@djdev.me>
Resolve the staged board descriptions into t6050-j775c.dts, retaining symbolic references and the final device policy. Remove all 18 board staging sources, including the separate unqualified ANE trial wrapper. The normal DTB is byte-for-byte identical before and after consolidation (SHA256 0fb4d76a761987bd91bd8680d2d7be5837f31989a1dc8c8b523446244bdf45f5). No hardware is newly enabled. Keep Satya Benson credited for the original board work and leave PR1619 unchanged.

Signed-off-by: Diljit Singh <hey@djdev.me>
Allow only the exact G17C, G17S, T6050 compatible sequence required by installed loaders, alongside the existing two-item G17C form. Keep the G17C handoff resource requirements and the single-compatible raw T6050 contract unchanged.

Exercise both forms and malformed compatibility, incomplete handoff and raw inventory cases against the production binding in the DT workflow. Update the J775c notes to distinguish this schema correction from the still-required hardware qualification.

Signed-off-by: Diljit Singh <hey@djdev.me>
…on tag

The 27.3 table held only the methods a macOS trace showed, so the driver
refused to start 27.3 firmware (iomfb_v27_missing_method). Fill it from the
tags the 27.3 kernelcache loads in IOMobileFramebufferAP and UnifiedPipeline2:
swap_start A456, swap_submit A458, set_display_device A461 and the rest,
each one above the 27.2 ID from A475 on.

The 27.3 swap_submit request is 0x1144 bytes, not 0xff4: the swap grew from
0x6e0 to 0x830 and the surfaces and tail are unchanged. Build it from the
27.0-shaped request at send time. The block from swap_id on moves up by 0x40
(inferred from the swap object init); the 0x110 bytes it gained beyond that
stay zero.

The intent-gated swap completion (27.0 D596, in 20 out 0) arrives as D590 on
27.3.

Tested on a 14-inch M5 Max MacBook Pro running macOS 27.3 firmware: all five
DCPs start, the internal panel connects and modesets, appledrm takes fb0.
A lit panel and swap completions are not yet confirmed. The KUnit test was
compiled, not run.
No evidence names A384 as dfb_ready_query. As in the 27.2 table, the
method has no 27.3 entry and boot_5() skips it.
@satchlj

satchlj commented Nov 19, 2026

Copy link
Copy Markdown
Member

Claude Fable 5.2 on @satchlj's behalf. J775c (Mac Studio M5 Max) row at the rebased head 40dfd87 (base f21ee13), booted once with the J775c device tree built from this exact tree, one-shot on the 27.2 handoff, nothing installed. The generated DTB is byte-identical to the #2102 one used in the earlier row. OS and system firmware both reported 27.2.

DCP and HDMI checks pass. GPU firmware is not admitted on this head.

Check Result
apple,firmware-compat / apple,firmware-version on both DCPs 27.2.0
DCP firmware-compat in dmesg 0 lines
received unknown callback|unqualified IOMFB callback 0 lines
invalid IOMFB command envelope 0 lines
HDMI-A-1 modeset 2560x1440, 60 Hz nominal
HDMI hold, on the machine 32/32 samples connected, enabled, on over 620 s; hotplug log count constant
HDMI hold, external capture 31/31 samples with signal at 2560x1440@60 over 680 s; no drops observed
Failed units 0
GPU driver rejected the 27.2.0 firmware image

Not run: full-rate desktop motion (no GPU on this handoff) and sleep/wake (suspend is refused on J775c). Console recorded; warm return to the default was clean.

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

Thanks for the rows, including the own-DTB J775c row on 40dfd87: 27.2.0 on both DCPs, clean dmesg checks, HDMI held 620 s, 0 failed units. That closes the 27.2 hardware question for this head. To be clear about what it covers: on a 27.2.0 handoff nothing in this PR runs. swap_v27_3 is false, and both the swap rewrite and the D590 remap sit behind it. So the J775c rows show 27.2 does not regress, plus #2102's DTB. They are not evidence for this change. What this PR does is make the 27.3 table pass the completeness gate, which admits 27.3 beta firmware.

Admission logic is fine as a shape: exact-string table plus completeness check, failing closed for unknown builds and incomplete tables. But the gate is structural, and several 27.3 entries are inferred: A516, A464/A465, the 0x40 swap shift with 0x110 zero bytes, and D590 → D596. Before 27.3 is admitted I'd want a 27.3 row on this head: lit panel, brightness up and down, a hotplug cycle, and the KUnit suite actually run (apple-dcp-v27-3).

Code changes:

  1. iomfb.c:1259-1268: no per-swap GFP_ATOMIC allocation with a sticky crashed on failure. Set in_len to DCP_V27_3_REQ_SIZE before the envelope check and build the request in place with dcp_v27_3_swap_req(out_data, data) instead of the memcpy at :1308. No allocation, no new failure mode.
  2. Put the request size and the callback remap into the per-build data that iomfb_v27_methods() returns, instead of a second strcmp in dcp.c:7036 and a version check in the core dispatcher (iomfb.c:2113).
  3. The rebase dropped 24893a3 (the 27.2 confirmation comment). Please restore it if the 27.2 static read is meant to stay on record.

Ordering: this branch carries a rebased copy of #2102's eight commits, so against integration/aurora the diff includes pcie-apple.c, the dt-checks workflow, bindings and the J775c DTS. Please land #2102 first, then rebase so this PR is only the drm files and the selftest mock. Your own commits came through the rebase byte-identical; I checked.

Since the 27.2 static read found no driver change needed for 27.2, this stays draft until we decide to admit the 27.3 beta and the 27.3 row above exists.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the rebase. One note on scope so expectations are right: on the 27.2 firmware our builds pin, this head is inert (swap_v27_3 stays false); what it changes is admitting 27.3. So it is not a 27.2 enabler, and it stays a draft until there is a 27.3 row. The order is unchanged: #2102 first, then this once 27.3 is shown working.

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.

4 participants