Repository navigation
drm/apple: complete the 27.3 DCP method table, swap size and completion tag - #1816
joshuaswarren wants to merge 11 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). |
|
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 ( |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
Verdict: FINISH, then merge at de818a2e
Blockers:
- Hard-rule break (tool attribution in commits
90be2496andfa93e2ed): both commits carry tool-generation and tool co-author lines. Recreate/amend cleanly so commits carry only human author metadata and humanSigned-off-by(never force-push a shared branch). - Queued CI checks are still pending at
de818a2e. - Missing exact-head
de818a2ehardware boot row on K114c (macOS 27.3 beta) plus a non-27.3 regression boot row.
Checked:
- Reviewed commit history,
mainmerge (de818a2e), and 27.3 DCP method table / swap layout changes across 13 files (+285/-56,MERGEABLEonmain).
Evidence
- Head:
de818a2e(base: main,mergeable: MERGEABLE,+285/-56across 13 files).
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
erikwb
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at de818a2e
Blockers:
drivers/gpu/drm/apple/iomfb_v27.c:197and:272anddrivers/gpu/drm/apple/iomfb_v27_3_swap.h:4carry implementation-specific citations and unrelated method details. Remove those details from the source, commit messages and PR description. Keep the IDs and layouts the driver needs, with public wire evidence for the required method IDs and swap fields. In particular, show the fields the driver actually writes in the enlarged swap request before admitting this ABI.- Commits
90be2496andfa93e2edcontain extraneous attribution. Those two and the first five change commits also lack the author's sign-off. Preserve authorship and provide a signed series with clean trailers. - Add a 27.3 hardware row at the final head showing a lit panel, brightness changes, working flips and hotplug, plus a regression row on an earlier ABI. The existing 27.3 boot used an older revision and sent an extra startup call. The J775c 27.2 row exercised the earlier wire format.
Checked: The DCP's apple,firmware-compat property selects the wire ABI through the existing table lookup. The change adds no board gate or new knob. Latest build, host tests and PR text checks passed. The text changes merge cleanly with main.
Evidence
- Compared the full patch with
mainat219311530ef0. The changed files merge cleanly and no patch ID matched the candidate commits touching those paths.mainhas the partial traced 27.3 table and still refuses it at admission. It has neither the enlarged swap request nor this callback translation. The 27.2 D590 no-op in #1646 is a separate change. Comparison against main. - The rows in the new table map driver operations to wire IDs. I found no pasted listing or wholesale symbol table in the patch. The admission check establishes that required slots are populated. It cannot validate the inferred A516 and A464/A465 assignments, and the byte-copy test only checks the proposed layout. The J716s report specifically calls the brightness offsets into question. Can a wire capture of a brightness change confirm the offset and a swap trace confirm that D590 completes the pending swap? Also reconcile the dropped A385 with the J716s startup trace. The comment saying 27.2 omits that method is stale.
- The request expansion runs after the size is selected and writes directly to the checked command buffer. The callback translation requires both expected lengths. The existing sleep method completeness check still keeps the incomplete sleep sequence disabled.
|
Point-by-point answers to the open review threads (w86, holding this row): @DjDeveloperr (FINISH verdict, before-it-merges list):
@aurora-silicon-review[bot]:
One unit of work, one push: (a) selftest update, (b) commit rewrite (attribution + sign-offs), (c) citation strip. Hardware legs and the 27.3-admission decision stay held as above. |
…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. Signed-off-by: Joshua Warren <[email protected]>
… the 27.3 table comment Signed-off-by: Joshua Warren <[email protected]>
…able does Signed-off-by: Joshua Warren <[email protected]>
Signed-off-by: Joshua Warren <[email protected]>
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. Signed-off-by: Joshua Warren <[email protected]>
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 <[email protected]>
… in the v27 prelude The per-build method table puts struct iomfb_v27_build (u16 fields) and iomfb_v27_methods() (DCP_V27_3_REQ_SIZE, ARRAY_SIZE) inside the spans the admission units extract. The synthetic prelude declared none of them, so t6041-v27-admission and t8122-dcpext-v27-admission stopped compiling. Pull the DCP_V27 sizes from iomfb_v27_3_swap.h the way the prelude already pulls the firmware UUIDs from display.h, and add u16 and ARRAY_SIZE to the stand-ins. Signed-off-by: Joshua Warren <[email protected]>
v27-tag-translation extracts the same iomfb.h methods span and the v27 builds table as the admission units, so it needs u16 and the DCP_V27* sizes too. dcpext26-startup-tests keeps upstream's pending_acks member the apple_dcp stub was extended with. Signed-off-by: Joshua Warren <[email protected]>
dcp_firmware_27_pin_precedence still expected firmware-compat 27.3.0 to be refused on T6030 and T8142, but the completed 27.3 method table makes dcp_v27_method_table() admit it. Expect DCP_FIRMWARE_V_27_0 instead; 27.1 keeps covering the unlisted-version refusal. Signed-off-by: Joshua Warren <[email protected]>
…eader Keep the method IDs, the table deltas and the swap field layout the driver needs; drop the image, trace and kernelcache derivation narrative from the comments (review: erikwb, aurora-silicon#1816). Signed-off-by: Joshua Warren <[email protected]>
de818a2 to
e0c1fd7
Compare
|
Force-pushed
|
There was a problem hiding this comment.
Verdict: REQUEST CHANGES at e0c1fd74
Blockers:
- Binary/kernelcache provenance still remains in commit
28c31caband the PR description (hard rule + prior review blocker #1). Commite0c1fd74stripped the source comments iniomfb_v27.candiomfb_v27_3_swap.h, and the tool-attribution /Signed-off-bytrailers were cleaned, but both commit28c31caband the PR body still cite the27.3 kernelcache(IOMobileFramebufferAPandUnifiedPipeline2) and"inferred from the swap object init". Rewrite the commit message and PR description to remove those derivations and rely strictly on public wire/runtime evidence for the required method IDs, swap fields, andD590completion tag. Also reconcile the droppeddcpep_dfb_ready_query(A385) against the J716s 27.3 trace and fix the stale comment atdrivers/gpu/drm/apple/iomfb_v27.c:265("dfb_ready_query has no entry, as in the 27.2 table"—dcp_methods_27_2actually definesIOMFB_METHOD("A385", dcpep_dfb_ready_query)at line 219). - Branch is
CONFLICTINGwithmain, causing all build/test CI workflows to skip. Ate0c1fd74,Host tests,Apple DRM KUnit, andApple build and KUnitall completed asskippedbecause the PR cannot merge cleanly intomain. Resolve the merge conflict so the PR isMERGEABLEand full CI passes. - Unresolved intermittent
SIGSEGV(~1 in 3 runs) in the host boot test binary. The latest comment notes that the generated host binary segfaults intermittently onrun.py --group boot; investigate and confirm this is not introduced or triggered by thestruct iomfb_v27_build/ selftest prelude updates before merge. - Missing exact-head hardware verification at
e0c1fd74. No exact-head hardware rows have been posted yet: a 27.3 Mac row (lit panel, brightness up/down, working flips, hotplug cycle, andapple-dcpKUnit pass) plus a non-27.3 regression row (e.g., 27.2) remain open, alongside the project decision on admitting 27.3 beta firmware.
Checked:
- All 11 commit messages and trailers at
e0c1fd74(verified tool-attribution lines removed and humanSigned-off-bypresent; found remaining binary provenance text in28c31caband PR body). - Full diff (
13files,+270/-58):drivers/gpu/drm/apple/dcp.c,iomfb.c,iomfb_v27.c,iomfb_v27_3_swap.h, KUnit tests, andtools/testing/selftests/drivers/gpu/apple-dcp/. - Live workflow runs at
e0c1fd74:pr-readinesspassed;Host tests,Apple DRM KUnit, andApple build and KUnitwere allskippeddue toCONFLICTINGmerge state.
Evidence
drivers/gpu/drm/apple/iomfb_v27.c:219definesIOMFB_METHOD("A385", dcpep_dfb_ready_query)indcp_methods_27_2, contradicting the added comment ondcp_methods_27_3at line 265 ("dfb_ready_query has no entry, as in the 27.2 table.").dcp_push_context()(iomfb.c:1289-1332) expandsDCP_V27_REQ_SIZE(0xff4) ->DCP_V27_3_REQ_SIZE(0x1144) in place viadcp_v27_3_swap_req()with no per-swap allocation, anddcpep_handle_cb()(iomfb.c:2149-2153) remaps callback590 -> 596only whenin_len == 0x14andout_len == 0.- Workflow runs at
e0c1fd74:46500342472(Host tests: skipped),46500342468(Apple DRM KUnit: skipped),46500342584(Apple build and KUnit: skipped),46500342959(pr-readiness: success).
What
Completes the macOS 27.3 DCP method table, swap_submit payload size, and swap-completion callback tag from the 27.3 kernelcache (
IOMobileFramebufferAPandUnifiedPipeline2) so the driver can start 27.3 firmware:swap_startA456,swap_submitA458,set_display_deviceA461,is_main_displayA462,set_digital_out_modeA463,set_matrixA473,get_color_remap_modeA477,set_parameter_dcpA500, power state A535, and the remaining entries (eight IDs are +1 above 27.2 from 27.2 A525 onward).swap_submitis 0x1144 bytes (0xff4 on 27.0; swap grew from 0x6e0 to 0x830), built from the 27.0-shaped request at send time.dfb_ready_queryhas no 27.3 entry (as in 27.2);boot_5()skips it. The 0x40 swap-field shift fromswap_idonward, A516first_client_open, and D590 are inferred from sizes and offsets.Tested
/sys/class/backlightappeared, and swap completions were measured.dcp.o,iomfb.o,iomfb_v27.o) on a 13-inch M1 MacBook with gcc 16.1.1 (W=1): built with only two pre-existing kernel-doc warnings atdcp.c:715. KUnit test built.Risk
two-way · Macs running macOS 27.3 DCP firmware (tested only on 14-inch M5 Max K114c with 27.3 beta 26C5035r).
Not yet
This rebased head has not been booted on hardware. A lit panel, brightness control, the KUnit/selftest run, macOS 27.2, and other 27.3 Mac models have not been verified yet.