Repository navigation
drm/apple, soc: apple: drive the M3 Air (T8122) internal display on macOS 27.2 - #2688
Conversation
…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>
|
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.
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review of head a3b0fd4f0448c4602315397d3a3e95d75ada7158 against the pre-PR checklist.
What checks out
- DT & driver design:
arch/arm64/boot/dts/apple/t8122-dcp.dtsicleanly describesapple,bw-scratch = <&pmgr_dcp 0 5 0x908>;insidedisp-5(0x2d03d0000 + 0x4000,0x908 + 4 <= 0x4000) and passesdt-checks. Selection usesapple,t8122-dcpcompatible plus firmware UUID/version/compat (27.2.0) and PMPtunable-uuidwith no board/model gating; 14.x and 25G83 paths stay untouched. nomodeset/CONFIG_DRM_APPLEsafety: Withnomodeset,appledrm_register()exits early viadrm_firmware_drivers_only()andsimpledrmstays intact (ps_disp_*remain on).gate_t8122_dcpext()explicitly gates onCONFIG_DRM_APPLEandvideo_firmware_drivers_only().- Tests, attribution & CI: Both KUnit (
gate_t8122_pmp_image_27_2) andtools/testing/selftests/drivers/gpu/apple-dcp/boot.pycoverage are solid and pass CI (8/8 checks green). Diljit's three prerequisite commits from#2541preserve original authorship, DCO chain, and split notes; Ryan's three commits carry clean humanSigned-off-byonly; PR body ends withAssisted-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
-
Unmerged hard runtime dependency on
aurora-silicon/linux#2526:#2688targetsintegration/aurora, whileaurora-silicon/linux#2526is still OPEN (not inintegration/aurora).- As noted in the PR body, the T8122 27.2 DCP does not advertise the remote allocator endpoint (
0x2d). If#2688merges ontointegration/aurorabefore#2526, the display gate will admit T8122 27.2 PMP/DCP anddcp_check_firmware_version()will selectDCP_FIRMWARE_V_27_0, after which IOMFB start fails with-22(-EINVAL) on every 27.2 M3 Air boot (leaving it failing back tosimpledrmwith probe errors).#2526must land first.
-
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)underflowsresource_size(&slot) - 4to~0ULLifresource_size(&slot) < 4, bypassing the offset bounds check (andslot.start + offset/addr + 4/win->end + 1can wrap on malformed DT values). Addresource_size(&slot) < 4(matching line 5729) and overflow-safe range checks.
-
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.dtsiincludest8122-dcp.dtsi, so J504 (M3 MacBook Pro 14") sharesapple,t8122-dcpas well if its 27.2 image carries the same UUIDs.
- J613 (M3 Air 13") boot row is still open under "Still to run". Note also that
Non-blocking notes
- The J615 row notes two
AFK[ep:20]: failed to extract init props: -2lines 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>
|
Thanks. Pushed a3b0fd4..15bd86e (fast-forward):
Non-blocking: the two Testing at 15bd86e: W=1 clean on drivers/gpu/drm/apple/ with the fleet release config; |
DjDeveloperr
left a comment
There was a problem hiding this comment.
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:
#2526dependency: Cleanly merged at67f853fbin15bd86e3b113(verified identical diff to#2526vsintegration/aurora, no dropped hunks or conflict edits). Merge ordering can no longer break 27.2 T8122 IOMFB start.- 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) < 4prevents underflow on both sizes and guaranteesslot.start + offsetcannot wrapu64. addr < win->start || addr - win->start > resource_size(win) - 4checks the 4-byte slot[addr, addr + 3]inside[win->start, win->end]withoutaddr + 4orwin->end + 1wrap atU64_MAX.tools/asahi/dcp-bw-scratch-window-tests.pyextracts and compiles the productiondcp_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 bothold-checkandstart-onlymutations passing inhost-testsCI (458/458).
- Short-circuit
- Attribution & trailers (§4): All 14 commits carry human identity and
Signed-off-byonly; noCo-Authored-Byor 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+#252667f853fb) 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(), ifresource_size(win) < 4the-EINVALerror message logs&slotrather thanwin(harmless, malformed-DT refusal only).
Assisted-by: LLM (Google:Gemini 4 Neon)
|
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.
Host test |
|
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:
Follow-ups:
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. |
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
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 existingdisp-5window, the same shape as T8132.soc: apple: display: check a 27.2 DCP image by processor and imageanddrm/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.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
t6041-v27-admissionnow 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. Fullrun-host-tests.py: 451 jobs: 450 pass; the one failure (pmp-floor-tests --mutant class-twice) fails the same way onintegration/auroracc14570.apple-panel-blbacklight. 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
dcp_v27_method_table()half of 2739e5b (#2541), without the J773g armJ615 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).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: -2lines 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)