Repository navigation
drm/asahi: g17: allow inline cross-engine publication behind already-published producers - #3390
DjDeveloperr wants to merge 4 commits into
Conversation
…published producers Previously Queue::enqueue() added every cross-engine firmware producer's drm_sched scheduled fence to the consumer's dependencies, and both try_compute_early() and try_render_early() gated on has_dependencies() (which includes firmware completion fences). As a result, every cross-engine command fell off the inline publication path onto drm_sched even when its producer had already been published inline in the same ioctl or had already signalled scheduled, leaving cross-engine workloads at 0% inline publication and adding a scheduler wakeup plus firmware cold-start stall on C->R and R->C transitions. Track whether Scheduler::enqueue() published a command inline, omit scheduled dependencies for producers that are already published (inline or scheduled fence signalled), gate early inline publication on host dependencies only (has_host_dependencies()), and check check_firmware_producers() before inline publication so failed producers propagate unpublished errors cleanly. Add a compiled host test with mutation traps covering producer scheduled-wait filtering, host vs firmware early-publication gating, and failed-producer error propagation. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Fences::inline_published currently copies try_early()'s boolean, but that boolean is also true when the early path handles a terminal failure before any firmware publication. The consumer now uses this field to omit its scheduled-fence wait. Track actual firmware visibility separately from an early attempt that handled an error, or show that the exact fence stored in firmware always exposes the terminal failure before the consumer can skip the wait. Test an early failed producer followed by a cross-engine consumer. Current-head isolated A/B, peer evidence and CI remain open.
…ished try_early() returns true both when a command was published inline to firmware and when it handled a terminal unpublished error before hardware publication. Gate Fences::inline_published on inline && packet.is_published() so an early unpublished producer failure never causes a cross-engine consumer to omit its scheduled-fence wait. Extend g17-inline-cross-engine-tests.py with an early-failed producer followed by a cross-engine consumer and the copy-try-early-bool mutation. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
The inline hint now checks the packet publication state in addition to whether the early path handled the job. The acquire read pairs with the release store for actual publication, so a handled error before publication cannot omit the consumer's scheduled-fence wait. I ran the exact-head host fixture and verified that the copy-try-early-bool mutation fails on the new assertion for that case. Code approved. Keep held for hosted CI and exact isolated hardware A/B plus the affected peer.
|
J700 (MacBook Neo, Apple A18 Pro
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD for hosted CI and final-stack hardware qualification.
Checked: The inline submission file and its fixture retain their reviewed blobs. The changes in the overlapping files are the incoming priority workqueue setup, sync-vector type and teardown rescan stop. The merged host runner keeps the inline fixture and its producer-state controls. The prior combined J700 pass covers the older heads. Please keep the isolated comparison and peer evidence on the landing stack.
Resolve against main's timestamp-free publication chaining (#3319): carry both the inline_published flag and timestamp_waits in Fences, and both firmware_published and inherited_timestamp_waits through EnqueueOrdering. Main's new firmware wait for a timestamp-free producer now records its inline_published flag too, so the two vectors stay paired in the zip in Queue::enqueue(). Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD at 85ecbc6d51e6
Blockers:
- Hosted CI at
85ecbc6d51e6is still queued (21jobs queued:apple-build,host-tests,pr-text,readiness, and KUnit suites includingasahi_g17_cross_engine_timestamps) — wait for all checks to complete green. - Exact-head G17 hardware verification row at
85ecbc6d51e6after integrating#3319's timestamp-free publication chaining (existing combined J700 pass covers pre-merge513edcf4).
Checked:
- Audited the full 6-file diff (
+416/-7,MERGEABLEagainstmain) and the non-trivial merge resolution against#3319indrivers/gpu/drm/asahi/g17/queue/mod.rs:- Verified every
firmware.push()site inEnqueueOrdering::build()(both the timestamp-free producer branch and the non-wait branch) pushes a matchingentry.inline_published()intofirmware_published, keepingordering_firmware_waitsandordering_firmware_publishedstrictly paired for the.zip()loop inQueue::enqueue(). - Verified
Fences::inline_published(inline && packet.is_published()),Packet::has_host_dependencies(),try_compute_early()/try_render_early()check_firmware_producers()error handling, andtools/asahi/run-host-tests.py(g17-inline-cross-engine-tests.py+ all 6 mutations) remain intact.
- Verified every
Evidence
- Head:
85ecbc6d51e6c589d2f072ad5be415494b649d95(basemain,MERGEABLE). - Status checks at review time: 21 queued, 3 skipped, 0 failed.
RyanTheTide
left a comment
There was a problem hiding this comment.
Reviewed the conflict-pass merge commit 85ecbc6 only: firmware-wait flag pairing checked: every firmware.push has a matching firmware_published.push in both branches, zipped with ordering_firmware_published; inline_published defaults to false on the trait. The resolution keeps what each side had and adds nothing outside the conflict. Approved for the merge-up; merging still waits on CI and the rows at this head.
There was a problem hiding this comment.
Verdict: MERGE at 85ecbc6d51e6
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited the full 6-file diff (+416/-7, MERGEABLE against main) and the non-trivial merge resolution against #3319 in drivers/gpu/drm/asahi/g17/queue/mod.rs:
- Verified every
firmware.push()site inEnqueueOrdering::build()(both the timestamp-free producer branch and the non-wait branch) pushes a matchingentry.inline_published()intofirmware_published, keepingordering_firmware_waitsandordering_firmware_publishedstrictly paired for the.zip()loop inQueue::enqueue(). - Verified
Fences::inline_published(inline && packet.is_published()),Packet::has_host_dependencies(),try_compute_early()/try_render_early()check_firmware_producers()error handling, andtools/asahi/run-host-tests.py(g17-inline-cross-engine-tests.py+ all 6 mutations) remain intact.
Follow-ups (not blocking): queued CI; exact-head G17 row after #3319 merge
|
We carry this PR in our J716c (M5 Max, T6050) daily kernel. Without inline cross-engine publication behind already-published firmware producers, cross-engine render/compute consumers were forced onto the Running smoothly on our J716c daily kernel with no GPU faults or regressions. |
What: Allow G17 inline (
try_render_early/try_compute_early) publication of cross-engine consumers behind producers that are already published to firmware, instead of forcing every cross-engine consumer onto thedrm_schedworker thread.Fences::inline_publishedand omit addingproducer.scheduledto a consumer's hostdependenciesinQueue::enqueue()when the producer was already inline-published or itsscheduledfence is already signaled (fence_status > 0).producer.completedhost waits intact (query-access computes and timestamped writers still wait on the host; orthogonal to drm/asahi: g17: keep timestamp writers behind cross-engine publication #3246).try_compute_early()andtry_render_early()onhas_host_dependencies()(ignoring pure firmware-ordered producers) and verifycheck_firmware_producers()before inline publication so an unpublished or failed producer still falls back cleanly.Tested:
6c79a541616a4:python3 tools/asahi/run-host-tests.py --only g17(237/237pass, including newtools/asahi/g17-inline-cross-engine-tests.pywith 5 mutation traps).scripts/checkpatch.pl --strict0 errors, 0 checks. Localasahi.configbuild ofdrivers/gpu/drm/asahi/aurora.osucceeds cleanly.inst-A), same-DTB (origin/mainDTB, MCC/SLC disabled) A/B (notsws2-rescanvsslot3-directadding6c79a541616a4+WQ_HIGHPRIdrm_sched+ direct staged/compute render overorigin/main + #3319 + #3330 + #3380):1.4.7.1):594/594executed passed,0failures (synchronization2.op.single_queue.barrier.*_read_image_compute*:412/412;occlusion_query.copy_*:152/159+ 7 NS;multiview.queries.*:16/16;synchronization.smoke.*:12/12;concurrent_queries.*:2/2).gpubench-vk compute.cull_mdi(objs=16384 visible=75, CRC07f6c861valid): render inline publications jumped from0/5,010(0%) to5,005/5,006(99.98%) and compute inline from2,309/6,820(33.9%) to6,813/6,814(99.99%),gpu_gap_us d2 = 0.375 us.3024x1964native, Preset 2 Very High, TAA On, 10 s 24 MHz trace):LATE_PUB(CO->TA)cut-49.1%(43.8 ms->22.3 ms), GPU busy92.86%->94.72%,P454.27->55.07 FPS,0GPU faults,0new kernel errors.chainbench_diag:V0_ALL_BAR 960x540321.5 us->266.5 us(-17.1%);V3_NO_BAR_INDEP 60x33289.0 us->269.9 us(-6.6%).Risk: Two-way door · G17 inline submission eligibility only. Consumers with any external or
completedhost fence wait stay ondrm_sched;check_firmware_producers()guards against racing with an unpublished or errored producer.Not yet: Isolated single-commit J714s A/B (measured combined in
slot3-direct), G17P/G17C/G17D hardware rows, and CI.