Repository navigation
Conversation
|
Additional J615 field observation (2026-11-08): the user reports stable unplug/replug and lid-open/closed use with the combined local kernel 7.2.11-dcpexp-usb-recovery-20261108, retaining apple_t8122_display.dcpext_disp_dart=0. This build also carries the idle-port handover, brightness, thermal and USB-recovery changes, so the result cannot isolate this PR or #357 as the cause. The installed Image matches the USB-recovery build Image by SHA-256. The current boot journal search found no DART translation-fault or co-processor-crash entries. The tested combined kernel is now the first/default Limine entry, with stock and older kernels retained. No additional cable cycles or suspend tests were requested during this audit; the lid/replug result is user-reported, not a controlled suspend/resume qualification. Please treat this as supporting combined-stack hardware evidence, not an exact-PR-branch boot test. |
scottjones
left a comment
There was a problem hiding this comment.
Thanks, this is great work, and the testing is really thorough: both ports, unplug/replug, s2idle, lid closed, takeover between ports, 0 DART faults. It looks sound for the J615, and J613 is untouched (no fbdma node there, switch default unchanged).
A few code points:
- Must fix:
dcp_fb_mirror()indrivers/gpu/drm/apple/dcp.cmaps each framebuffer read-only into the fbdma domain, but nothing unmaps it when the framebuffer or GEM object is freed. Freed pages stay readable by the external DCP until that DVA is reused. A lifetime bug, not a crash. Could you unmap on fb release / cleanup_fb, or keep a per-fb record that's torn down with the fb? - Minor: for native buffers it builds a fresh sg_table via
drm_gem_dma_get_sg_table()on every flush, even when the buffer is already mapped. At 120 Hz that adds up, so do the already-mapped check before the allocation. - Fine as is: only logging a failed
iommu_map_sgtable(). - Wording: a few comments still say "Experiment" (
dcp-internal.h,dcp.c,t6030-display-gate.c). Please reword before merge.
On your question about the switch: we'd like a J615 board default, driven by the DT, so a J615 works with no kernel argument:
- The J615 dcpext node gets
apple,no-shared-display-dart. - The display gate keeps dispext0_dart out of the shared domain only if that node also has its fbdma child. Otherwise it warns and shares.
apple_t8122_display.dcpext_disp_dartbecomes tri-state: unset means the board decides, =0/=1 overrides.
The DT property ties the two halves together: m1n1 can check the same marker, so it only turns dcpext on by default for the J615 once a kernel with this support is installed. We have that m1n1 change drafted, and the 13-inch Air's m1n1 default is up as omacom/m1n1#44.
We have this as a commit on top of your branch. It builds clean with W=1 and the property lands in the dtb, but it hasn't run on hardware, since we don't have a J615. You can fold the same change in yourself, or we can share the commit for you to cherry-pick. Which do you prefer?
Once the unmap fix and board default are in, could you retest on your J615 with no dcpext_disp_dart=0 and confirm the internal panel and both ports still work with 0 DART faults?
|
Please merge this! I need an external monitor support for my MacBook Air 13-inch M3 2024 |
|
Pushed four review-response commits through f592f13. These add the binding and J615 board marker, fbdma-guarded DT default with tri-state dcpext_disp_dart override, framebuffer mirror lifetime cleanup, and the allocation/comment fixes. Lifetime detail: unmapping is tied to GEM-object free rather than framebuffer release, since multiple framebuffers can share one buffer. Per-DCP mirror tracking also permits teardown to unmap outstanding mirrors before destroying the fbdma domain. The already-mapped check precedes sg_table allocation. J615 hardware retest: booted 7.2.11-dcpexp-combined-20261111 without any dcpext_disp_dart command-line override. The live DT contains apple,no-shared-display-dart and fbdma; the gate logs that the display DART is kept out of the display subsystem and framebuffers are mirrored. Internal panel works at 2880x1864@60; Samsung G9 works at 5120x1440@120 on both left USB-C ports. Monitor replug and lid close/open recovered; no matching DART translation faults, coprocessor crashes or mirror failures were found in the checked boot logs. Links bounced for approximately five seconds around replugs before settling. This is functional coverage, not a long-duration GEM-lifetime stress test. Important qualification: this was a combined kernel, carrying #357 idle-port handover, #354 brightness, local #410 thermal work and local USB-recovery changes in addition to this PR and the four review commits. It is not an isolated #356 test. The local m1n1 boot DT overlay was updated with the board marker; this does not test the drafted upstream m1n1 change. Separate unresolved observation: after swapping monitor/hub ports, the hub mouse (USB2) returned but its USB3 hub and connected Kiyo Pro Ultra did not. Power-cycling the hub recovered USB3 and the camera at 5 Gb/s. Through-hub MJPEG 3840x2160@30 capture then passed for 20 seconds (599 decoded frames, discarded). USB3 reconnect reliability remains unresolved; cause and relationship to these changes are unproven. Build verification: changed objects built W=1 and J615 DTB built; combined Image/modules/DTBs built successfully. Focused combined-tree ARM64 KUnit: 267 passed, 1 skipped. Existing boot default retained. |
|
Claude Code wrote this up from my tests. I tested this PR on my 15-inch M3 MacBook Air and the external monitor works! The seven commits at f592f13 applied cleanly to aurora16. Thanks for this, Eric.
The monitor is an LG Ultra HD on a single USB-C cable (DisplayPort alt mode), which also carries its USB hub and charging. It came up at 3840x2160 and 60 Hz in 10-bit color on both ports.
The first hotplug after my first boot with this PR failed with a link fault on the back port. The driver recovered by itself 3 seconds later. It didn't happen again on any later plug or after the resume. The journal for the boot has no DART faults or DCP crashes. The J615 memory floor from aurora-silicon/linux#1985 ran the whole time and kept confirming its requests in about 31 ms, so the gate's changes to report@8 don't seem to disturb it. Once m1n1 sets the dcpext line for the J615 by default, will older kernels in the boot menu need |
scottjones
left a comment
There was a problem hiding this comment.
Thanks @ericjuta, this is a really solid follow-up. All four points from my 11-09 review are fixed, and fixed well:
- The mirror is unmapped when the GEM object is freed, and everything left is unmapped on unbind before the fbdma domain goes away. Keying on the GEM object rather than the framebuffer is the right call.
- The sg_table is only allocated after the already-mapped check.
- The "Experiment" comments are reworded.
- The J615 DT default is in, with
dcpext_disp_dartas a tri-state override.
We'd like to ship this in Omarchy 4.5.1. Two things are needed first.
1. The binding description. In Documentation/devicetree/bindings/display/apple,dcp.yaml (around lines 274-277), fbdma/apple,dma-range has a $ref but no description, so dt_binding_check fails the meta-schema ("'description' is a dependency of '$ref'"). tools/aurora-ci/dt-check.py treats binding-invalid as blocking, so the required Kernel CI check will fail once it runs. It hasn't run yet because the fork run is waiting for approval. A one-line description fixes it.
2. A new loader marker that older kernels refuse. m1n1 runs once and fixes up the DT from the newest kernel. The Limine snapshot and rollback entries then boot older kernels with that same DT. A pre-#356 gate enables dcpext whenever the node has apple,t8122-dcpext-firmware-ready == 1, and it shares the display DART. So on a J615 an older kernel would likely take the panel dark. That's from reading the code, I haven't booted it.
Could the gate also accept a new value, for example apple,t8122-dcpext-firmware-ready = <2> (or a separately named node property), for loader defaults? Pre-#356 gates refuse anything but 1, so they'd leave dcpext off. Please keep accepting <1> for an owner's explicit line, and document the new value in apple,dcp.yaml.
A few more asks while you're in there:
- With the new marker, if a node has
apple,no-shared-display-dartbut no fbdma child, please refuse dcpext instead of warning and sharing the DART. Separately, forcingdcpext_disp_dart=1on a J615 should either refuse or disable the fbdma device. Today it shares the DART while fbdma maps the same DVAs and hits theWARN_ONindart_init_pte()on every flush. - Gate KUnit cases for the marker variants and the tri-state: unset with marker and fbdma, unset with marker and no fbdma,
=0,=1. - A retest without the chosen line in boot.bin, using my m1n1 build once it writes the new marker. I'll share it when it's ready.
One optional note, not blocking: imported dma-bufs are mirrored using sg_phys() on the exporter's table. That breaks the dma-buf rule and would trip under CONFIG_DMABUF_DEBUG (off in our config). iommu_iova_to_phys() on the display domain would be cleaner.
I'm making the matching m1n1 change, and the J613 default from omacom/m1n1#44 moves to the same marker, so both Airs work the same way.
Happy to approve once those are in and CI is green. The branch needs approval after the last push, so I'll approve then rather than now.
|
@freber thanks for testing this so carefully, and good catch on the older kernels. I got this wrong on 11-09 when I said m1n1 "only turns dcpext on by default for the J615 once a kernel with this support is installed". m1n1 runs once and fixes up the DT from the newest kernel. The snapshot and rollback entries in the boot menu then boot older kernels with that same DT. A pre-#356 gate doesn't know Here's the plan for 4.5.1:
Thanks again, this question made the rollout a lot safer. |
apple_t8122_display.dcpext_disp_dart=0 enables the T8122 dcpext without appending its display DART to the display subsystem's iommus. On the J615 the shared domain faults the internal DCP's DART (NO PMD/PTE FOR IOVA at 0x1000a000000..) and crashes the internal DCP about 2 s into boot. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
With the dcpext display DART out of the display subsystem's domain, the external pipe scans framebuffers through a DART stream nothing maps. An optional fbdma child of the dcpext (display DART stream 0, the display subsystem's DVA window) gets its own domain, and each swapped framebuffer is mapped read-only there at its display DVA. Imported (GPU) buffers use the importer's sg table. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
The J613 dcpext routes, carried to the J615 (same T8122 Type-C wiring: usb-pd@c Left-back/ATC0, usb-pd@a Left-front/ATC1), plus an fbdma child on dispext0_dart stream 0 for the framebuffer mirror. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
…lay-dart Describe the fbdma child an external coprocessor scans mirrored framebuffers through, and the marker that keeps its display DART out of the display subsystem's IOMMU domain. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
… freed dcp_fb_mirror() mapped each framebuffer read-only into the fbdma domain and never unmapped it, so freed pages stayed readable by the external DCP until their DVA was reused. Track each mirrored GEM object in an xarray and remove its mapping from the GEM free hook, before the pages and the DVA are released, and drop all mirrors when the fbdma device goes away. The xarray also answers "already mapped" before any sg_table is built, so a flush of a mapped native buffer no longer allocates. Only a failed mapping is logged. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
…DART apple,no-shared-display-dart on a dcpext node that has an fbdma child keeps its display DART out of the display subsystem's domain, so a J615 needs no kernel argument. Without the fbdma child the gate warns and shares. apple_t8122_display.dcpext_disp_dart becomes tri-state: unset lets the board decide, =0 and =1 override. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
…by default Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
The boot loader marks a T8122 external coprocessor whose firmware it has reserved. One device tree serves every installed kernel, and kernels that share the display DART unconditionally enable the coprocessor on <1>, which takes the internal panel down on a J615. Document the property and add <2> for the boot loader's default: those kernels refuse it. <1> stays for an owner's explicit boot loader configuration. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
The display gate disables the fbdma child when it shares the dcpext's display DART with the display subsystem. The shared domain already maps every framebuffer on that DART, and mirroring the same addresses through the fbdma stream as well hits the WARN_ON in dart_init_pte() on every flush. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
…r mirror Accept apple,t8122-dcpext-firmware-ready = <2>, the boot loader's default, beside <1>, the owner's explicit request. Older gates enable the dcpext only on <1> and always share its display DART, so a default of <2> keeps them from taking a J615 panel down when they boot from the same device tree. A node with apple,no-shared-display-dart and no fbdma child is now refused instead of shared with a warning: the board says sharing is unsafe, and without fbdma nothing can reach the external pipe. When the DART is shared, by the board or by apple_t8122_display.dcpext_disp_dart=1, the gate disables the fbdma child, so framebuffers are never mapped on that DART twice. The T8122 KUnit tree gains a J615-like dcpext, and cases for both marker values, a wrong and a missing marker, the board default with and without fbdma, a board that shares, and dcpext_disp_dart=0 and =1. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
f592f13 to
bf36ee1
Compare
|
@scottjones thanks, all of it is in. The branch is rebased onto Blocking
Also asked
Tested
Retest Ready when your m1n1 build is. I will build this head, boot it on the J615 with no chosen line in boot.bin and your m1n1 writing |
|
Thanks Eric, this is a really thorough round. I've been through the new head and everything I asked for looks done. Two things before I approve:
On your question: refusing without an fbdma child for both marker values is right, please keep it. No need to bring back the old warn-and-share for One optional nit, not a blocker. In |
…ations dcp_fb_mirror() mapped an imported buffer from its exporter's sg_table with sg_phys(), which an importer must not do and CONFIG_DMABUF_DEBUG would catch, and built a new sg_table for every native buffer. Every framebuffer already has a display DVA, so read the pages behind it with iommu_iova_to_phys() on the display subsystem's domain and map them into the fbdma domain at the same addresses, for native and imported buffers alike. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
bf36ee1 to
b4cc668
Compare
|
@scottjones the J615 boot with the external display on the fbdma mirror, with the display code at
Not tested on this build: suspend/resume with the display attached, and 5120x1440@120. The page-size nit is in too: |
External DisplayPort over USB-C on the J615 (MacBook Air 15", M3), on both ports. It's the J613 dcpext path from #103/#114 plus two fixes the J615 needs. Reports and logs are in #103.
Commits
dcpext_disp_dartswitch.apple_t8122_display.dcpext_disp_dart=0enables the dcpext without appendingdispext0_dartto the display subsystem's iommus. On the J615 that shared domain faults the internal DCP's DART (28d304000, NO PMD/PTE at0x1000a000000..) about 2 s into boot, and the internal DCP crashes (the dark panel of kboot: reserve the T8122 dcpext firmware only with chosen.asahi,t8122-dcpext=1 m1n1#14). The default is unchanged, so J613 behaves as before.fbdmadomain. Without that DART in the shared domain, the dcpext faults at the framebuffer DVAs. An optionalfbdmachild (dispext0_dartstream 0, with the display subsystem's DVA window) gets its own domain, and each swapped framebuffer is mapped into it read-only at its display DVA. Imported (GPU) buffers useobj->sgt. Without the node nothing changes.fbdma. Everything stays disabled until the m1n1 marker is set (chosen.asahi,t8122-dcpext=1).Tested (J615, 14.7, Samsung C49G95T 5120x1440@120, direct USB-C to DP)
Both ports, unplug/replug ×2, s2idle with the display attached, lid closed, pipeline takeover between ports. 0 DART faults, internal panel and GPU fine. Not tested: docks/HDMI/MST, DP audio, long sleeps.
For review
fbdmanode exists. Your call; I don't know why the shared domain faults on J615 but not on J613.Disclosure: the analysis, the patches and this text were made with an AI coding agent (Claude). The tests ran on real hardware, and I checked the results.