Skip to content

drm/apple, soc: apple: drive the M3 Air (T8122) internal display on macOS 27.2 - #2688

Merged
RyanTheTide merged 14 commits into
integration/aurorafrom
j615/t8122-dcp-27-2-standalone
Nov 22, 2026
Merged

RyanTheTide merged 14 commits into
integration/aurorafrom
j615/t8122-dcp-27-2-standalone

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

On macOS 27.2 (26B123) system firmware the M3 MacBook Air (T8122: J613, J615) internal display stays on the boot framebuffer (simpledrm). The display gate takes only the 14.x PMP image ("PMP not added: this Mac's PMP firmware image is C6CCB960-…, not 3B18C886-…"), and dcp_check_firmware_version() has no arm for the T8122 27.2 DCP image. With no DCP there is also no backlight device, so the panel cannot be dimmed or turned off from Linux. On a J615 that costs about 6 W at idle.

#2580 fixes this but is stacked on the J773g HDMI work (#2541, still a draft) and #2526. This PR carries only the T8122 part, directly on integration/aurora, with no board check.

Change

  1. drm/apple: dcp: take a bandwidth slot inside a described display window (Diljit's commit from drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend) #2541, unchanged except the trailers): the T8122 DT names its bandwidth scratch slot inside its existing disp-5 window, the same shape as T8132.
  2. soc: apple: display: check a 27.2 DCP image by processor and image and drm/apple: dcp: check a firmware-27 method table in one place: the generic halves of two drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend) #2541 commits (Diljit author). They contain no T8132 or J773g code and change nothing on their own. When drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend) #2541 is rebased onto this PR, these two commits drop out of it.
  3. The three T8122 commits from drm/apple, soc: apple: drive the M3 Air (T8122) internal display on macOS 27.2 #2580, unchanged: take the T8122 27.2 PMP image; describe the internal DCP's bandwidth slot (apple,bw-scratch); run the T8122 internal DCP on its 27.2 image (firmware-27 backend, 27.2 method table, live session adopted, 41-bit firmware DMA, no DPTX port services, two-entry clock table).

Behaviour is selected from the DCP block's compatible plus the firmware image the boot loader hands over (apple,firmware-uuid, firmware version/compat 27.2.0). Machine, board and SoC checks are not used. The 14.x image keeps its existing path.

Testing

  • Host tests: apple-dcp t6041-v27-admission now also checks the T8122 internal DCP: it is admitted on its 27.2 image only, and refused for its dcpext, another image, a missing or second UUID, 14.7.0, and 27.2.1. Mutation check: with the T8122 arm disabled the test fails. Full run-host-tests.py: 451 jobs: 450 pass; the one failure (pmp-floor-tests --mutant class-twice) fails the same way on integration/aurora cc14570.
  • J615 (M3 Air 15", macOS 27.2 stub, production Stage 2, the fleet kernel command line with no extra parameters): the panel comes up on appledrm (eDP-1, 2880x1800) with an apple-panel-bl backlight. Blanking it drops idle power from 9.5 W (simpledrm, panel always lit) to 2.8 W. s2idle passes 3/3 with the panel restored after each, Enforcing, 0 failed units. Needs drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 at runtime (see Still to run).

Still to run

Commit map vs #2580
this PR from
bandwidth slot inside a described display window 6c3f3e9 (#2541)
check a 27.2 DCP image by processor and image display.h half of 448669b (#2541), without the T8132 UUID
check a firmware-27 method table in one place dcp_v27_method_table() half of 2739e5b (#2541), without the J773g arm
take the T8122 macOS 27.2 PMP image 02faceb (#2580)
describe the internal DCP's bandwidth slot 3b8694a (#2580)
run the T8122 internal DCP on its macOS 27.2 image 17080b9 (#2580), boot.py harness adjusted for integration
J615 row detail

Kernel: the fleet kernel (integration b4cd7b3 plus the merged Air PRs, fleet release config) + #2526 (91f7e00) + these 6 commits. Stage 2 is the J615's production Stage 2, unchanged. Kernel command line: ro rootflags=subvol=root rhgb quiet loglevel=3 rd.udev.log_level=3 systemd.show_status=auto plymouth.ignore-serial-consoles panic=10 systemd.watchdog_sec=60 (no display, DCP or module parameters).

apple-t8122-display: PMP: this Mac's 61 values from /chosen/asahi,t8122-pmp on /soc/pmp@2d0500000
apple-drm display-subsystem: bound 28ec00000.dcp (ops dcp_comp_ops [appledrm])
apple-dcp 28ec00000.dcp: remote allocator not advertised; IOMFB endpoint advertised
card1-eDP-1 connected dpms=On modes=2880x1800, driver apple-drm
backlight apple-panel-bl max 500
state Total System Power (SMC), idle on AC
fleet kernel without this PR (simpledrm, panel lit, no backlight device) 9.5 W
this PR, backlight 0 + bl_power 4 2.84 W (12 x 5 s)
this PR, backlight at half 5.77 W (6 x 5 s)
this PR, blanked again 3.07 W (6 x 5 s)

s2idle with the PMU RTC (25 s): 3/3 (2 scripted, 1 manual: 26 s wall, wake IRQ = RTC), eDP connected and DPMS On after each, 0 DCP errors. Kernel error lines compared with the fleet kernel (including its s2idle): two AFK[ep:20]: failed to extract init props: -2 lines at DCP start (also on the #2580 stack), nothing else new. 0 kernel AVC denials, 0 failed units.

Assisted-by: LLM (Claude:Opus 5.5)

satchlj and others added 12 commits November 20, 2026 13:29
…es it

Firmware 27 lists the RTKit endpoints its application uses. The 27.2 DCP
on T8112 (MacBook Air M2, J413) advertises IOMFB (0x37) but no remote
allocator (0x2d). Starting the unadvertised endpoint fails, so the
internal panel never comes up.

Start the remote allocator on firmware 27 only when the firmware
advertises it. Firmware that advertises it is unchanged.

Signed-off-by: Satya Benson <satya@benson.earth>
…ounced

The 27.2 dcpext on T8112 (J413) neither announces its DPTX port at boot nor
gives powerlog-service and its other early services an EPIC class. On this
tree, dptxep_init() then failed with -ETIMEDOUT, the Type-C route muxes were
never registered, and both USB-PD controllers stayed deferred until the
deferred-probe timeout.

For a processor with the generic apple,dcpext compatible on firmware 27:
- treat the unannounced port as 14.7 and the J613 ext26 do: leave the
  endpoint up for a later announcement;
- accept the class-less init reports, as H17G and firmware-27 T8142 already
  do.

Signed-off-by: Satya Benson <satya@benson.earth>
The firmware-27 dcpext checks in afk_recv_handle_init() and dptxep_init()
looked up the "apple,dcpext" compatible on every call. Record it once in
dcp_platform_probe_pipe() as dcp->dcpext, next to the other per-processor
roles, and test the field.

The apple-dcp host suite's service-rebind unit compiles afk.c against a
model of struct apple_dcp with no device tree, so the OF call did not
build there (host.c: undeclared of_device_is_compatible). The model gets
the field, false: none of its scenarios is an external processor.
run.py --group all: 89/89.

Signed-off-by: Satya Benson <satya@benson.earth>
…pext

iomfb-startup-tests compiles iomfb_start_rtkit(), which now asks RTKit
whether firmware 27 advertises the remote allocator. Give the unit an
apple_rtkit_has_endpoint() with a switchable answer and run the matrix
both ways: firmware 27 starts the allocator only where it is advertised,
IOMFB in every case; H17P and the ext26 map are unchanged.

dcpext26-startup-tests compiles afk_recv_handle_init(); its struct
apple_dcp gets the dcpext field, true for its native dcpext (its
H17P firmware does not reach the firmware-27 check).

Signed-off-by: Satya Benson <satya@benson.earth>
… the ports on DPTX_ENDPOINT

On phellos (J413, macOS 27.2 stub) a USB-C monitor never came up: on
hotplug, dcpext 271c00000 logged "dcp_dptx_connect: dptx service for
port 0 not enabled" five times, then "Type-C DPTX reconnect failed after
5 retries: -19". At boot it had already logged "DPTX port 0 not
announced yet".

The 27.2 dcpext advertises RTKit endpoints 0x20-0x2c, 0x31 and 0x37,
so both DPTX endpoints. The driver opened firmware 27's
DPTX_ENDPOINT_V2 (0x2c) with no DPTX controller, as for the T6050
external profile, and the firmware announced nothing on it.

Like T8142's dcpext, which runs the same firmware-27 image beside its
internal DCP, it serves AppleDCPDPTXController on 0x24 and
AppleDCPDPTXRemotePort on DPTX_ENDPOINT (0x2a). Select both for a
T8112 dcpext on firmware 27; nothing else changes. Correct the comment
in dptxep_init() that took the silence for late announcement.

Tested on phellos (J413, 27.2, up4 kernel, this driver loaded as a
module in a watchdog-protected one-shot, no monitor attached):
- before: port 0 not announced on 0x2c;
- after: four controller services on 0x24 (dcpav- and
  dcpdp-controller-epic, units 0 and 1), then AppleDCPDPTXRemotePort on
  0x2a channels 1 and 3 with DPTX0/DPTX1 caps, no "not announced yet";
  internal panel connected, no new error lines.
Hotplug with a monitor is untested.

Signed-off-by: Satya Benson <satya@benson.earth>
…e firmware advertises

b7fbee4 opened the DPTX controller on DPTX_CONTROLLER_ENDPOINT (0x24)
and the ports on DPTX_ENDPOINT (0x2a) for "apple,t8112-dcpext" only. On a
J615 (T8122, "apple,t8122-dcpext") on the 27.2 stub nothing changed: "DPTX
port 0 not announced yet". With that compatible added, RyanTheTide's J615
opened AppleDCPDPTXController on 0x24 (channels 1, 3, 5, 7) and announced
both AppleDCPDPTXRemotePort services on 0x2a (channels 1 and 3) at boot:
the same layout as T8112's and T8142's dcpexts.

Select it by what the firmware advertises, not by a compatible: a dcpext
on firmware 27 whose RTKit endpoint map has both 0x24 and 0x2a gets the
controller and its ports there (dcp_v27_dptx_layout()).

The map is not known in dcp_platform_probe_pipe(), where b7fbee4 decided:
RTKit is woken only at bind (dcp_comp_bind()). So the choice moves to
dcp_start(), after the ext26 branch and before any DPTX endpoint opens;
the order in which the endpoints are opened is the one measured on J413
and J615.

Hardware data that names an endpoint keeps it, so no other processor
moves even if its firmware advertises both endpoints:
- T8142's dcpext already names DPTX_ENDPOINT, with the controller;
- the T6050 dcpext and the firmware-27 T6041 dcpext used firmware 27's
  default DPTX_ENDPOINT_V2 (0x2c), with no controller. Their hardware
  data now names it, so they open what they opened before. Whether they
  advertise 0x2a is not known here.
Internal processors, other firmware and ext26 are not affected.

tools/asahi/dcp-v27-dptx-layout-tests.py builds the production selector
and dptxep_init()'s endpoint expression over firmware, processor role,
advertised maps and pinned endpoints, checks that the selector tests no
compatible and runs in dcp_start() before the DPTX endpoints open, and
kills three mutations (no advertisement check, pinned endpoint ignored,
internal processors included).

Not tested on hardware: the J413 and J615 rows above were taken with
the compatible-keyed check; hotplug and modeset with a monitor are
untested on both.

Signed-off-by: Satya Benson <satya@benson.earth>
The T8132 device trees describe the PMC window that holds a DCP's
realtime bandwidth request slot as its last display window (disp-4, as
the ADT's dispN reg[4]), and apple,bw-scratch names that window's index
with the slot's node (dcpext0: 0x38282c000, 0x2c000 into it). The M4
backend reads it that way. The common path (dcp_get_disp_regs(), used by
the firmware-27 backend) only accepted a slot as a window of its own
right after the disp-N ones, so a firmware-27 T8132 dcpext failed to
bind with "Unexpected disp_reg value in 'apple,bw-scratch': 4".

Accept a slot whose index names an existing window when the slot lies
inside it: no window is added, and the scratch offset is taken relative
to that window, so map_reg hands the firmware the window it expects at
index 4 and the D003 reply carries the slot's address. Trees that
already worked are unchanged; they never named an existing index.

Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
apple_t6041_dcp_any_v27_2() decides whether the boot loader handed a
display processor over on the macOS 27.2 (26B123) image: the processor's
compatible, its one firmware-uuid, and firmware version and compatibility
27.2.0 as aura writes them from the ADT. Only the image UUID is T6041's.

Split the check into apple_dcp_image_v27_2(np, compatible, image), which
takes the image as an argument, and keep the T6041 helpers as wrappers so
the next processor on 27.2 only names its own image.

No functional change.

Split out of "soc: apple: display: recognise the T8132 macOS 27.2 DCP image".

Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
dcp_check_firmware_version() admits a firmware-27 display processor in
two places (a processor whose hw data pins firmware 27, and the T6041
ones on the 27.2 image), and each repeats the same two checks: that
firmware-compat has a 27.x method table, and that the table has an ID
for every method the driver calls, since the firmware panics on an
unknown tag.

Move both checks into dcp_v27_method_table() so the next processor on a
27.x image calls it instead of a third copy. The messages are unchanged.

No functional change.

Split out of "drm/apple: dcp: run the J773g dcpext on firmware 27.2 with
the 27.2 table".

Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On the macOS 27.2 (26B123) system firmware the boot loader passes the
T8122 PMP values with tunable-uuid C6CCB960-AC83-34A2-9493-C3131BD5AE4B,
the PMP image of that release. The gate takes only the 14.x image
(3B18C886-...), so on a 27.2 MacBook Air (J613/J615) it stops with
"PMP not added: this Mac's PMP firmware image is C6CCB960-..." and the
internal display stays on the boot framebuffer.

Take the 27.2 image as well. The PMP description is the device tree's
own and the soc-device records come from the boot loader's values; the
PMP report driver checks the running image in SRAM against the image
the values name before it starts the PMP, so the same support serves
both images.

Add a KUnit case for the 27.2 image beside the one that refuses the
T6031 image.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The firmware-27 backend answers the DCP's realtime bandwidth request
with the address of its slot in the PMGR bandwidth page, and refuses
to bind a DCP whose device tree names none ("Incompatible devicetree").
The T8122 internal DCP already lists that page as its disp-5 range;
its slot is at 0x908 (the T8122 ADT; dcpext's is 0x910, already
described).

Name it with apple,bw-scratch on the internal DCP, inside its disp-5
window. The 14.x paths do not read it.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On the macOS 27.2 (26B123) system firmware the boot loader hands the
T8122 (M3 MacBook Air) internal DCP over running the 27.2 image
93FA4B31-BB97-3B2A-8673-49EA489EE9C1, firmware version and
compatibility 27.2.0. dcp_check_firmware_version() has no arm for it:
it falls through to the 14.7 board record and stops, so the panel stays
on the boot framebuffer.

Select the firmware-27 backend with the 27.2 method table for an
apple,t8122-dcp handed over on that image (apple_t8122_dcp_v27_2(), by
processor and image as the T6041 and T8132 checks are), and give it
the internal-panel profile the T6041 27.2 internal DCP uses: adopt the
live session, 41-bit firmware DMA (its DART window is
0x100_0000_0000 + 64 GiB), no DPTX port services (dcpext drives the
ports). The T8122 /arm-io/disp0 names the same two provider clocks as
the T6041 one (345 at 712 MHz, the device tree's disp0 clock, and 416
at 0 Hz), so it takes the same two-entry clock table when the boot
loader publishes no apple,clock-ids.

The 14.x image keeps the native 14.7 path and the 25G83 profile; they
neither match the 27.2 image nor read these settings.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

More J615 rows, now on a fleet kernel that carries this PR together with #2526 (integration cc14570 plus the ready Air PRs). Command line, Stage 2 and DT are unchanged from the first row.

  • Three cold one-shot boots plus one configured boot: the panel comes up on appledrm every time (eDP-1, 2880x1800), and apple-panel-bl is present.
  • Idle on AC: 2.78-2.84 W with the backlight at 0 and bl_power 4, and 5.6 W at half brightness.
  • s2idle with the PMU RTC: 6/6, with eDP connected and DPMS On after each resume and 0 DCP errors.
  • Enforcing, 0 failed units, 0 AVC denials, 0 oops.
  • Keyboard, trackpad, Wi-Fi and the CPU thermal zones are unaffected.

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

Adversarial review of head a3b0fd4f0448c4602315397d3a3e95d75ada7158 against the pre-PR checklist.

What checks out

  • DT & driver design: arch/arm64/boot/dts/apple/t8122-dcp.dtsi cleanly describes apple,bw-scratch = <&pmgr_dcp 0 5 0x908>; inside disp-5 (0x2d03d0000 + 0x4000, 0x908 + 4 <= 0x4000) and passes dt-checks. Selection uses apple,t8122-dcp compatible plus firmware UUID/version/compat (27.2.0) and PMP tunable-uuid with no board/model gating; 14.x and 25G83 paths stay untouched.
  • nomodeset / CONFIG_DRM_APPLE safety: With nomodeset, appledrm_register() exits early via drm_firmware_drivers_only() and simpledrm stays intact (ps_disp_* remain on). gate_t8122_dcpext() explicitly gates on CONFIG_DRM_APPLE and video_firmware_drivers_only().
  • Tests, attribution & CI: Both KUnit (gate_t8122_pmp_image_27_2) and tools/testing/selftests/drivers/gpu/apple-dcp/boot.py coverage are solid and pass CI (8/8 checks green). Diljit's three prerequisite commits from #2541 preserve original authorship, DCO chain, and split notes; Ryan's three commits carry clean human Signed-off-by only; PR body ends with Assisted-by:.
  • J615 evidence: Strong regression and power data on stock cmdline (4 boots, eDP-1 2880x1800, apple-panel-bl, 9.5 W -> 2.8 W blanked, s2idle 6/6, Enforcing, 0 AVC denials, 0 failed units).

Blockers

  1. Unmerged hard runtime dependency on aurora-silicon/linux#2526:

    • #2688 targets integration/aurora, while aurora-silicon/linux#2526 is still OPEN (not in integration/aurora).
    • As noted in the PR body, the T8122 27.2 DCP does not advertise the remote allocator endpoint (0x2d). If #2688 merges onto integration/aurora before #2526, the display gate will admit T8122 27.2 PMP/DCP and dcp_check_firmware_version() will select DCP_FIRMWARE_V_27_0, after which IOMFB start fails with -22 (-EINVAL) on every 27.2 M3 Air boot (leaving it failing back to simpledrm with probe errors). #2526 must land first.
  2. Unsigned underflow in dcp_get_bw_scratch_in_window() (drivers/gpu/drm/apple/dcp.c:5555):

    • if (offset > resource_size(&slot) - 4 || addr < win->start || addr + 4 > win->end + 1) underflows resource_size(&slot) - 4 to ~0ULL if resource_size(&slot) < 4, bypassing the offset bounds check (and slot.start + offset / addr + 4 / win->end + 1 can wrap on malformed DT values). Add resource_size(&slot) < 4 (matching line 5729) and overflow-safe range checks.
  3. Hardware coverage across affected T8122 Macs (Checklist §1 & §5):

    • J613 (M3 Air 13") boot row is still open under "Still to run". Note also that t8122.dtsi includes t8122-dcp.dtsi, so J504 (M3 MacBook Pro 14") shares apple,t8122-dcp as well if its 27.2 image carries the same UUIDs.

Non-blocking notes

  • The J615 row notes two AFK[ep:20]: failed to extract init props: -2 lines at DCP start (already present on #2580); confirm these are harmless/tracked so "0 new kernel errors" is clear.

Assisted-by: LLM (Google:Gemini 4 Neon)

dcp_get_bw_scratch_in_window() computed resource_size(&slot) - 4, which
wraps for a range under 4 bytes and then lets any offset through, and
compared addr + 4 with win->end + 1, which wraps for a window that ends
at the top of the address space. Refuse a range or a window under 4
bytes first, then compare offsets inside each instead of end addresses.

tools/asahi/dcp-bw-scratch-window-tests.py runs the function over the
J615's slot, the last 4 bytes of a window, one byte past, 2-byte ranges
and windows, a slot straddling the window end and a window at the top
of the address space. The old check and a start-only window check both
fail it.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…15/t8122-dcp-27-2-standalone

The T8122 27.2 DCP advertises no remote allocator endpoint. Without
#2526 its IOMFB start fails on every 27.2 boot, so this branch carries
it and can no longer land without it.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Thanks. Pushed a3b0fd4..15bd86e (fast-forward):

  1. drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 dependency. 15bd86e merges drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 at its trailer-clean head 67f853f. The merge was clean. This branch can no longer land without the advertised-endpoint handling, so the order problem is gone. (drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 has our no-blockers re-review and still needs your verdict; landing it first also works.)

  2. Unsigned wrap in dcp_get_bw_scratch_in_window(). Fixed in bae1fb7. It now refuses a PMGR range or a window under 4 bytes before subtracting, then compares offsets inside each one instead of end addresses, so a window that ends at the top of the address space can't wrap either. tools/asahi/dcp-bw-scratch-window-tests.py runs the production function over:

    • the J615's slot (0x908 in disp-5);
    • the last 4 bytes of a window, and one byte past;
    • 2-byte ranges and windows;
    • a slot that straddles the window end;
    • a window at the top of the address space.

    The old check and a start-only window check are both run as mutations and both fail. The same function is carried in drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend) #2541's stack (6c3f3e9), which still needs this fix when it lands.

  3. J613 / J504 rows. Neither is in our lab. The selection is per image (the T8122 27.2 DCP UUID/version/compat plus the PMP tunable UUID), with no board check. A J613 or J504 on 26.x or 25G83 stays on its old path, and the boot.py selftests cover that. A J613 on the 27.2 stub needs an owner row; we'll ask for one.

Non-blocking: the two AFK[ep:20]: failed to extract init props: -2 lines have been there on every T8122 27.2 DCP start since #2580. The panel, backlight and DPMS rows are unaffected, and those lines are not counted in "0 new kernel errors" (that compares against the same kernel without this change). I've noted them as a follow-up.

Testing at 15bd86e: W=1 clean on drivers/gpu/drm/apple/ with the fleet release config; dtbs_check adds nothing on t8122-j615/j613; full host suite 457/458 (the one failure is the known pmp-floor-tests --mutant class-twice failure, which also fails on the tip). The J615 production default (fleet79) has run a3b0fd4 + #2526 67f853f since this morning: panel, backlight, DPMS, Enforcing, 0 failed units. bae1fb7 only changes the malformed-DT refusals, and the J615's slot passes the new check (it's one of the test cases).

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

Re-reviewed at 15bd86e3b113 (a3b0fd4f..15bd86e3b113) against the pre-PR checklist. All blockers from the prior review are resolved and CI is 8/8 green:

  1. #2526 dependency: Cleanly merged at 67f853fb in 15bd86e3b113 (verified identical diff to #2526 vs integration/aurora, no dropped hunks or conflict edits). Merge ordering can no longer break 27.2 T8122 IOMFB start.
  2. Unsigned wrap in dcp_get_bw_scratch_in_window() (bae1fb78): Audited for overflow/underflow, off-by-one, signed/unsigned mismatch, and uninitialized state:
    • Short-circuit resource_size(&slot) < 4 || offset > resource_size(&slot) - 4 || resource_size(win) < 4 prevents underflow on both sizes and guarantees slot.start + offset cannot wrap u64.
    • addr < win->start || addr - win->start > resource_size(win) - 4 checks the 4-byte slot [addr, addr + 3] inside [win->start, win->end] without addr + 4 or win->end + 1 wrap at U64_MAX.
    • tools/asahi/dcp-bw-scratch-window-tests.py extracts and compiles the production dcp_get_bw_scratch_in_window() with -Wall -Werror -fsanitize=address,undefined, covers the J615 slot, boundary/off-by-one, <4-byte slot/window, straddling, and top-of-address-space cases, and runs with both old-check and start-only mutations passing in host-tests CI (458/458).
  3. Attribution & trailers (§4): All 14 commits carry human identity and Signed-off-by only; no Co-Authored-By or AI trailers in commits.

Non-blocking follow-ups

  • J613 (M3 Air 13") 27.2 owner row: Selection is strictly firmware-UUID/version/compat driven with no board check and J615 production default (a3b0fd4f + #2526 67f853fb) is proven with panel, backlight, DPMS, s2idle, Enforcing, and 0 failed units; tracking a J613 27.2 owner row as follow-up is fine.
  • Minor nit: in dcp_get_bw_scratch_in_window(), if resource_size(win) < 4 the -EINVAL error message logs &slot rather than win (harmless, malformed-DT refusal only).

Assisted-by: LLM (Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J615 (M3 Air 15, T8122, macOS 27.2 firmware) row at head 15bd86e: PASS.

Kernel: the fleet79 test set with this head merged in (plus #2526 @ 67f853f, which the head already contains). Default kernel command line, no module parameters, default boot chain (aura main + tree DTB), kernel-only one-shot.

  • appledrm binds the internal DCP: eDP-1 connected, 2880x1800@60, inherits the boot framebuffer.
  • Backlight apple-panel-bl works: blank (actual 0, bl_power 4) and half brightness (actual 153).
  • s2idle 2/2 with the PMU RTC wake: 0 DCP/DART errors, eDP still connected and on after resume.
  • 0 oops, 0 failed units, SELinux enforcing, 0 AVC. Kernel error lines are the same set as the current fleet kernel (none from DCP beyond the existing AFK[ep:20]: failed to extract init props: -2).
  • The external DCP stays disabled ("boot loader did not reserve its firmware"), as expected without the boot-loader hand-over.

Host test tools/asahi/dcp-bw-scratch-window-tests.py passes on the merged tree, including the unsigned-wrap case.

@RyanTheTide
RyanTheTide merged commit b241e35 into integration/aurora Nov 22, 2026
8 checks passed
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Post-merge adversarial read of the 7 commits this PR adds (not #2526's own): no blockers. Three follow-ups are worth doing, plus two nits.

What holds up:

  • Other SoCs: the new in-window path in dcp_get_bw_scratch_reg() runs only when 0 < disp_idx < count. Every existing apple,bw-scratch user names idx == count and takes the old path unchanged. Trees with idx < count failed probe before this PR.
  • Every T8122 behaviour change is guarded by apple_t8122_dcp_v27_2() or by firmware 27 + apple,t8122-dcp. The clock fallback lives only in the v27 metadata path.
  • After bae1fb7 the window check has no wrap. dcp-bw-scratch-window-tests.py passes, and its old-check / start-only mutants fail.
  • No new parameters or delays, and no binary-RE provenance in comments.

Follow-ups:

  1. include/linux/soc/apple/display.h apple_t8122_dcp_v27_2() selects one image by UUID + exact version + compat 27.2.0. It follows the T6041/T8132 precedent and fails safe (UNKNOWN keeps the boot framebuffer), but it is an image allow-list, and a3b0fd4 doesn't say why firmware-compat alone (which already picks the method table through dcp_v27_method_table()) is not enough. Either justify the narrower match or select on compat + method-table presence.
  2. display-gate admits the 27.2 PMP image. The cited safeguard, apple_pmp_start_check_sram(), checks the SRAM image against the boot loader's tunable-uuid. It does not show that the PMP v2 report layout (written for 14.x) holds for the 27.2 image. A trace of the 27.2 report records from the J615 would close this. I'll post one.
  3. firmware_dma_bits = 41 on apple,t8122-dcp is correct, but the DT already describes the window (apple,dma-range on dcp_dart), so it could be derived instead of hardcoded (same as T6041 today).

Nits: the clock fallback's second entry is implied rather than described. When the window itself is under 4 bytes, the error message names the slot instead of the window.

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