Repository navigation
drm/asahi: accept FRAGMENT_BARRIERS on G13 and G14 - #2637
RyanTheTide wants to merge 1 commit into
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 G13/G14 backend. 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. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Looks good; approve once the soak row below is posted. I checked the barrier handling in drivers/gpu/drm/asahi/queue/mod.rs at 7450be6.
The commit message carries an HW row: M1 Pro (G13S) and M2 (G14G), this kernel with Mesa setting the flag. Run at least 1 h of concurrent short-lived multi-context rendering, e.g. several deqp-vk render-ordering and gpubench render.heavy processes in parallel. Pass if there are 0 GPU faults, firmware crashes or timeouts, and the regression run shows 0 AVC denials, 0 failed units and 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at 7450be6: BLOCKERS. Not merging until the blockers below are fixed or answered; the details give file:line and a failure case. Full review#2637 drm/asahi: accept FRAGMENT_BARRIERS on G13 and G14 @7450be6aVERDICT: BLOCKERS Blockers
Code checks
Nits
Missing rows
|
|
Clarification to my merge-train review above: the commit-trailer point is a nit, not a blocker (already-pushed history stays as it is, no force push). The other blockers listed there still stand. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review (§1–§6) at 7450be6a5aa3: REQUEST_CHANGES.
Blockers
- §4 Attribution (hard): Commit
7450be6a5aa3carries anAssisted-by: LLMtrailer in the commit message. Per §4, commits must carry human author/committer and humanSigned-off-by:only, with zeroCo-Authored-By:orAssisted-by:trailers in commits (Assisted-by:belongs only at the end of the PR body). - §5 Evidence & §1 multi-Mac proof (missing rows):
- All posted gpubench / Vulkan CTS / vkmark rows predate the rebase onto
integration/aurora c3d01cbd; no hardware run is posted at the live head7450be6a5aa3. - Missing the requested >= 1 h concurrent short-lived multi-context soak on M1 Pro (G13S) and M2 (G14G) with 0 GPU faults, firmware crashes, or timeouts, plus complete §5 regression counts (0 AVC denials, 0 failed units, 0 new kernel errors — the PR body omits failed-unit and new-kernel-error counts).
#[versions(AGX)](rust/macros/versions.rs:95) also advertisesDRM_ASAHI_FEATURE_FRAGMENT_BARRIERSon G14X (M2 Pro/Max), which is not mentioned in the title/commit message and has no hardware row (nor do M1 base G13G / M1 Max/Ultra G13C/D).
- All posted gpubench / Vulkan CTS / vkmark rows predate the rebase onto
Verified code & checks
drivers/gpu/drm/asahi/gpu.rs:388-394,1550-1552:backend_feature_flags()defaults to0and is overridden only on#[versions(AGX)] impl Gpu for GpuManager::ver;m3/g15overridefeature_flags(), andg16/g17/g18/m5inherit0.drivers/gpu/drm/asahi/queue/render.rs:54-60:DRM_ASAHI_RENDER_FRAGMENT_BARRIERSis validated inget_tiling_params(), covering both the TVB pre-pass andsubmit_render().drivers/gpu/drm/asahi/queue/mod.rs:1245-1353:events[SQ_RENDER][0]is the queue's priorq_fragevent (mod.rs:1125-1128) and subsequent entries are this submission's fragment events (mod.rs:1342-1353); invalidvdm_barrierindices still fail withEINVALbefore deferringrender_wait;cdm_barrierstill attaches tojob.get_vtx()?; non-FRAGMENT_BARRIERSrenders still emit the vertex barrier beforesubmit_render();FRAGMENT_BARRIERSrenders rely on in-orderq_fragexecution plus each render's own vertex->fragment barrier (render.rs:343-361).- CI:
host-testsis green on7450be6a5aa3(local arm64LLVM=1 W=1build and KUnit 323/324 reported in PR body).
Nits
drivers/gpu/drm/asahi/queue/mod.rs:1240-1244: the comment still says the wait "goes on the fragment queue", contradicting lines 1299–1302 and the code, which drops the explicit barrier entirely.drivers/gpu/drm/asahi/queue/mod.rs:1306-1329: duplicates the explicit barrier allocation/init/add block from lines 1260–1285 verbatim; factoring a small helper avoids drift.- Update title/commit message to reflect G14X coverage as well as G13/G14.
Assisted-by: LLM (Gemini 4 Neon)
|
Replaced by #2785: one clean commit on integration/aurora f5f023b (human identity + Signed-off-by only), title/commit now name G14X, the stale comment is fixed and the duplicated barrier block is one helper. Builds clean with W=1. Rows at the new head (M1 Pro + M2: gpubench, CTS subset, >= 1 h multi-context soak, full regression counts) will be posted on #2785. Closing this one; no force push here. Assisted-by: LLM (Claude:Opus 5.5) |
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)