Repository navigation
drm/apple: support unshared T8122 dcpext display DART with fbdma mirror for J615 - #3093
Conversation
…dma and t8122-dcpext-firmware-ready Document the properties needed for T8122 external display processors whose display DART cannot be joined to the display subsystem's IOMMU domain: - apple,no-shared-display-dart: keep the external coprocessor's display DART out of the display subsystem's IOMMU domain and mirror framebuffers through the fbdma child instead. - fbdma: child node naming the display DART stream and display subsystem DVA window used to mirror framebuffers. - apple,t8122-dcpext-firmware-ready: set by the boot loader to 2 (default) or 1 (explicitly requested by the owner, accepted by older kernels that share the display DART unconditionally). Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
…and loader-default marker On the J615 (MacBook Air 15", M3), appending dispext0_dart to the display subsystem's shared IOMMU domain causes the internal DCP's DART to fault and take down the internal panel. Keep dispext0_dart out of the display subsystem when the dcpext node sets apple,no-shared-display-dart, leaving framebuffer mirroring to the fbdma child node instead. - Accept apple,t8122-dcpext-firmware-ready = <2> (boot loader default) beside <1> (owner's explicit request), so older kernels that always share the display DART will not enable dcpext on a J615 sharing the same device tree. - Refuse a dcpext node with apple,no-shared-display-dart and no available fbdma child. - Disable the fbdma child when the display DART is shared (by board default or via apple_t8122_display.dcpext_disp_dart=1), so framebuffers are never mapped twice on dispext0_dart. - Add apple_t8122_display.dcpext_disp_dart (tri-state: -1 lets the board device tree decide, 0/1 override). - Extend t8122-gate-test.dtso and display-gate-test.c to cover marker values 1/2/3, board mirroring with/without fbdma, overrides 0/1, and 27.2 firmware with mirroring. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
When the display gate keeps a T8122 dcpext's display DART out of the display subsystem's shared IOMMU domain (apple,no-shared-display-dart), the external pipe scans framebuffers through a DART stream nothing maps. Mirror framebuffers read-only into the dcpext's available fbdma child domain at the display subsystem's DVAs: - Create the optional fbdma child platform device during pipe bind when an available fbdma child node is present (the display gate disables it when the display DART is shared instead). - Walk the display subsystem IOMMU domain's own translations via iommu_iova_to_phys() so both native and imported buffers are mirrored without reaching into an exporter's scatterlist, coalescing contiguous physical runs and rolling back partial mappings on failure. - Track mirrored GEM objects in an xarray and unmap each object from every apple_crtc (skipping t8132_ext_crtc) before drm_gem_dma_object_free() releases its pages and DVA; drop all mirrors before tearing down the fbdma device. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
…wire fbdma On the J615 (MacBook Air 15", M3), sharing dispext0_dart with the display subsystem's IOMMU domain triggers internal DCP DART faults. Mark &dcpext with apple,no-shared-display-dart and add the fbdma child on dispext0_dart stream 0 with the display subsystem's DVA window so appledrm mirrors framebuffers there instead. The Type-C routes remain shared with the J613 in t8122-j613-j615.dtsi. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Verdict at 0a1289fc6015
Approve — clean, fail-closed fbdma framebuffer mirroring for unshared T8122 dcpext display DART domains with proper GEM teardown ordering and KUnit coverage.
Blockers
None for code review.
Note on merge readiness: As noted in Not yet and pr-readiness, a standalone exact-head J615 hardware boot row at 0a1289fc6015 (outside the local 7.3 combined build) is still owed before merge.
Checked
- Full static audit of all 10 changed files (
+448/-16):drivers/gpu/drm/apple/apple_drv.c:apple_drm_gem_create_objectinstallsapple_drm_gem_funcs(.free = apple_drm_gem_free). Verified againstdrivers/gpu/drm/drm_gem_dma_helper.c(__drm_gem_dma_create()), which invokesdrm->driver->gem_create_objectfor both native and PRIME-importeddrm_gem_dma_objects;apple_drm_gem_free()unmirrors from every non-T8132-ext CRTC'sdcpbefore callingdrm_gem_dma_object_free(gem), preventing stalefb_domaliases after IOVA/page release.drivers/gpu/drm/apple/dcp.c+dcp.h+iomfb_template.c:dcp_fb_mirror_range()validates matching minimum page sizes and alignment, coalesces contiguous physical runs mappedIOMMU_READ, and cleanly rolls backmappedbytes on error (leaving nothing mapped).dcp_fb_mirror()is called fromiomfb_flush()via DRM.atomic_flush(process context, no spinlock held), somutex+GFP_KERNELxa_store()/iommu_map()are safe; rolls backiommu_unmap()ifxa_store()fails.- Teardown safety: when
dcp->retain_dmais false,dcp_release_piodma_iommu_dev()callsdcp_fb_unmirror_all()underfb_mirror_lockand clearsdcp->fb_dombefore destroyingfbdma; whendcp->retain_dmais true,dcp,fbdma, andfb_domremain retained until reboot so subsequentapple_drm_gem_free()->dcp_fb_unmirror()calls remain valid.
- DT/bindings/KUnit tests:
apple,fbdmabinding, J615/T8122dcpextDT updates, anddcp_fb_mirrorKUnit tests all match implementation.
- CI at
0a1289fc6015: all completed checks SUCCESS (dt-checks,host-tests,kunit,pr-text,readiness, policy checks). - Untested scope: no local J615/T8122 hardware boot performed (static diff + CI verification only).
Evidence
- Changed files (10):
+448/-16acrossapple_drv.c,dcp.c,dcp.h,iomfb_template.c, DT/bindings, and KUnit test files. - Verified
drivers/gpu/drm/drm_gem_dma_helper.c:79usesdrm->driver->gem_create_objectfor alldrm_gem_dma_objectallocations (including PRIME imports). - Verified
dcp_release_piodma_iommu_dev()/dcp_fb_unmirror_all()/dcp_fb_unmirror()locking andretain_dmalifetime semantics indrivers/gpu/drm/apple/dcp.c. - CI:
dt-checks,host-tests,kunit,pr-textall green at0a1289fc6015.
|
Verdict: FINISH, then merge at Blockers: The current branch conflicts with Checked: The bindings and other driver files merged automatically in the preview against |
Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
Do not let a boot parameter force sharing on a DT that prohibits sharing. Keep the display DART choice independent of the command line. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
If the described fbdma child cannot attach, let the failsafe external pipe give up without disturbing the panel. On mapping failure, submit the plane as disabled instead of passing an untranslated DVA to firmware. Keep the GEM mirror teardown order unchanged. Signed-off-by: Eric Juta <ericjohnjuta@gmail.com>
|
Hardware regression request — J613 USB-C external display. No result yet. Source: Can someone with a T8122 J613 check that its normal shared-display handoff is unchanged? Compare with your known-good packaged kernel on the same loader and display. In the test boot, check a real image on the internal panel and external display, then disconnect/reconnect and move the same display to the other USB-C port. Record mode/refresh, the handoff path, and any new DCP or DART errors. Return to the original default and check both displays again. Source-only build and boot kitIn a fresh checkout on arm64, with the normal Aurora build dependencies: git init linux-pr3093 && cd linux-pr3093
git fetch --depth=1 https://github.com/ericjuta/linux.git d1213c5fa733867ca22fc0717d228e0e780dc231
git switch --detach FETCH_HEAD
mkdir out
cp /path/to/your/packaged-aurora.config out/.config
scripts/config --file out/.config --disable LOCALVERSION_AUTO --set-str LOCALVERSION -pr3093-d1213c5fa733
make ARCH=arm64 LLVM=1 LOCALVERSION= O=out olddefconfig
make ARCH=arm64 LLVM=1 LOCALVERSION= O=out -j4 Image modules dtbsPreserve the loader's live DT and reservations and use the normal command line with no display-policy override. Use your lab's one-shot procedure; do not change Stage 1 or the permanent default. A listed connector without an image is not sufficient. Report board/chip, source head, kernel and loader versions, any deviations, mode/refresh and result, failed units, new kernel errors, SELinux denials if applicable, and restore status. No raw serials or hardware logs needed. The same J613 can cover #3092 in a separate boot if available. |
|
J615 check at Kernel: main ba29027 + this PR + #3092, on the default fleet command line. Non-default one-shot boot, then restored.
A real row needs a Stage 2 whose DT carries the opt-in, plus a USB-C monitor on the J615. Given the one-way risk you note, that pairing should be done deliberately: a matched kernel and Stage 2 DT, with rollback kept. |
|
J615 hardware result — tested head |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Audited all 7 signed-off commits and full diff at d1213c5: clean DT binding and fail-closed display-gate wiring (refuses apple,no-shared-display-dart without fbdma, disables fbdma when shared), proper fb_mirror_lock + xarray lifecycle with apple_drm_gem_free() teardown and dcp_fb_unmirror_all() cleanup, fail-closed scanout skip in iomfb_flush when mirroring fails, and matching display-gate KUnit coverage. Holding merge until full CI checks run green at head (and J613/paired coverage is confirmed).
What: Keep the external display DART out of the shared scanout domain when DT requests it, and mirror GEM framebuffers through the
fbdmachild instead. J615 selects that path from DT, without a display-policy command-line override. If the required domain cannot attach, only the external pipe is disabled; a failed framebuffer mapping is never submitted to scanout.Tested: T8122 display-gate KUnit 30/30; the wider run has the same seven T6041-Max failures as unmodified
main. Changed objects built withW=1; focused DT binding and board DTB checks ran. No exact-head hardware result yet.Risk: one-way · T8122 external display handoff and the J615 DT binding; retain a matched, known-good kernel and bootloader DT for rollback. Do not pair a kernel that always shares the DART with an explicitly enabled J615 external display handoff.
Not yet: J615 external display through the normal bootloader handoff, same-head J613 shared-path regression, and verified return to each machine's default. Prior combined-kernel measurements are baseline only.
Details and evidence
d1213c5fa733867ca22fc0717d228e0e780dc231. Forwardedmainat49fc037eeby merge. Kept upstream wake and retained-framebuffer handling; the mirror is removed before GEM releases its DMA address and backing pages.fbdmachild, and the 27.2 mirror policy. Arm64 QEMU: 68/75 total versus 63/70 on baseline, with the identical seven unrelated T6041-Max failures.W=1built DCP, DRM, the 14.7 and v27 IOMFB objects and display-gate with no compiler warnings. Individual non-merge commits pass checkpatch.dt_binding_checkscoped toapple,dcp.yamlandCHECK_DTBS=yfor the J615/J613 DTBs completed. An offline enabled-node negative fixture rejected an unknown property. Both enabled-node fixtures report the existing shared DTSapple,sync-syslog-ackschema warning; the unshared-DART property andfbdmachild are on J615 only.