Skip to content

drm/asahi, apple: add native J713/T8132 graphics - #367

Closed
erykwieliczko wants to merge 13 commits into
m4/pr1-basic-bringupfrom
m4/pr2-gpu-dcp
Closed

erykwieliczko wants to merge 13 commits into
m4/pr1-basic-bringupfrom
m4/pr2-gpu-dcp

Conversation

@erykwieliczko

@erykwieliczko erykwieliczko commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Add native graphics for the J713/T8132 Apple M4 platform: a G16G firmware
backend in Rust Asahi and an internal-panel IOMFB backend in the common C Apple
DCP driver. This builds on the M4 basic bring-up series (#366), including its
USB3/Bluetooth support, and requires the matching m1n1/U-Boot handoff.

The GPU uses the existing Mesa UAPI and shared DRM/GEM, GPUVM, scheduler and
fence interfaces. The series adds private command memory per VM, tracked
firmware-visible lifetimes, bounded render-queue backpressure, retained display
DART ownership and fault handling, PMP votes, and GPU thermal-governor and
package-budget inputs. Initial scanout is cleared to black. Radio and display
DART ownership are kept independent. New files are dual licensed; existing
licences are preserved.

Validation on kernel 49c5d9994fec with Mesa 91ac7e2cd86:

  • Full kernel, modules and device-tree build passes with WERROR enabled.
  • 23 GPU CPU suites, 62 display groups, 8 targeted error-path groups, and the
    USB3/Bluetooth regression scripts pass, including their negative controls.
  • Reboot-tested as 7.2.10-m4_asahi_rebase1: both retained display DARTs
    admitted, their shared fault IRQ registered, and native KMS/Rust Asahi active.
    No masked-fault refusal or host failure was observed. Display, built-in keyboard
    and trackpad were confirmed working; no startup diagnostic pattern appeared.
  • Native OpenGL 4.6 render, compute and geometry checks pass. Concurrent
    rendering/compute for 32 seconds and two blank/unblank cycles pass.
  • Bluetooth LE discovery, three controller power cycles and concurrent Wi-Fi
    traffic pass on this same boot.
  • The additional DCP error harness passes GCC and Clang: six production cases,
    the module API guard, five Kconfig cases and six runtime mutation controls.
    Ordinary built-in and modular DART configuration builds also pass.

Previous revision 5f8bc03dbefe also passed VM/isolation/backpressure checks
and focused API tests: GL 80 passes with 6 known readback-tolerance failures;
Vulkan 101 passes with 22 unsupported cases. Those focused CTS results have
not been rerun on this rebased revision.

This is an experimental internal-panel profile. Rendering VMs pin about
0.7 GiB each, and an aborted firmware receipt disables that command class until
reboot. Physical reset, firmware telemetry freshness and full display power
policy remain unqualified. Suspend, hibernate and kexec are blocked while
native graphics owns DMA. DCP PMU/power-LUT diagnostics still prevent full
platform qualification. Keep the default strict IOMMU domains; administrative
switches to DMA-FQ are unqualified. These bounded tests do not establish full
conformance or full-platform qualification.

Reject malformed mixed-provider tuple geometry before reserving inherited
device addresses.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Provide fence-signalling guards and bound-device event delivery for native
GPU backends. Reuse the existing sanitized arm64 feature API and DMA
mappings; no private architecture cache exports are needed.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Describe the qualified firmware regions, PMP relationship and inherited
display ownership while retaining existing generation contracts.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Route DISP and AGX votes through the existing PMP firmware owner. Preserve
failure ordering and invalidate telemetry after uncertain command failures.
Publish GPU budgets only to the matching consumer epoch.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Connect the native GPU consumer to the shared thermal governor and
measured-rail budget. Tag sleeping SMC reads by consumer epoch, start
replacement consumers restricted, and retain the carried operating policy
limits.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Adopt retained J713 display streams without resetting their live firmware
roots. Validate inherited leaf ownership against consumer reservations and
Linux memory, keep DMA provenance through quarantine, and retain uncertain
backing until reboot. Attach the shared fault interrupt only after both
display DARTs are admitted; partial admission leaves it unobserved.

Unify strict-DMA and fault-quarantine predicates with retained radio SIDs
without sharing their hardware ownership. Refuse masked display faults,
quarantine both display peers before releasing their shared IRQ, and adapt
the scoped radio regression harness. Keep display reset explicitly blocked.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Keep display components, atomic state and framebuffer ownership in appledrm
while adding the qualified IOMFB 26.6 wire backend. Snapshot bounded
callback inputs and retain uncertain scanout until exact successor
receipts.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Share tracked GPUVM lifetime, native query support and CPU-retired
timestamp mappings with the G16 backend. Close unpublished VMs on
allocation failure and release backend handle owners on close, while
accepted jobs retain their own leases. Complete page-table rollback under
PPL, then invalidate after dropping the handoff mutex. Keep legacy backend
behavior and compile with G16 disabled and WERROR enabled.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Add the T8132 G16G firmware backend within the Rust Asahi driver. Use the
common DRM, GPUVM, GEM, fence and scheduler interfaces and the existing
Mesa UAPI. Allocate private uncached command arenas per VM and fresh PB
epochs per render command. Retain both hardware owners until authenticated
full displacement; uncertain or aborted work remains pinned and the
affected class stays unavailable until reboot. Bound render preparation
with interruptible credit backpressure and charge retained VM bindings per
DRM file. The current J713 profile pins about 0.7 GiB per rendering VM and
does not provide a qualified physical GPU reset. Native rendering, compute,
process isolation and focused GL/Vulkan regressions are exercised
separately from platform power-policy qualification.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Describe the native GPU and DCP components, firmware carveouts, inherited
stream ownership and existing PMP provider relationships.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Build native Rust Asahi and common appledrm with the complete basic
platform prerequisites.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Add portable tests of the production firmware encoders, ownership ledgers,
page-table failure paths, submission boundaries and power policy using
public synthetic fixtures. Cover interrupted submission without output-
fence mutation, process close without another VM creation, bounded credit
wakeup, generation churn, reserved placeholders and paired display IRQ
admission. Keep live hardware regressions opt-in and retain exact source
and boot identity in their reports.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
Document the native M4 interfaces, per-VM memory cost and resource
lifetime, bounded submission backpressure, and the abort, suspend and kexec
limits. State the unqualified firmware telemetry freshness and display
power-policy gaps explicitly. Host tests, native functional tests and a
complete conformance submission are distinct evidence.

Generated-by: Codex
Assisted-by: Codex:GPT-6
Signed-off-by: Eryk Wieliczko <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Superseded by #400, which carries these commits with your authorship, rebased onto integration/aurora with fixups (listed in #400: pmgr-pwrstate inherited-on gated to T8132 plus its binding, rtkit-helper T8140 adopted-session buffers, PMP power-command latch gated to J713, retained DART non-posted mapping, apple,t8132-pcie binding, J713 options moved into asahi.config; 7.3 build adaptations folded into your commits with [ryan: ...] notes). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants