Skip to content

drm/apple: dcp: take a firmware-placed live OSLog buffer sized in bytes - #3689

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/dcp-live-fw-oslog
Dec 1, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/dcp-live-fw-oslog

Conversation

@satchlj

@satchlj satchlj commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

dcp_rtkit_live_parse() requires a firmware-placed (is_mapped == 1) buffer in apple,rtkit-buffers to be whole 4 KiB pages. That holds for crashlog, syslog and IOReport, which RTKit requests in pages, but OSLog states its size in bytes and only its address in pages. That is how RTKit itself takes an inherited OSLog buffer over (apple_rtkit_inherit_buffers()), and the binding describes the cell as a size in bytes.

The T6050 external DCPs' firmware places its own OSLog buffer of 0x5ff8 bytes (rtkit(dcp): pre-allocated oslog buffer (dva 0x100039b4000, ..., size 0x5ff8) in the boot stage's log). On the M5 Max Mac Studio (J775c), with Stage 2 handing dcpext0 (HDMI) over running, the adoption failed with no hint of which tuple was refused:

apple-dcp 2b2e00000.dcp: error -EINVAL: Invalid live RTKit handoff
apple-dcp 2b2e00000.dcp: external display processor unusable (bind failed: -22); the other displays go on without it

This takes a firmware-placed OSLog buffer of any size at a 4 KiB-aligned address. The other endpoints and loader-allocated buffers keep their rules, and every buffer must still lie in one of the DCP's no-map carveouts. A refused tuple is now named in the log.

The boot-stage side, aurora-silicon/aura#605, gives that OSLog buffer the no-map carveout the binding requires (it had none, which would have failed the next check with -EACCES). Both are needed for the J775c handoff.

Stacked on #3686.

Tested: arm64 build of the J775c trial config at the PR head (no new warnings in drivers/gpu/drm/apple). KUnit apple-dcp-handoff on arm64 QEMU with 16K pages (CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST): 3/3 pass at the PR head; with only dcp.c reverted to the base, dcp_handoff_live_rtkit_buf_valid fails on the J775c OSLog tuple (dcp_rtkit_live_buf_valid(8, 0x100039b4000, 0x5ff8, 1) false), as on the boot above. On hardware: J775c with main + #3686 + this head + #3682 and aura#605's Stage 2 has booted about 30 times since Nov 30 on the default command line: no Invalid live RTKit handoff, the dcpext0 DCP binds (bound 2b2e00000.dcp), and HDMI shows the console and the greeter.

Regression: J773g (M4) boot of this head: DCP OSLog carve-outs reserved, display connected, 0 failed units (#3686 (comment)).

Not yet: nothing.
Risk: two-way door. Only widens what a firmware-placed OSLog entry of a live DCP handoff may give as its size; other entries, and DCPs without a live handoff, are unchanged.

dcp_rtkit_live_parse() requires a firmware-placed (is_mapped == 1)
buffer to be whole 4 KiB pages. That holds for crashlog, syslog and
IOReport, which RTKit requests in pages, but OSLog states its size in
bytes and only its address in pages, which is how RTKit itself takes an
inherited OSLog buffer over (apple_rtkit_inherit_buffers()) and how the
binding describes the cell.

The T6050 external DCPs' firmware places its own OSLog buffer of 0x5ff8
bytes. A boot stage that hands such a DCP over running describes it as
it is, and the adoption failed with a bare "Invalid live RTKit
handoff" (-EINVAL), leaving the display processor unbound.

Take a firmware-placed OSLog buffer of any size at a 4 KiB-aligned
address; the other endpoints and loader-allocated buffers keep their
rules. Say which tuple was refused, so the next such failure names it.
The buffer must still lie in one of the DCP's no-map carveouts.

Signed-off-by: Satya Benson <[email protected]>
@satchlj

satchlj commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

J775c trial row: kernel linux main + #3686 + #3689 (91ed6a22, monolithic; Image sha256 5bb02072…), DTB main + #3682 (620119c2…), Stage 2 aura 01850b7e (aura#605 on the #602/#597 stack; sha256 2fb33cb8…), Stage 1 main 1e01a273 NO_DISPLAY, firmware 27.2.

HDMI works end to end, and SLC is back.

Stage 2 hands over dcpext0 with its live RTKit session (3 system buffer(s)), and Linux reserves all three, including the firmware's OSLog buffer:

OF: reserved mem: 0x0000010fd71dc000..0x0000010fd71e3fff (32 KiB) nomap non-reusable dcpext0-rtkit-ep8@10fd71dc000
apple-drm display-subsystem: bound 2b2e00000.dcp (ops dcp_comp_ops)
apple-dcp 2b2e00000.dcp: DCP booted
apple-dcp 2b2e00000.dcp: dcp_fixed_hdmi_reconnect: DP2HDMI HPD connected:1
apple-dcp 2b2e00000.dcp: HDMI: forwarding converter service requests (HBR3 link)
apple-drm display-subsystem: [drm] fb0: appledrmfb frame buffer device
apple-dcp 2b2e00000.dcp: boot scanout retired by displayed swap 3
apple-mcc 2220000000.memory-controller: system level cache allocation enabled on 32 planes

DRM: HDMI-A-1 connected 2560x1440; DP-1..4 (dcpext1) disconnected. 0 failed units; Wi-Fi up; returned to the default unaided.

One-run rows vs the same machine without the handoff (SLC off) and vs the earlier chain:

no handoff this trial earlier chain
GPU BW d4 / d8 (GB/s) 554 / 556 716 / 863 780 / 809
render tri d1 / d8 (µs) 199 / 27.9 134.6 / 23.8 130.1 / 23.4
llama-2-7B Q4_0 pp512 / tg128 (t/s) 3,005 / 108.8 3,071 / 110.7 3,085 / 104.9

One run each; the d4 bandwidth difference from the earlier chain is not yet separated from run-to-run noise. Not yet tested: HDMI audio, a desktop session on this connector, suspend, hotplug, and the dcpext1 Type-C paths.

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merge readiness at 91ed6a22: ready to merge

Check Detail
CI at head ok 7 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at 91ed6a22
Conflicts ok none
PR text ok Risk: two-way · . Only widens what a firmware-placed OSLog entry of a live DCP handoff may give as its size; other entries, and DCPs without a live handoff, are unchanged.

Areas: area:display
Merge: gh pr merge 3689 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at 91ed6a22

Blockers:

  1. Stacked on unmerged linux#3686 (base=fix/dart-four-level-live-import). Build/KUnit/host-test workflows have not executed on this PR against main; wait for #3686 to merge and retarget onto main so full CI passes.
  2. Missing second-generation live-handoff regression row (Not yet). Alongside the J775c ~30-boot HDMI proof, post a live-handoff regression row on another Mac generation once rebased onto main.

Checked:

  • Full 2-file diff (drivers/gpu/drm/apple/dcp.c, drivers/gpu/drm/apple/dcp_handoff_test.c, +19/-3), MERGEABLE against fix/dart-four-level-live-import.
  • dcp_rtkit_live_buf_valid() permits non-4K-aligned size strictly for firmware-placed (is_mapped == 1) OSLog (ep == 8) buffers while still enforcing size > 0 && size <= SZ_16M, no iova + size overflow, 4 KiB iova alignment, and full page alignment on all is_mapped == 0 and non-OSLog endpoints; KUnit covers all 4 cases.
Evidence
  • Code and KUnit cases are clean and verified on J775c (0x5ff8 OSLog buffer); awaiting #3686 merge, full CI on main, and a second-generation regression row.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 91ed6a22ef5e

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - Full 2-file diff (drivers/gpu/drm/apple/dcp.c, drivers/gpu/drm/apple/dcp_handoff_test.c, +19/-3), MERGEABLE against fix/dart-four-level-live-import.

  • dcp_rtkit_live_buf_valid() permits non-4K-aligned size strictly for firmware-placed (is_mapped == 1) OSLog (ep == 8) buffers while still enforcing size > 0 && size <= SZ_16M, no iova + size overflow, 4 KiB iova alignment, and full page alignment on all is_mapped == 0 and non-OSLog endpoints; KUnit covers all 4 cases.

Follow-ups (not blocking): Merge parent #3686 first; follow-ups: retarget, full CI (2nd-gen row not required)

Base automatically changed from fix/dart-four-level-live-import to main December 1, 2026 05:25

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

Reviewed at 91ed6a22. Only a firmware-placed OSLog can use a byte-sized buffer. The address alignment, overflow and size checks, and carveout checks still apply. KUnit covers the reported tuple and rejects an unaligned address, another endpoint, and a loader-allocated buffer. The J775c target and J773g regression rows cover the handoff. Apple build and KUnit against main are still pending.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@RyanTheTide
RyanTheTide merged commit 470d9af into main Dec 1, 2026
33 of 36 checks passed
@RyanTheTide
RyanTheTide deleted the fix/dcp-live-fw-oslog branch December 1, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants