Repository navigation
drm/asahi: keep the render wait of fragment barriers on G13 and G14 - #3100
Conversation
Since commit 24a7cfa ("drm/asahi: accept FRAGMENT_BARRIERS on G13, G14 and G14X"), a render command that sets DRM_ASAHI_RENDER_FRAGMENT_BARRIERS gets no wait at all for the earlier renders its barriers name. The legacy queue relies on the fragment workqueue running that work first, but queue order alone does not make it finish first. Mesa's Gallium driver started setting the flag on render passes that sample the previous pass's output, and on M1 Pro and M2 Air gpubench-gl render.postfx then reads that output before it is complete: the image is wrong and changes from run to run. The UAPI says the dependencies of such a render are attached to its fragment half instead of its vertex half. Do that: add the explicit barrier to the fragment job, which already waits for its own vertex job the same way. The vertex half still runs beside the earlier fragment work, which is the point of the flag. Kernels with 24a7cfa report DRM_ASAHI_FEATURE_FRAGMENT_BARRIERS but drop the wait, so userspace cannot tell them apart by that bit. Add DRM_ASAHI_FEATURE_ORDERED_FRAGMENT_BARRIERS (bit 44), which says the fragment half does wait, and report it on this backend and on G17, whose firmware fragment barriers already carry the render dependencies. Fixes: 24a7cfa ("drm/asahi: accept FRAGMENT_BARRIERS on G13, G14 and G14X") Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
|
J773g (T8132, Apple M4, G16G B0): correctness PASS, depth-1 postfx performance regression. The geometry throughput gain did not reproduce.
The earlier same-kernel ABBA also showed d1 regressions of 33.33% and 27.91% and overlapping geometry ranges. The d2 MSAA 1 result changed direction between runs. The separate installed-stack baseline ( Final run: 12/12 verified commands per arm, and 3/3 on the installed stack. Both private Mesa builds gave matching postfx CRCs |
|
Paired
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Verdict at a28f61ac8811
Approve. Re-attaching render_wait to the fragment job fixes the missing dependency on G13/G14/G14X without blocking vertex overlap, and adding DRM_ASAHI_FEATURE_ORDERED_FRAGMENT_BARRIERS cleanly separates fixed kernels from 24a7cfa37871 for userspace.
Blockers
None.
Checked
- 4 changed files (
include/uapi/drm/asahi_drm.h,drivers/gpu/drm/asahi/gpu.rs,drivers/gpu/drm/asahi/g17/mod.rs,drivers/gpu/drm/asahi/queue/mod.rs) audited in full. - UAPI & backend coverage:
DRM_ASAHI_FEATURE_ORDERED_FRAGMENT_BARRIERS(1ULL << 44) is advertised on the exact two backends that advertiseDRM_ASAHI_FEATURE_FRAGMENT_BARRIERS(gpu.rsfor G13/G14/G14X andg17/mod.rsfor G17; verifiedg15,g16,g18do not advertiseFRAGMENT_BARRIERS). - Queue ordering fix:
queue/mod.rsmoves the explicitrender_waitbarrier tojob.get_frag()?whenDRM_ASAHI_RENDER_FRAGMENT_BARRIERSis set (keepingjob.get_vtx()?otherwise) instead of dropping it, preserving vertex overlap while ensuring fragment execution waits on earlier render barriers. - CI & trailers:
host-tests,readiness / readiness, andpr-text / pr-textallSUCCESS; commit carriesFixes: 24a7cfa37871and cleanSigned-off-by:with no AI trailers; exact-heada28f61ac8811paired hardware verification is posted for J316s (G13S C0), J413 (G14G B0), and J773g (G16G B0). - Untested scope: Static code audit only (userspace-only review environment; no kernel build or boot performed here).
Evidence
- Checked
drivers/gpu/drm/asahi/{gpu.rs,g15/mod.rs,g16/mod.rs,g17/mod.rs,g18/mod.rs,queue/mod.rs}andinclude/uapi/drm/asahi_drm.hata28f61ac8811. - CI at head
a28f61ac8811:host-testsSUCCESS,readiness / readinessSUCCESS,pr-text / pr-textSUCCESS.
What: Keep the render dependency when a command asks to wait only in its fragment half on G13, G14 and G14X. This prevents a post-processing pass from sampling the previous pass before it finishes and gives userspace a feature bit for the corrected behavior.
Tested: Fedora aarch64 compile and link at
a28f61ac88117858ee2a9502e0c7447b70743f44passed, includingImage,vmlinuxandaurora.ko.Risk: One-way UAPI addition for G13, G14, G14X and G17. The queue change affects G13, G14 and G14X.
Not yet:
render.postfxhardware confirmation on J316s and J413, plus a regression run on J773g.Details
Kernel commit
24a7cfa37871exposed fragment barriers on the legacy backend. For a flagged render it omitted the explicit wait on prior render work. Attach the wait to the fragment job so the vertex half can overlap the previous render. AdvertiseDRM_ASAHI_FEATURE_ORDERED_FRAGMENT_BARRIERSon this backend and on G17, where the firmware already carries the dependency.Thanks to Ryan and the PEER-ROWS testers for isolating the failure on J316s and J413.
Evidence
83150137f7fe(pass) to3fc1b773a416(fail). The failing runs have varying CRCs and pass withASAHI_MESA_DEBUG=sync.aurora.ko.EGL_PLATFORM=surfaceless gpubench-gl --test render.postfx --param res=1080p --param msaa=1 --depths 1 --warmup-ms 20 --runs 2 --run-ms 100 --timed-runs 1 --verify. Run three times and recordvalid, CRC and GPU faults.