Skip to content

drm/asahi: render on the G14 firmware-27.2 runtime - #3031

Merged
RyanTheTide merged 44 commits into
integration/aurorafrom
m2gpu/g14-v27-2-render
Nov 24, 2026
Merged

RyanTheTide merged 44 commits into
integration/aurorafrom
m2gpu/g14-v27-2-render

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 24, 2026 •

Copy link
Copy Markdown

Problem

On the M2 (G14G) with GPU firmware 27.2 (the M2 Mac mini, and M2 Airs on the 27.2 stub), the firmware-27.2 runtime from #2544/#2610 runs compute only. Render commands are refused and the device reports itself compute-only, so GNOME, Firefox and every GL/Vulkan graphics client fall back to software rendering.

Change

This series adds render to the G14 firmware-27.2 runtime. It reuses the shared submission carrier, the UAPI parser, the 26.x wire helpers (#2543) and the adopted UAT from #2544. The G14 queue, event and command layouts sit in the G14 files. Behaviour is selected by the firmware compatibility the boot loader hands over and by what the GPU's ID registers report. There are no board or chip gates and no command-line or module parameters.

  • Render submission: the tiler and fragment commands of a render are staged on both firmware work rings before either is published. They keep their scene and VM binding until both engines retire. Parameter buffers grow on firmware request.
  • Fixes found bringing up the desktop on the J473:
    • parameter-buffer lists mapped GPU read-write (a read-only mapping faulted on the first render);
    • tiler and fragment kick masks set from the ID registers (they were zero, so no render started);
    • completion flushes requested on render commands (the host stamps were never written);
    • completion stamps cache-synchronized for the firmware's UAT;
    • queue backpressure rechecked when the firmware frees a slot without notifying.
  • Depth/stencil compression: admission follows what the queue's command builder encodes, not the M3 envelope. Without this, every GNOME Shell and Firefox frame was refused with ENOTSUPP.
  • Panic fix in shared code: gpu.rs no longer unwraps a missing RTKit transport. Before, a client that created enough queues could panic the kernel from GpuManager::alloc(). Every doorbell now returns ENODEV without a transport. Without device control, freed firmware memory is held rather than flushed (warned once). KUnit tests cover the decision.
  • Timeout diagnostics: on a timeout the runtime logs the MMU fault status, so a stall can be told apart from a page fault.

Stacked on #2610 (base satchlj/g14-v27-2-compute-only). It supersedes our draft #2979: the drain, SRAM-table and firmware-compatibility commits here are render-aware versions of #2979's, and #2979's publication ordering is part of the render submission commit. It also carries the compute start-word commit from #2896, but not #2896's performance-state change.

Testing

  • Build: integration/aurora 0f111a0 with this series merged, arm64 LLVM, the fleet config with CONFIG_DRM_ASAHI_G14_V27_2=y. There are no warnings in drivers/gpu/drm/asahi.
    • Clippy: the new items are fixed. The ones left in the touched files were already there.
    • gpu.rs and the two new files are rustfmt-clean. checkpatch is clean.
    • Host tests: m3 9/9, asahi-g15 1/1, asahi-m4 1/1. The base is a feature branch, so CI does not run them here.
  • J413 (M2 Air, firmware 13.5) regression: the same merged kernel, booted one-shot on the default command line. Gate PASS against the same Mac's production baseline:
    • 3/3 s2idle cycles (15 s RTC wake, same boot) and the Vulkan triangle 1/1 on the 13.5 path;
    • 0 SELinux denials, 0 failed units, 0 GPU, firmware or kernel faults;
    • no new kernel error or warning classes.
  • J473 (M2 mini, G14G, firmware 27.2): earlier one-shot rows on lab kernels carrying this series, all on the default command line. The desktop/CTS and sleep rows ran with commits 1–11. The two-monitor row ran with all 13, plus the DCP 27.2 changes drm/apple: adopt a DCP handed over running (M2 Mac mini HDMI on 27.2) #2853/drm/apple, phy: apple: light a USB-C display from a firmware-27 DCP on a T8103-generation ATC PHY #2868/drm/apple: keep what a running DCP drives through s2idle (DP audio, DP PHY, HDMI link) #2953 and a Stage 2 of aura main + aura#402.
    • GNOME Shell composites on the GPU with no environment overrides. Both external monitors were driven (USB-C/DP 2560x1440@60 and HDMI 1920x1080@120). Firefox with WebGL and video, vkcube and glxgears all ran.
    • Vulkan CTS depth/stencil + MSAA set: 384 pass, 0 fail, 248 not supported (depthBounds and four formats). This includes the 4x MSAA depth/stencil resolve groups, 140/140.
    • s2idle with the GFX domain kept on through system sleep: 4/4 resumes in the same GNOME session, with vkcube and the triangle passing after each. Without it the Mac reset 2/2 (see limits).
    • The gpu.rs panic: the J473 got past the point that panicked before (2049 queue allocations) with no panic. The KUnit cases for the collection decision pass, and a mutation of the decision is caught.
  • J473 on this exact merged kernel (integration 0f111a0 + this series, Stage 2 with apple,sleep-retained on the GFX domain, default command line):
    • GNOME Shell composites on the GPU (glxinfo: accelerated, Apple M2 (G14G B0)). 24 distinct scanout frames; glxgears 51-58 FPS; Firefox 47-61 fps with video playing.
    • Vulkan CTS depth/stencil + MSAA set: 384 pass, 0 fail, 248 not supported. Group by group this is the same result as the earlier rows.
    • s2idle 3/3 (15 s RTC wake): the same GNOME Shell process survived each cycle, and vkcube and the triangle passed after each wake.
    • 0 GPU fault lines and 0 SELinux denials.
  • KUnit: the suites build with the fleet config, but that config boots with KUnit disabled, so they did not run on the Macs. The collection decision was checked with host tests, including a mutation control.

Still to run / known limits

Commits, layout notes and row details

Commits (on satchlj/g14-v27-2-compute-only 3515e7d):

  1. 471dc3cf G14 firmware 27.2: set the compute start word the 13.5 path sets (also in drm/asahi: G14 firmware 27.2: run every performance state, and set the compute start word the 13.5 path sets #2896, without its performance-state change)
  2. cb9cf343 submit paired tiler and fragment work through G14 firmware (render path; new g14_v27_2_render.rs and g14_v27_2_abi.rs; the KUnit import fix is folded in)
  3. 645c79a5 synchronize G14 completion stamps for the firmware UAT
  4. f15f3d1f drain G14 submissions before completing or stopping (render-aware version of drm/asahi: fix G14 compute publication and suspend ordering #2979's)
  5. 4758c763 require the firmware handoff SRAM voltage table (same as drm/asahi: fix G14 compute publication and suspend ordering #2979's)
  6. c73aedd3 retry G14 firmware queue backpressure
  7. c17c2705 map G14 parameter-buffer lists GPU read-write
  8. ec59bb6f select G14 by firmware compatibility and signal suspend drain (render-aware version of drm/asahi: fix G14 compute publication and suspend ordering #2979's)
  9. ea2ab585 set the G14 tiler and fragment kick masks
  10. d2812fec request completion flushes for G14 render commands
  11. cf467644 admit depth/stencil compression the G14 render builder encodes
  12. 82671c76 never unwrap the RTKit transport on device-control paths (shared gpu.rs; KUnit asahi_gpu_garbage)
  13. 9884f9b4 report the MMU fault status on a G14 firmware 27.2 timeout
  14. c4589049 drop "compute-only" from the G14 firmware-27.2 probe message

What is shared and what is G14-specific:

  • Shared: the submission carrier and UAPI parser (m3_submit.rs), the 26.x wire helpers from drm/asahi: share the 26.x wire helpers and clean bound TTBAT slots #2543, the adopted UAT from drm/asahi: G14 compute on GPU firmware 27.2 #2544 and the 13.5 render structures (fw::vertex / fw::fragment job parameters, tiling parameters).
  • G14-specific: the queue ring, the event record and the 27.2 command placement around those structures, in g14_v27_2*.rs.
  • Selection: the runtime is chosen by the firmware compatibility the boot loader hands over. Kick masks come from the cluster and core counts in the GPU ID registers. Compression admission follows the queue's command builder. There are no chip, board or firmware-version gates.

J413 gate (production fleet kernel vs this kernel, same Mac, same command-line digest):

  • baseline PASS; candidate PASS with s2idle 3/3 (suspended 15.4 / 15.3 / 15.3 s, success +1 each, fail +0);
  • triangle 1/1; AVC 0; hard faults 0; new warning classes none; restore PASS (production running and saved, next entry empty, Enforcing, 0 failed).

J473 rows (lab kernel = this G14 code + #2853/#2868/#2953):

  • desktop: 24 distinct scanout frames over 93 s; 40 desktop actions; 0 render rejections; 0 GPU fault lines; 0 AVC.
  • CTS groups: triangle 1/1; renderpass suballocation simple 5/9 (4 not supported); draw depth_bias 6/6; d32s8 stencil states 8/8; renderpass2 depth_stencil_resolve 32x32 4x MSAA 122/122 and 16x64 6-layer 4x MSAA 18/18; pipeline monolithic depth d32s8 224 pass, 244 not supported.
  • sleep: 1/1, then 3/3 with the retained GFX domain.

Assisted-by: LLM (Claude:Opus 5.5)

satchlj and others added 23 commits November 22, 2026 05:32
GPU firmware 27.2 on G14 (the M2's G14G) takes a new root: four opaque
records (status, control, power, an extra block) after the UAT level
descriptors, and a runtime directory of 26.x-style channels in place of
the 13.5 RuntimePointers. Add that root as G14 V27_2 and a compute-only
runtime on it.

- fw/initdata.rs: the raw InitData and HwDataB layouts gain V27_2 (a new
  AGX_V27_2 version group instantiates only these two), with layout
  checks against 13.5.
- gpu/v27_2.rs: builds the root on the records of a 13.5 G14 manager
  (GpuManager::build_graph with GraphProfile::G14V27_2, which maps no
  registers and keeps the private range below the 27.2 timestamp
  aperture): hardware data from the 13.5 values, the chip's 27.2
  register table (hw/t8112.rs), the power and thermal controller, the
  idle-policy records, and one queue with a kernel-owned boot compute job.
- g14_v27_2.rs: start sequence and runtime. The driver's kernel window is
  mirrored into the loader's shared second-level table and named in
  TTBAT context 0 (mmu::FirmwareWindow); the ASC is started, the GPU held
  powered and the boot job retired; clients then submit through the 26.x
  front end (m3_submit), each compute command re-encoded in the 27.2
  layout from a 48-slot pool and published in order. Completion follows
  the queue's retired position. The firmware's event, statistics, log and
  trace rings are consumed as they fill. Render commands get EINVAL.
- driver.rs: a G14G whose DT apple,firmware-version is 27.2.0 takes this
  path, before anything starts the coprocessor.

There are no module parameters. Inputs come from the DT (operating
points, power and thermal properties, apple,coredump-copy-buffer, the
SRAM voltages the loader publishes, the UAT regions), the GPU's ID
registers and the T8112 chip configuration. Unbind stops the firmware
(allow-off, RTKit power-off if it does not stop, ASC halt) and keeps its
memory for the rest of the boot.

Signed-off-by: Satya Benson <satya@benson.earth>
Review asked for no sleep or poll loops where the firmware gives a
signal. The runtime polled from delayed work every 1 ms while busy and
every 20 ms when idle, and dropped every endpoint message.

The firmware sends endpoint 0x20 a message after it publishes event,
statistics or log records. Each message now queues one run of the
service, which consumes the rings and retires completed commands; there
is no idle poll and no timer. The DRM scheduler's job timeout runs the
service once more, so a command the firmware never completes still hits
the command timeout. A firmware crash also runs it.

The service runs on its own ordered workqueue. Stop waits for published
work on a condition variable the service signals, detaches the message
route so nothing queues more work, and drains the workqueue, replacing
the fsleep loops and the fixed 20 ms sleep.

Start waits for the firmware's ready status (+0x14) instead of a fixed
1 s, and fails if the command handlers are not installed in time instead
of ignoring the timeout. Installation is acknowledged by the firmware
clearing the request word (+0x4c24); the old wait also required the
powered-stage word (+0x4c00) to read 2, which it never did after the
handlers were installed, so it always ran out its 500 ms. A failed start
names the step. These and the idle-policy and running-flag waits stay
bounded checks of a shared word: the firmware writes it and sends no
message, as with the existing G14 device-control channel.

The completion stamp is written before the firmware's post-processing
advances the queue's retired position, which sends no message. When the
stamp is there and the position is not, the service waits for the
position for at most 2 ms.

Faster retirement showed that the firmware keeps a retired command's
tracking slot (+0x94) linked for a while, and can link one again after
releasing it; with a fixed round-robin the pool stopped at the first
reuse. Pump now takes the next slot that is neither in flight nor held.
If all are held it kicks the firmware's retirement scan once and the
next notification, submission or scheduler timeout retries; there is no
message for a slot's release.

The stop line reports the notifications received, how often the
position wait ran and how many held slots were passed over.

Signed-off-by: Satya Benson <satya@benson.earth>
…are records it

On phellos (J413, firmware 27.2) the 300-dispatch compute check stalled
at the first pool wrap on most boots: every slot was still linked in the
queue's tracking list (+0x94), so no slot could be reused and the 49th
command timed out (submitted=48 completed=48 skipped-slots=480).

Dumps of the tracking slots at the wrap show why. The firmware records
the value a slot's retirement cursor must reach (+0xc, 1 for every use)
in its post-processing, which can run after the queue's retired
position advances. The service retires a command as soon as the
position moves, so it usually read +0xc as 0 and wrote 0 to the cursor.
The firmware then never unlinked the slot. In the boots that passed,
the read happened to land after the record for one slot; only that slot
was ever unlinked, and the pool reused it for the rest of the run
(skipped-slots near 47 per command). The polled runtime before the
notification rework retired 1 to 20 ms later and usually missed the
window, which is why it mostly passed.

Retirement now advances the cursor only once +0xc is recorded. A slot
retired before that is kept in a pending set, and its cursor is advanced
when the service next runs: on the firmware's next notification,
submission or scheduler timeout. That is no fixed wait. The stop line
counts the deferred cursors.

Signed-off-by: Satya Benson <satya@benson.earth>
With the G14 firmware-27.2 runtime bound, a suspend-to-idle on phellos
(J413) left the GPU unusable. At the wake the GFX power domain did not
come back ("PS gfx: Failed to reach power state 0xf"), and the next GPU
access, a compute dispatch or an unbind, hung a CPU. The driver had no
callback for that sleep. Linux gated the domain under the running
firmware, as on J713 before apple,sleep-retained.

The domain is now kept through the sleep by the device tree
(apple,sleep-retained on the J413 firmware-27 GFX domain). Before
suspend-to-idle, the runtime holds new publications and lets published
commands retire, so the sleep starts with nothing in flight; after the
wake it publishes what was held. The firmware keeps running with its
keep-powered policy. The ASC, the root and every mapping stay as they
are.

Its own power-off handshake (idle policy allow-off before the sleep,
keep-powered after it) was tried and not kept: the firmware crashed in
the wake that followed it.

The sleep is refused (EBUSY) if published work does not retire within
the stop drain time. A sleep that powers the SoC down is still refused:
the firmware would be lost, and this runtime has no cold restart.

Signed-off-by: Satya Benson <satya@benson.earth>
The G14 firmware-27.2 runtime reuses the 26.x submission front end
(m3_submit, agx_uapi and their helpers), so it was built only with
CONFIG_DRM_ASAHI_M3_T8122. Give it its own option, DRM_ASAHI_G14_V27_2
(default y), and build the shared front end when either user is enabled:

- m3/mod.rs: agx_uapi, agx_compute, agx_attachments, agx_memory and
  m3_submit build with DRM_ASAHI_M3_T8122 or DRM_ASAHI_G14_V27_2.
- m3_submit.rs: the M3 sink, queue constructor, render validation, CDM
  launch check, timeout handling and fence-timing profile build only
  with the M3 runtime; without it a render command gets EINVAL.
  task_comm() moves here from m3_client.rs, which now calls it here.
- The G14 path's own code is gated on the new option.

Like the M3 runtime, the option depends on DRM_ASAHI_G15: the firmware's
UAT is adopted through that backend's handoff helpers (Uat::new_adopted,
the G15 UAT table cleaning).

Signed-off-by: Satya Benson <satya@benson.earth>
The G14 firmware-27.2 runtime refuses render commands, but nothing in
GET_PARAMS says so. Graphics userspace therefore takes the device for
GL: on phellos (J413) with the GPU published, kmsro picked the aurora
render node for the internal panel, and the greeter's Hyprland and
sddm-greeter-qt aborted after their first renders failed with EINVAL.

Add DRM_ASAHI_FEATURE_COMPUTE_ONLY (bit 41; bits 39 and 40 are claimed by
open PRs #2059 and #2523) and set it on that runtime. It is a property
of the device, not of a board or chip list: Mesa can decline to create
a graphics screen or a graphics queue on a device that reports it, and
fall back to software rendering, while compute keeps working. Kernels
without the bit keep their current behaviour.

Signed-off-by: Satya Benson <satya@benson.earth>
Stage both ring entries before changing the producers. Store the packet and VM binding in the in-flight list, publish the cursors, then notify the firmware. Keep that ownership if the kick fails or another command in the packet is still in flight.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Close submission admission under the runtime mutex before unbind drains the queue. If staging a later command fails, retain the packet and its VM guard until the already-published prefix retires, then complete the fence with the staging error.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Read each SRAM operating-point voltage from the loader-provided ADT table. Refuse the handoff if the table is absent or inconsistent with the core operating points.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Select the wire layout from the loader compatibility tuple before starting the GPU and pass the register description selected by the GPU compatible.

Notify suspend when the in-flight queue empties. Pending commands stay held until resume, and unrelated wakeups exhaust the original timeout budget.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…h sets

The 27.2 G14 compute start operation keeps the 13.5 G14 StartCompute
positions for its pointers (unk_pointer +0x04, job parameters +0x0c,
stats +0x14, queue +0x1c, VM slot +0x24), and its +0x28 word is at the
place of 13.5's unk_28. The 13.5 path always writes 1 there
(queue/compute.rs); this one wrote 0. With 0, an integer dot-product
kernel and a maximum threadgroup-memory dispatch never retire, and the
GPU is unusable until reboot.

Write 1, as 13.5 does.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The G14 firmware 27.2 runtime refused render commands and reported the
device compute-only. Render work needs a tiler and a fragment command
that the firmware runs on separate engines and that share one scene.

Keep the firmware root and compute bootstrap as they are. Stage both
work rings before a render is published, keep its scene and VM binding
until both engines retire, and let one DRM packet continue across
compute and render commands. Keep the parameter-buffer bindings across
render passes and answer the firmware's growth requests only after the
new backing blocks are published.

The render path reuses the common submission carrier and UAPI parser
with the G14 queue and event layouts, so the device no longer reports
itself compute-only.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Clean initial shared stamps and parameter-buffer counters before publication. Read the firmware-driven stamp after cache maintenance when observing retirement. Keep the tiler event-control index consistent between the record and the start operation, and report queue progress on timeout.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Close submission admission under the runtime mutex before unbind drains the queue. If staging a later command fails, retain the packet and its VM guard until the already-published prefix retires, then complete the fence with the staging error.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Read each SRAM operating-point voltage from the loader-provided ADT table. Refuse the handoff if the table is absent or inconsistent with the core operating points.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Firmware can release a command slot or consume a device-control entry without sending another notification. Recheck those resources on the ordered service queue when progress is blocked and bound the wait before reporting a timeout. Keep a pending growth request on the event ring until its reply is published.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The parameter manager writes the parameter-buffer page and block lists
while the tiler runs, and the firmware rebuilds the page list when the
buffer grows. With the lists in a read-only GPU mapping, the first render
on the J473 (G14G, firmware 27.2) left a pending MMU fault: a write to a
read-only page by the parameter manager, in the client context's VM
slot. The firmware then waited forever for the context's cache flush
after the render, so no host completion stamp was written and later
work stalled.

Allocate both lists from the kernel GPU read-write range, owned by the
buffer, and keep one allocation of that range alive from initialization
so its page tables exist before the firmware window is mirrored. The
13.5 queue keeps its per-VM placement.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Select the wire layout from the loader compatibility tuple before starting the GPU and pass the register description selected by the GPU compatible.

Notify suspend when the in-flight queue empties. Pending commands stay held until resume, and unrelated wakeups exhaust the original timeout budget.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Initialization wrote only the compute engine's kick mask in the G14
firmware 27.2 hardware data. The tiler and fragment masks stayed zero, so
the firmware never gave the tiler a kick slot and the first render never
started on the J473.

Set the tiler mask from the cluster count and the fragment mask from the
active core count, as for compute. Both counts come from the GPU's ID
registers.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On G14 firmware 27.2 the tiler and fragment commands left the job meta's
flush_stamps word clear. The firmware's completion walk then stopped at
those commands: the GPU finished them and reached the firmware stamps,
but the host stamps were never written, the queues never retired, and the
next job timed out.

Set flush_stamps on both render commands, as the G15 firmware 27.2 path
does for every command.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…odes

The render admission shared with the M3 queues refuses stencil
compression outright and admits compressed depth only for one sample
and one layer, the layouts the M3 render path has been qualified for.
The G14 firmware-27.2 queue builds its render command from the same
UAPI fields, and that builder writes the depth and stencil load,
store and partial compression addresses and strides in every layout.

Mesa compresses depth and stencil by default, so every compositor
frame of GNOME Shell (depth/stencil, one sample) and every WebRender
frame of Firefox (4x MSAA, compressed depth) was rejected with
ENOTSUPP on the G14 queue.

Record per queue whether its render command builder carries the
compression words for every sample and layer count, and admit
compression by that property instead of by the M3 envelope. The M3
queues keep their current envelope. The choice follows the command
builder the queue uses, not a chip or firmware version.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The G14 firmware 27.2 runtime builds its records on a GpuManager graph
but drives the firmware over its own RTKit peer, so that graph's
`rtkit` stays None. Its render path still allocates scenes through
GpuManager::alloc(). Once the freed firmware-private objects passed the
collection limit, alloc() flushed the firmware cache with a legacy
device-control message, and the doorbell unwrapped the missing
transport:

  rust_kernel: panicked at gpu.rs:1882:51:
  called `Option::unwrap()` on a `None` value
  ... GpuManager::alloc <- g14_v27_2 Backend::new_queue <- ASAHI_QUEUE_CREATE

Any client that creates enough queues (piglit textureGather here) could
panic the kernel.

Ring every doorbell through helpers that return ENODEV when the manager
has no transport. A device-control message is queued only after the
transport is known, so no caller waits for an answer that never comes.
alloc() now asks whether the manager has device control: without one it
keeps holding freed firmware memory, because reusing it could hand the
firmware stale cached lines. It warns once instead of failing every
allocation. The 27.2 runtime still needs its own cache-flush request
before that memory can be reused.

Add KUnit tests for the collection decision.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
When a render or compute command times out on the G14 firmware 27.2
runtime, the log shows the queue stamps but not whether the GPU took a
page fault. The native firmware path reads the MMU fault status at that
point; this runtime had no register mapping to do the same.

Map the page that holds the fault status registers when the runtime
starts, choosing the registers by the GPU core as the native path does,
and log the status at every timeout. A pending fault is decoded into
address and unit. An empty status says the work stalled without a page
fault.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

MERGETRAIN6 source review at 9884f9b46ea2. Verified that the m2pub1 build b68382cf includes this exact head. Paired render publication stages both queue posts and records the scene and VM binding before committing them. The required handoff SRAM table removes the earlier fallback.

Blocking for default enablement: the tested branch still lacks the adopted UAT teardown clean in current #2543, and the G14 thermal controller still uses fixed policy values. The runtime must use the machine-provided protection policy before enabling. The stop path also retains the firmware graph and all state even when the firmware has already stopped. Please cover rebind and reclaim after a confirmed stop, with quarantine kept for an unconfirmed stop. The J473 desktop, CTS and sleep results can qualify those exercised paths on this build.

Assisted-by: LLM (Codex)

The G14 firmware-27.2 device renders now, but its probe still logged
"compute-only DRM device registered", which reads as if render commands
were refused. Say that the DRM device is registered, and update the
function's comment to match.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 24, 2026 03:30
@RyanTheTide

Copy link
Copy Markdown
Author

Follow-up source review at 027080fdc15b. I missed the retained firmware window in my first pass over the new stop path. start() still forgets that window. Dropping the graph while the boot handoff retains its table references would leave stale roots and can prevent rebind. Please pair reclamation with teardown of the owned window, or keep the graph quarantined while that window survives. A voluntary stop eligible for release also needs a healthy, non-crashed peer and a successful idle-policy request.

The render VM status update and hardware-derived tiling count address those findings. Hold the rebind hardware row for the corrected ownership path.

Assisted-by: LLM (Codex)

@satchlj
satchlj force-pushed the satchlj/g14-v27-2-compute-only branch from 3515e7d to 6a15a79 Compare November 24, 2026 04:33
The release added for a confirmed stop freed the runtime state and the
firmware graph while the boot handoff window, which start() keeps for
the life of the boot, still references the graph's page tables. That
leaves stale roots behind and can break a later bind. Keep everything
the firmware could reach after any stop again, as before, and say why;
releasing it needs the window torn down first.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Bring in the restacked #2610 (6a15a79: #2545 and #2544 on #2543
152822e, the TTBAT slot PoC clean in UatShared::publish_slot). The
#2979 ownership fixes it also carries are already here. The rewritten
#2545/#2610 commits re-add the compute-only refusals (render rejected in
m3_submit, COMPUTE_ONLY feature flag); this series supports rendering,
so those resolve to this series' version. Net change: the #2543 MMU
teardown fix and its retention test only.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Agreed on the retained window: start() keeps the boot handoff window for the life of the boot, so freeing the graph after a stop leaves stale roots. 3cc633f goes back to keeping everything after every stop and says why in the code. Releasing it needs the window torn down first; that is a follow-up, so there is no rebind row for now. The render VM status and tiling cluster fixes stay.

365410a merges the restacked base (#2610 6a15a79, carrying #2545/#2544 on #2543 152822e). The rewritten #2545/#2610 commits re-add the compute-only refusals (render rejected in m3_submit, the COMPUTE_ONLY feature flag), which resolve to this series' version. The net change against 027080f is the #2543 MMU teardown fix and its retention test only, byte-for-byte. asahi_core.o compiles at this head with no warnings in the G14 files.

Assisted-by: LLM (Claude:Opus 5.5)

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

Formal pre-PR checklist re-audit (§1–§6) at live head 365410a463d98cda63322974c95c8bad664efc59 (non-draft; base: satchlj/g14-v27-2-compute-only / #2610 6a15a79e84dc; supersedes review #6033663928 at 027080fdc15b).

Resolved Since 027080fdc15b

  • Lifecycle / stop() window-reclaim UAF & loose reclaim predicate (3cc633f67993): Resolved by reverting 42964d56f523's partial stop() release. Runtime::stop() (drivers/gpu/drm/asahi/g14_v27_2.rs:1049-1055) now unconditionally retains state and self.graph alongside start()'s retained FirmwareWindow (g14_v27_2.rs:388), eliminating the stale ttbs[0]/shared_l2 page-table pointer hazard and removing the unguarded reclaim predicate. fail_all()'s render-pair vm.status().record(error) fix (g14_v27_2.rs:591-594) and 027080fdc15b's num_clusters / sleep-refusal diagnostic fixes remain intact. (For the deferred window-teardown/rebind follow-up: pair FirmwareWindow teardown and PoC-clean of ttbs[0]/shared_l2/handoff magic/lock words with was_healthy && !state.peer.is_crashed() && drained && allowed.is_ok() && running == Ok(0) && forced.is_none().)
  • §3 Safety — #2543 UAT teardown PoC clean (365410a463d9): Resolved in the live tree. 365410a463d9 merges restacked #2610 (6a15a79e84dc) → #2545 (25ac88ae153c) → #2544 (db645f400852) → #2543 (152822e24034), bringing UatShared::clean_poc into UatShared::publish_slot() (drivers/gpu/drm/asahi/mmu.rs:2087-2093) and the teardown check in tools/testing/selftests/drivers/gpu/asahi-m4/test-mmu-retention.py. Merge resolutions in Kconfig, driver.rs, m3/m3_submit.rs, and m3/mod.rs cleanly preserve the render path against 6a15a79e84dc.
  • §4 Attribution & Commit Hygiene + §6 Naming: Pass — all 21 commits in 6a15a79e84dc..365410a463d9 (including 3cc633f67993 and 365410a463d9) carry human author/committer and human Signed-off-by: only, with zero AI trailers in commits; PR body ends with Assisted-by:.

Remaining Blockers (REQUEST_CHANGES)

  1. §3 Safety — hardcoded thermal/alarm literals in RootV27_2::controller() (drivers/gpu/drm/asahi/gpu/v27_2.rs:1198-1206): Unchanged (inherited from #2544). Still writes bare literals (0x22d4, 11000), (0x2284, 900), (0x2288, 4), (0x229c, crate::f32!(1.0).to_bits()), (0x2f30, 125), (0x2f34, 1), and crate::f32!(5.3) per sensor instead of consuming machine-sourced protection values (paired with aura#402 — still at 7eb35d20e1c4 — and linux#2544) and failing closed when absent/malformed.
  2. CI & §5 Evidence:
    • CI on 365410a463d9: source, rust-build, and all 3 DWC3/ATC matrix jobs passed; kunit is still in progress, and host-tests will not run until retargeted onto integration/aurora.
    • §5 Hardware rows: The recorded J473 a2 run predates 42964d56f523–365410a463d9 (including #2543 152822e24034's UAT teardown PoC clean). Need an exact-head J473 run covering the 0/0/0 regression gate (0 SELinux denials, 0 failed units, 0 new kernel errors) and stop/quarantine verification (rebind deferred to the window-teardown follow-up), plus an M2 Air (J413/J415) firmware-27.2 run (§1) before merge.

Non-Blocking Note

  • Commit history (merge vs rebase): Because 365410a463d9 merged 6a15a79e84dc rather than rebasing onto it, 6a15a79e84dc..365410a463d9 still contains pre-restack duplicates of #2545/#2610 (3d8b62c36688, 3515e7d7d030), the #2979 merge commit (6a3cc8250f0e), the reverted 42964d56f523/3cc633f67993 pair, and merge commit 365410a463d9. The net tree diff against 6a15a79e84dc is clean, so this does not block correctness, but rebasing cleanly once #2543–#2610 land will avoid duplicate history.

Assisted-by: LLM (Gemini 4 Neon)

…config

RootV27_2::controller() wrote the fast-die target, its offset, the
SoC-hot alarm and the per-sensor corrections as literals. They are the
values the 13.5 InitData takes from the T8112 chip config, so take them
from there: HwDataA unk_8cc, unk_87c and unk_e24 (cfg.da), and the
corrections from unk_coef_a/unk_coef_b, indexed from the first
fast-die sensor id (7). A sensor without a coefficient refuses the start.
The three remaining words (filter stages, unity scale, alarm enable) are
controller constants that the 13.5 InitData also sets; they are named
here. What the firmware receives is unchanged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>

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

Live re-review (§1–§6) at head ccde92779a5f0c5e52d43e6ae88547b913afea01 (base: satchlj/g14-v27-2-compute-only / #2610 cf19f4e08bd6; follows review #6033776741 at 365410a463d9).

Code & Safety Blocker Cleared

  • Delta (365410a463d9...ccde92779a5f): 4 commits (181fe1878c15 on #2544, cleanly forward-merged through #2545 9ced2862a42a → #2610 cf19f4e08bd6 → #3031 ccde92779a5f), modifying only drivers/gpu/drm/asahi/gpu/v27_2.rs (+21/-6).
  • §3 Safety — RootV27_2::controller() (drivers/gpu/drm/asahi/gpu/v27_2.rs:1197-1221): Resolved.
    • Thermal thresholds and SoC-hot alarm now read from the chip hardware config matching 13.5 InitData: (0x22d4, cfg.da.unk_8cc) (11000), (0x2284, cfg.da.unk_87c as u32) (900), and (0x2f30, cfg.da.unk_e24) (125).
    • Controller constants matching 13.5 InitData are named/commented: FILTER_STAGES = 4 (0x2288), unity 1.0 (0x229c), ALARM_ENABLE = 1 (0x2f34).
    • Per-sensor corrections (FIRST_SENSOR = 7, cfg.unk_coef_{a,b}.first().ok_or(EINVAL)?) map each active sensor bit sid via sid.checked_sub(7).and_then(|i| coef.get(i)).ok_or(EINVAL)? into 0x2320/0x2420 (coef_a) and 0x2f38/0x3038 (coef_b) at + 4 * sid. Verified on T8112 (hw/t8112.rs, fast_sensor_mask = [0x6800, 0], active bits {11, 13, 14}): sid - 7 indexes {4, 6, 7} → writes exact 5.3 bits to all 12 words (+0x2c, +0x34, +0x38 on each base), matching prior wire output byte-for-byte. Fails closed with EINVAL on missing coefficient tables, sid < 7, or out-of-bounds sid >= 7 + coef.len(), in addition to build() validating sensors != 0, sensors >> 32 == 0, and fast_sensor_mask_alt[0] == sensors.
  • Stack parity: #2544 (181fe1878c15), #2545 (9ced2862a42a), #2610 (cf19f4e08bd6), and #3031 (ccde92779a5f) are all in sync with no force-pushes.
  • §4 Attribution & Commit Hygiene / §6 Naming: Pass — all 22 commits in cf19f4e08bd6..ccde92779a5f (and the 3 upstream commits in the stack) carry human author/committer and human Signed-off-by: only, with zero AI trailers in commits.

Remaining Pre-Merge Gates (Holding APPROVE)

All source/safety blockers on #3031 are cleared; leaving this as COMMENT pending:

  1. CI: On ccde92779a5f, 5/6 checks are SUCCESS (source, rust-build, and all 3 DWC3/ATC matrix jobs); kunit is still IN_PROGRESS, and host-tests will run once #2543 → #2544 → #2545 → #2610 land and #3031 retargets integration/aurora.
  2. §5 Evidence & §1 Coverage: Exact-head J473 run covering the 0/0/0 regression gate (0 SELinux denials, 0 failed units, 0 new kernel errors) and stop/quarantine verification, plus an M2 Air (J413/J415) firmware-27.2 run before merge.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Author

J473 (M2 mini, G14G, GPU firmware 27.2) exact-head row, PASS.

Tested assembly: integration/aurora + this PR at ccde927 (which carries #2544 181fe18, #2545 9ced286, #2610 cf19f4e and #2543 152822e), the J473 DT from #3038, and a Stage 2 of aura main + aurora-silicon/aura#402 7eb35d20. One-shot boot on the default command line, on the Fedora 45 root, then restored to production.

  • GNOME composites on the GPU: GL renderer and Vulkan device are Apple M2 (G14G B0), and glxgears runs at 60 FPS.
  • Vulkan CTS depth/stencil + MSAA set: 384 pass, 0 fail, 248 not supported (the same totals as the earlier row).
  • s2idle (15 s RTC wakes) 3/3 with the GFX domain retained: same GNOME shell PID after each sleep, and vkcube and the triangle pass after each.
  • 0 GPU faults and 0 AVC denials.
  • apple,no-auto-pm comes from the same Stage 2 transaction that enables the GPU, so the GPU being enabled means it was set. A direct readback is still to come.

Still to run: one G13/G14 no-regression row with this kernel (M1 Pro or the M2 Air on 13.5), queued.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Author

J473 (M2 mini, G14G, GPU firmware 27.2) row on the merge candidate kernel, PASS.

Kernel: the combined candidate (source adec412c = integration/aurora tip with this series at ccde927, i.e. #2543 152822e + #2544 181fe18 + #2545 + #2610, without the optional recovery PR). Stage 2: aura main + aurora-silicon/aura#402 7eb35d20 with the #3038 J473 DT. One-shot boot on the default command line, Fedora 45 root, then restored to production.

  • GL renderer and Vulkan device: Apple M2 (G14G B0). glxgears runs at 60 FPS and GNOME composites on the GPU.
  • Vulkan CTS depth/stencil + MSAA set: 384 pass, 0 fail, 248 not supported.
  • s2idle 3/3 (15 s RTC wakes): same GNOME shell after each sleep, and vkcube and the triangle pass after each. Both monitors stay connected and active before and after every sleep (2560x1440@60 + 1920x1080@120).
  • Live DT on the GPU's power domain: apple,no-auto-pm and apple,sleep-retained are both present.
  • 0 failed units, 0 GPU faults, 0 AVC denials.

Assisted-by: LLM (Claude:Opus 5.5)

Bring the branch up to integration/aurora after the shared teardown fix (#2543) landed. The only conflict is the asahi Makefile object list: keep rtkit_dump.o from this series and the G18 objects from integration.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
# Conflicts:
#	drivers/gpu/drm/asahi/Makefile
The only conflict is the uapi feature-bit block: keep integration's ASYNC_SUBMIT (39) and VDM_USC_INVALIDATE (40) and this series' COMPUTE_ONLY (41).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide changed the base branch from satchlj/g14-v27-2-compute-only to integration/aurora November 24, 2026 07:15

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

Live §1–§6 check at exact head a9dd23085b46d394a11d9b236c6a05c2f66de6fc (retargeted to integration/aurora; follows review #6034024727 at ccde92779a5f).

Verified & Cleared

  • Source & §1–§3 Safety: All code and safety blockers remain clear (RootV27_2::controller() machine-sourced config from #2544 181fe187, #2543 152822e2 UAT teardown PoC clean now merged into integration/aurora, fail_all() VM fault status fix, and stop() quarantine).
  • J473 combined hardware row (#7124597018, adec412c / ccde9277): Strong exact-tree J473 proof on default cmdline — Apple M2 (G14G B0) GL + Borealis Vulkan, Vulkan CTS 384 pass / 0 fail / 248 unsupported, s2idle 3/3 (15 s RTC wakes) with both monitors active before and after each sleep, live DT readback confirming both apple,no-auto-pm and apple,sleep-retained, 0 failed units, 0 GPU faults, and 0 AVC denials.
  • §4 Attribution & §6 Naming: Human authors/committers (Satya Benson, Ryan Murray) and 0 AI commit trailers across all PR commits; clean naming. (Minor §4 hygiene note: merge commit f9e7bab09d62 pulled from #2544 omits a Signed-off-by: line; all other commits including a9dd23085b46 carry human Signed-off-by:.)

Remaining Pre-Merge Gates (Holding APPROVE)

  1. CI on a9dd23085b46: Still IN_PROGRESS (source, DWC3/ATC builtin-no-atc, and DWC3/ATC modular-no-atc are SUCCESS; rust-build, kunit, and DWC3/ATC builtin-modular-atc are IN_PROGRESS; host-tests not yet reported on the retargeted base).
  2. Stacked base PRs still OPEN: #2543 merged (c4b7fb9544bd), while #2544 (f9e7bab09d62), #2545 (5f998a4db430), and #2610 (79ef6bcb531f) remain OPEN (carried in #3031 by ancestry).
  3. §5 Kernel-error delta & 13.5 no-regression row:
    • The linked #3038#issuecomment-7124690376 notes 32 kernel err-level messages on combined candidate adec412c0223 vs 15 on the saved control without classifying the +17 extra lines to confirm 0 new kernel errors from this series.
    • The queued G13/G14 (13.5) no-regression row on the post-181fe187 / ccde9277 kernel (M1 Pro or J413 13.5, noted in #7123286629) has not yet been posted (and M2 Air 27.2 remains unrun in lab).

Ready to flip to APPROVE once CI finishes green on a9dd23085b46, the base stack coordination is settled, and the kernel-error classification + 13.5 no-regression row are posted.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide
RyanTheTide merged commit c67c44a into integration/aurora Nov 24, 2026
6 checks passed
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.

3 participants