Repository navigation
drm/apple: complete the 27.3 DCP method table, swap size and completion tag - #1816
joshuaswarren wants to merge 6 commits into
Conversation
|
[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. |
5b12f19 to
d5f797b
Compare
|
[Joshua's agent]
|
|
[Joshua's agent] Fixed in 47550b7. You are right: the 27.3 table still had I dropped the entry. The 27.3 table now has no An earlier boot sent A384 without a crash. That shows only that the firmware accepts the tag, not that it is |
|
[Joshua’s agent] GREEN on 47550b7 The 27.3 table no longer maps |
|
[Joshua's agent] Without the PR (one boot): all five DCPs fail 1.8 to 1.96 s after boot. With the PR (one boot, 70 s of journal):
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:
|
|
[Joshua's agent]
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. |
47550b7 to
ed4ec19
Compare
|
GREEN on ed4ec19 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). |
|
GREEN on ed4ec19 What I checked at this head: Notes, none blocking:
Not checked by me: any hardware run. |
|
Follow-up to #1816 (27.3 DCP method table): offer XRGB on the panel primary with opaque X on 27.3. What was wrong: How it shows, measured (same session, same test, buffer memory read through a dma-buf mapping):
Fix (patch 0001 in this directory, against PR 1816 head ed4ec19):
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). |
|
[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 |
|
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. |
|
[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. |
|
[Joshua's agent] The retarget is prepared as you asked. Outcome first: the 27.2 method table How the read went: static only, no hardware. We extracted the kernelcache What the read cannot show: tag values are registered by the firmware, not So a choice for you: merge on the static read now, or wait for a 27.2 boot by |
Pull request 1816 boot checks for a 27.2 J775c (T6050) one-shotHead to boot: 24893a3 (on Preflight: the boot must run the DCP's own 27.2 firmwareThe driver picks its method table from the firmware-compat the boot loader Expected bytes: 0000001b 00000002 00000000 (the three u32s 27, 2, 0). If it Kernel log checks, in order
What on screen counts as a passThe internal panel lights during boot and stays up 10+ minutes with no If anything fails: save the whole dmesg and the exact byte read from the |
24893a3 to
ed4ec19
Compare
|
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.
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. |
|
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. |
ed4ec19 to
40dfd87
Compare
|
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.
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
left a comment
There was a problem hiding this comment.
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:
- iomfb.c:1259-1268: no per-swap
GFP_ATOMICallocation with a stickycrashedon failure. Setin_lentoDCP_V27_3_REQ_SIZEbefore the envelope check and build the request in place withdcp_v27_3_swap_req(out_data, data)instead of thememcpyat :1308. No allocation, no new failure mode. - Put the request size and the callback remap into the per-build data that
iomfb_v27_methods()returns, instead of a secondstrcmpin dcp.c:7036 and a version check in the core dispatcher (iomfb.c:2113). - 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.
|
Thanks for the rebase. One note on scope so expectations are right: on the 27.2 firmware our builds pin, this head is inert ( |
|
Note 🤖 zai/glm-5.3-flash responding on behalf of joshuaswarren All three code requests are implemented in candidate 7e62b62a18. The PR head has not changed yet.
Candidate checks: the host dispatcher passed 15,552 combinations and four remap cases. All four affected C objects compiled for arm64 with LLVM 22 and KUnit enabled, using a |
|
Thanks. The three code requests as described in candidate 7e62b62 match what was asked: the swap request is built in place with no per-swap allocation, the size and remap live in the per-build descriptor, and the 27.2 confirmation comment is back. We'll review the code itself once it is the PR head. Nothing else is needed from us right now. What's still missing:
Until that row exists this stays a draft, as you said. |
|
Note 🤖 OpenAI Codex responding on behalf of joshuaswarren Understood: after #2102 merges we rebase so the diff is only the drm/apple files and the selftest mock, push candidate |
|
At The startup host test now compiles and passes. All 35 lifecycle cases passed, including the two desktop modeset cases and the callback checks. The branch stays draft. The rebase still follows #2102. We have not run the 27.3 panel, brightness, hotplug or KUnit checks on this head. |
|
On integration/aurora 110861f the 27.3 table is still incomplete, so a 27.3.0 handoff is refused, and this is still needed for 27.3. The branch does not apply to 110861f: it still carries #2102's commits, and the tip moved the method-table check into A rebased copy is on this repository as Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches. Host tests (tools/asahi/run-host-tests.py --only) on 110861f plus this change: apple-dcp fails; dcpext26-startup-tests passes (1/1). |
…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.
… the 27.3 table comment
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.
Build the expanded swap directly in the command envelope. Keep its size and callback remap in the exact firmware build descriptor, with no allocation on the swap path. Restore the 27.2 static-read note and update the host fixtures. The startup check and all 35 lifecycle cases pass. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
337fdca to
52e3e96
Compare
|
Rebased onto the integration/aurora tip, f9d2146. Two changes on the way there:
Receipts after the rebase:
Same note as on #2089: 110861f, the tip you tested, is an ancestor of the current branch head f9d2146. If your tree is pinned at 110861f, say so and I will rebase onto it. |
[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).
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 newv27_j714smethod block and this change'sdcp->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.oandiomfb_v27.obuild on the 13-inch M1 MacBook at this head (gcc 16.1.1,W=1); the only warnings are two kernel-doc ones atdcp.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.