Repository navigation
Conversation
The T8142 AOP keeps its crash buffer in its own slot of its DART stream and asks for it on endpoint 1 with that IOVA. A client without shmem_setup refused the request, so the firmware never got its crash buffer acknowledged. APPLE_RTKIT_FIRMWARE_OWNED_CRASHLOG takes such a buffer as the firmware's, without a CPU mapping, and acknowledges the request unchanged; a later crash is reported without a log. RtKit::new_with_firmware_crashlog() selects it at runtime, so a driver can use it for one SoC only. Signed-off-by: Thomas Glanzmann <[email protected]>
Vm::map_at() reserves at most one guard page after a mapping. The M5 backend maps the driver's pools at the same address in each client VM with two guard pages after each, as it does when it allocates them. Add Vm::map_at_with_guard_size() and express map_at() through it. Signed-off-by: Thomas Glanzmann <[email protected]>
The kernel range of a VM, reserved at VM_CREATE for kernel-managed objects, is only handed to GPUVM. The M5 backend places its per-client objects in that range and checks that userspace commands stay out of it. Keep the range in the Vm and add an accessor. Signed-off-by: Thomas Glanzmann <[email protected]>
The M5 (T8142) 25G76 firmware runs application work in a TTBAT context whose lower half is the client VM's root and whose upper half is an empty root of its own; the firmware's upper mappings are not shared with applications. The context is claimed when the work is set up and published explicitly once it is prepared, and a later client takes it over without giving up the context number. Add M5ExecutionContext for that, built only with the M5 backend. It claims numbers from the execution context mask, publishes and retracts under the handoff lock, and a mapping change reaches it through the existing invalidation of every context that names a VM's root. Signed-off-by: Thomas Glanzmann <[email protected]>
The native 25G76 driver sets the low bit of the GPU's PMGR boot control word (SGX + 0xe90000) before either M5 firmware instance starts; the word reads 0x30000 on J813. Add the write, for the M5 backend only, refusing any other starting value. Signed-off-by: Thomas Glanzmann <[email protected]>
Add a backend for the M5 GPU (J813, G17G) running the 25G76 firmware (RTKit-3255.160.4), as ProbeConfig::M5 for apple,agx-t8142 behind CONFIG_DRM_ASAHI_M5. It changes nothing for the other SoCs. The 25G76 firmware has two coprocessors, GFX and GFX1, as the A18 Pro has, but a HAL300 interface that differs from the 26A428 and 25G83 builds the shared G17 code runs. The backend therefore builds its own initialization graph and talks to the firmware over its own queues, while using the shared parts of the driver: - the UAT is the shared one with published roots, adopted and mirrored as on the A18 Pro, plus the M5 application contexts; - user VMs carry a status and a job lifetime, and the backend uses the tracked submission model of file.rs; - the UAPI is the shared one. The backend reports VM_STATUS and SOFT_FAULTS and one hardware command per submission. The boot loader (aura) loads the firmware, checks both TEXT images against the 25G76 build and says so in /chosen/aurora,m5-gpu-firmware-profile; the backend refuses to start without it. One render pair and one compute queue serve all clients and are handed from client VM to client VM; a submission is polled to retirement before the ioctl returns. Renders and compute are admitted only within the state the firmware programs are known to handle, and refused with ENOTSUPP otherwise. There is no recovery yet: a job that fails stops both coprocessors and retains every firmware-visible object until reboot. The driver's pools are mapped at their own address in each client VM the job is handed to, except in the VM that owns them, and the compute storage is reserved together with the parameter buffer, so that its address is free in every such VM. Tested on J813 (M5, 8 GPU cores) on the aura one-shot trial boot, with Mesa j813, against the same Mesa on the J813 kernel this code comes from: GLES2 16016 pass, 930 fail (identical per case); GLES3 40832 pass, 3547 fail, 2 timeouts (identical but for one known flake); GLES31 32813 pass, 4517 fail (t70: 32804/4520; the 32 differing cases are 9 fail->pass and flakes); the sway desktop renders on the GPU from boot, also during the CTS runs. This consolidates the M5 work of Acelogic <[email protected]> and the G17P render, UAPI and initdata encoders of DjDeveloperr <[email protected]>, with contributions by Ryan Murray, Eryk Wieliczko and Chris Kearney, from the J813 kernel tree, ported onto integration's driver. Signed-off-by: Thomas Glanzmann <[email protected]>
4b42cdb to
7441baa
Compare
|
Which public Mesa repository and exact commit were used for the J813 Sway/GLES tests? Is the ‘Mesa j813’ branch and build recipe available? I’m trying to reproduce GPU-accelerated Linux on J815/T8142 (10 GPU cores). Also, has this backend been validated with macOS 27 beta5 firmware, or only 25G76? |
|
Mesa: https://github.com/aurora-silicon/mesa-aurora, branch Build, natively on the M5 (Debian sid): Run it with: Sway runs on wlroots with J815: the probe accepts 8 or 10 cores, but the backend has only run on the J813's 8 cores. The init data and register programs it replays were measured on the J813, so a 10-core part likely needs its own measurement. You would also need a J815 DT with the GPU node; #812 has the J813 one. Firmware: only 25G76 (RTKit-3255.160.4). The probe refuses unless aura publishes exactly that profile in |
|
Thanks, that identifies the matching series. The Mesa URL https://github.com/aurora-silicon/mesa-aurora currently returns 404 through both GitHub and the API; e1690cd0c3d is also unavailable in aurora-silicon/mesa and sithglan/mesa-aurora. Is mesa-aurora still private, or is there another public URL for thomas/j813-m5-next? Could you make the matching source or patch series accessible? |
|
mesa-aurora is private at the moment, which is why you get a 404. It will be released to the public soon. Once it is, thomas/j813-m5-next (including e1690cd0c3d) will be available at https://github.com/aurora-silicon/mesa-aurora. |
|
J815/T8142 (10 GPU cores) now passes native initialization and four DRM jobs (clear/copy/draw/copy), with full 64x64 readback and guard checks. This used programs captured from public Mesa 8990cdb219b2, with query/timestamp outputs disabled and one command per submission. Could you publish the matching thomas/j813-m5-next/e1690cd0c3d series, or provide a source archive or repository access? |
|
Thanks, and congratulations on getting J815/T8142 through native init and the four DRM jobs with full readback. That's good progress. I have to decline for now, though. The Mesa side (the thomas/j813-m5-next series) is proprietary work at the moment and will stay that way until it is complete and released, so I can't publish the branch, send a source archive or give out repository access before then. |
This adds the J813 (M5, T8142, G17G) GPU as its own backend,
drivers/gpu/drm/asahi/m5/, behindCONFIG_DRM_ASAHI_M5. It probes asProbeConfig::M5forapple,agx-t8142. Nothing changes for the other SoCs: the shared code only gains three small mmu additions and one register write, and the M5 parts of them are compiled only with the backend.Why a separate backend
The M5's 25G76 firmware (RTKit-3255.160.4) has two coprocessors like the A18 Pro, but its interface is HAL300. It differs from both builds the shared G17 code runs (26A428, 25G83) in the init graph, queue records and register programs. This follows the same pattern as
g16/for the M4 andm3/. The intent is to fold it into the shared G17 code once the M5 Pro/Max work lands here as well.What it shares
mmu::Uatwith published roots, adopted and mirrored as on the A18 Pro. The M5 application contexts are added inmmu/m5_context.rs: the client VM's root below, a private empty root above, published explicitly.file.rs.asahi_drm.h. The backend reportsVM_STATUS(and its mirror) andSOFT_FAULTS, and one hardware command per submission.Commits
soc: apple: rtkit: Take a crash buffer the firmware maps itself. This is the same commit as in J813: AOP sound on the MacBook Air M5 (speakers, jack, microphones) #811; it drops out on rebase once that one is merged.drm/asahi: mmu: Map at a fixed address with a guard of any sizedrm/asahi: mmu: Keep the kernel range of a VMdrm/asahi: mmu: Add M5 application contextsdrm/asahi: regs: Add the M5 PMGR boot controldrm/asahi: Add the M5 (T8142) backendDepends on
/chosen/aurora,m5-gpu-firmware-profileLimits
ENOTSUPP.Testing
J813 (8 GPU cores), aura one-shot trial boot, Mesa j813, compared with the same Mesa on the J813 kernel this comes from:
The sway desktop renders on the GPU from boot, and it kept rendering during all three runs.
Credits
This consolidates Acelogic's M5 work and DjDeveloperr's G17P render, UAPI and initdata encoders, with contributions by Ryan Murray, Eryk Wieliczko and Chris Kearney, ported onto integration's driver.
cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10