Repository navigation
drm/asahi: accept FRAGMENT_BARRIERS on G13, G14 and G14X - #2785
Conversation
The legacy queue puts a render's wait for earlier renders on its vertex queue, so the tiling of render N+1 cannot start until the fragment work of render N has finished, even when only the fragment half of N+1 depends on it. Advertise DRM_ASAHI_FEATURE_FRAGMENT_BARRIERS on the backend shared by G13 (M1 family), G14 (M2) and G14X (M2 Pro/Max/Ultra): the #[versions(AGX)] GpuManager implementation. For a render carrying DRM_ASAHI_RENDER_FRAGMENT_BARRIERS that wait names only earlier fragment work of the same queue, which its fragment workqueue already runs first, so no barrier is added at all. The fragment half still waits for its own vertex half, and compute dependencies keep ordering the vertex half. The explicit barrier is now built in one helper, add_explicit_barrier(), used for both the deferred render wait and the other queue barriers. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed 24a7cfa37871f2e168abf5332fcf394300a88745 against pre-pr-checklist.md (§1–§6): REQUEST_CHANGES (code and §1–§4/§6 are clean; blocked on §5 hardware evidence and CI completion on this head).
What looks good
- Barrier semantics (
drivers/gpu/drm/asahi/queue/mod.rs):events[SQ_RENDER][0]is the queue's own priorq_fragevent and subsequent entries are earlier renders of the same submission, all ordered by the in-order fragment workqueue. DeferringSQ_RENDERwaits forDRM_ASAHI_CMD_RENDERand omitting the explicit barrier whenDRM_ASAHI_RENDER_FRAGMENT_BARRIERSis set matchesuapi/drm/asahi_drm.hwhile preserving barrier index validation,cdm_barriervertex ordering, and unchanged vertex barriers when the flag is absent. - Prior
#2637review nits addressed: Explicit barrier creation is cleanly factored intoQueue::ver::add_explicit_barrier(), and the comment above the barrier loop now accurately matches the implementation. - Backend scoping & flags (
gpu.rs,queue/render.rs):backend_feature_flags()on#[versions(AGX)] impl Gpu for GpuManager::vercleanly advertisesDRM_ASAHI_FEATURE_FRAGMENT_BARRIERSonly for G13/G14/G14X without affectingm3/g15(which overridefeature_flags()) org16/g17/g18/m5(default0).get_tiling_params()admitsDRM_ASAHI_RENDER_FRAGMENT_BARRIERSand the flag bit is never forwarded raw to firmware. - §1 / §2 / §3 / §4 / §6: Clean. No chip/board/fw gates, no cmdline/module params, no hardcoded safety constants, single clean commit with human author/committer and
Signed-off-by:only (PR body carriesAssisted-by:), Borealis naming clean.
Blockers before approval
- §5 Live hardware verification on
24a7cfa3(still pending): As noted under Still to run, the performance and CTS rows in<details>predate the rebase ontointegration/aurora(f5f023bc) and theadd_explicit_barrier()refactor, and no soak row has been posted yet. Before approval, please post exact-head (24a7cfa3) rows on default kernel command line for M1 Pro (G13S) and M2 (G14G):- Same-machine A/B
gpubench+ 2,402-case Vulkan CTS render-ordering subset (conformance unchanged); - ≥ 1 h concurrent short-lived multi-context soak with Mesa setting
DRM_ASAHI_RENDER_FRAGMENT_BARRIERS(important given G13S's concurrent short-lived context TE/firmware-crash sensitivity) confirming 0 GPU faults, 0 firmware crashes, 0 timeouts; - Full regression row (0 SELinux/AVC denials, 0 failed units, 0 new kernel errors).
(Good disclosure that G14X / G13G / G13C/D are not in the lab and rows from owners are welcome.)
- Same-machine A/B
- CI (
Host tests / host-tests): StillIN_PROGRESSat review time; needs to finish green on24a7cfa3.
Assisted-by: LLM (Gemini 4 Neon)
|
The exact-head kernel kit for A G14X row on an M2 Pro or Max would complete the hardware coverage. Please use a guarded one-shot with the default kernel command line and report the interleaved gpubench comparison, the 2,402 CTS case results, and a one-hour concurrent render soak. Include GPU faults, new kernel errors, SELinux denials and failed-unit counts. The M1 Pro and base M2 runs are underway. |
|
At
The CTS status files matched case for case. Two contexts ran concurrently during each soak. The periodic checks showed zero GPU fault markers and audit denials, and neither Mac had any failed units. Some M1 Pro depth-one samples varied across arms, so the table reports the stable depth-16 geometry and depth-4 TVB rows. Each lean test kernel logged one new |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-reviewed 24a7cfa37871f2e168abf5332fcf394300a88745 against pre-pr-checklist.md (§1–§6): APPROVE.
All blockers from the earlier review are now satisfied on exact head 24a7cfa37871f2e168abf5332fcf394300a88745:
- CI (
Host tests / host-tests):SUCCESSon24a7cfa37871f2e168abf5332fcf394300a88745. - §5 Hardware evidence on
24a7cfa3(default/saved fleet command line, guarded one-shots, same Borealis build for both arms):- Interleaved A/B
gpubenchshows large, consistent speedups on both G13 and G14:- 1080p geometry, depth 16: M1 Pro (G13X)
339.93 → 162.66 µs/submit, M2 (G14G)553.10 → 290.70 µs/submit. - 32K-triangle TVB, depth 4: M1 Pro (G13X)
3378.38 → 2057.93 µs/submit, M2 (G14G)5263.74 → 2747.25 µs/submit.
- 1080p geometry, depth 16: M1 Pro (G13X)
- 2,402-case Vulkan CTS render-ordering subset:
833 pass, 1,569 not supported, 0 failon both settings on both Macs, with status files matching case-for-case. - > 1 h concurrent multi-context render soak:
3602 son M1 Pro and3603 son M2 (2 concurrent contexts, 89 successful runs per context), with 0 GPU fault markers, 0 audit/SELinux denials, and 0 failed units.
- Interleaved A/B
- §1 / §2 / §3 / §4 / §6: Remain clean (single commit with human authorship and
Signed-off-by:only, PR bodyAssisted-by:disclosure, Borealis naming, clean#[versions(AGX)]scoping viabackend_feature_flags()).
Non-blocking notes
- Clean-boot BTF check (
bpf-restrict-fs): The singlebpf-restrict-fsstartup error on both lean test kernels is attributable to the lean test config lacking/sys/kernel/btf/vmlinux(CONFIG_DEBUG_INFO_BTF), unrelated to the 3drivers/gpu/drm/asahi/files touched here. Posting the fleet-BTF rebuild clean-boot result (0new kernel errors) before fleet batching is appreciated, though not a code blocker. - G14X (M2 Pro/Max) coverage: G14X instantiates the exact same
#[versions(AGX)]GpuManager::ver/Queue::verbackend (GpuManagerG14XV13_5indrivers/gpu/drm/asahi/driver.rs) already proven on both G13 (M1 Pro) and G14G (M2). Since G14X is not in the lab and a test kit + call for runs has already been posted per §1, this does not block approval; a follow-up G14X confirmation row from an owner remains welcome.
Assisted-by: LLM (Gemini 4 Neon)
|
Merge-train adversarial review (MERGETRAIN-LINUX3) at 24a7cfa: no blockers. Merges clean on integration/aurora 933a43f. Full reviewVERDICT: NO BLOCKERS Checked:
Nits:
Missing rows:
|
|
Fleet-BTF follow-up at exact reviewed source On each host, CTS status lists were identical with fragment barriers off and on (833 Pass, 1,569 NotSupported, zero failures). The two concurrent render contexts ran for 324 seconds per host and completed eight runs each with empty error logs. These are the fleet-BTF rechecks. The one-hour runs are recorded in the earlier comment. G14X is still open. Please use the fleet-BTF image and matching SHA-256 from the draft test kit. |
Replaces #2637 (and before it #1811). Same change as #2637 7450be6, rebuilt as one clean commit on integration/aurora f5f023b: the commit carries human identity and
Signed-off-by:only (the old commit had anAssisted-by:trailer, and history is never force-pushed, so the fix is a new branch).Problem
On G13/G14/G14X the legacy queue puts a render's wait for earlier renders on its vertex (tiling) queue, so the tiling of render N+1 cannot start before the fragment work of render N has finished, even when only the fragment half of N+1 depends on it.
Change
DRM_ASAHI_FEATURE_FRAGMENT_BARRIERSon the#[versions(AGX)]backend. That backend serves G13 (M1 family), G14 (M2) and G14X (M2 Pro/Max/Ultra); the title and commit message now say so. G15 and later are unchanged (m3/g15overridefeature_flags();g16/g17/g18/m5keep 0).DRM_ASAHI_RENDER_FRAGMENT_BARRIERS, thevdm_barrierwait names only earlier fragment work of the same queue, which the fragment workqueue already runs first, so no barrier is added. Renders without the flag are unchanged.add_explicit_barrier(), instead of two copies.Testing
drivers/gpu/drm/asahi/builds clean on this head withW=1(arm64, clang 22.1.6, rustc 1.97.1, fleet79 config): 0 warnings, 0 errors.Still to run (on this head)
Earlier rows and detail from #2637
Replaces #1811, rebased onto current integration/aurora (conflicts in drivers/gpu/drm/asahi/queue/render.rs: the base moved the render flag and size checks from submit_render() into get_tiling_params(), so FRAGMENT_BARRIERS is added to the accepted flags there. Only the net commit 6a743fa is carried; the two cpufreq commits and their reverts cancel out and are dropped).
G13/G14: the legacy queue puts a render's wait for earlier renders on its vertex (tiling) queue, so the tiling of render N+1 cannot start before the fragment work of render N has finished, even when only the fragment half of N+1 depends on it.
This advertises the existing
DRM_ASAHI_FEATURE_FRAGMENT_BARRIERSon the G13/G14 backend. For a render withDRM_ASAHI_RENDER_FRAGMENT_BARRIERS, the wait named byvdm_barrieronly refers to earlier fragment work of the same queue (index 0 is the queue's last fragment event, later indices are renders of the same submission). The fragment workqueue already runs that work first, so no barrier is added. Each fragment half still waits for its own vertex half, and compute dependencies keep ordering the vertex half. Renders without the flag are unchanged.Userspace: mesa Borealis sets the flag on serialized G13/G14 queues only when the recorded dependencies show the vertex half reads nothing an earlier render produced (aurora-silicon/mesa#265).
Results (gpubench 0dae261, us per submission, lower is better; same boot, Mesa with the flag off vs on, two interleaved runs each, which agree within 1%):
Vulkan CTS 1.4.7.0: a 2,402-case render-ordering subset (synchronization2 graphics write -> vertex/fragment/indirect reads, pipeline barriers, transform feedback, renderpass2 suballocation, occlusion queries) is case-for-case identical with the flag off and on, on both Macs (833 Pass / 1569 NotSupported / 0 Fail). On the M2 a 46,515-case broad run (api, query_pool, synchronization, synchronization2, ubo, glsl, texture, graphicsfuzz, ssbo, transform_feedback.simple, draw indirect) is also case-for-case identical (20947 Pass / 25564 NotSupported / 4 QualityWarning in both / 0 Fail).
vkmark: M1 Pro 10463 -> 10492, M2 8541 -> 8641. 0 AVC denials, no GPU faults or timeouts.
Rebased onto integration/aurora c3d01cb (2026-11-21):
drivers/gpu/drm/asahi/builds for arm64 (LLVM=1,W=1, defconfig +asahi.config) with no warnings in the touched files; KUnitasahi*on arm64 qemu 323/324 passed (1 unrelated skip), includingasahi_render_tiling_params4/4;run-host-tests.py --onlylegacy-frequency 1/1, agx-stats-busy 2/2, asahi-stats-raw 1/1;checkpatch.pl --strictclean.Assisted-by: LLM (Claude:Opus 5.5)