Repository navigation
drm/asahi: g17: keep timestamp writers behind cross-engine publication - #3246
DjDeveloperr wants to merge 1 commit into
Conversation
Since "drm/asahi: overlap cross-engine commands with timestamped producers on G17" (#2552), a command can run in firmware next to a cross-engine producer whose host-written timestamps are not published yet, and chain its own publication behind the producer's. Only a query-accessing compute command still waited on the host for such a producer. That is not enough for a command that writes timestamps itself. Where producers are not waited for on the host (G17P), it then runs, and stamps, before the producer's timestamps are published, so its timestamps can come out earlier than the ones written before it. On a J700, the multiview query timestamp cases alternate render passes with compute timestamp writes, and 42 of 48 fail with "Fail (timestamp)" since that merge, without faults or recoveries. Treat a consumer that writes timestamps like a query-accessing compute command: it waits on the host for each cross-engine producer whose publication is still pending, and chains none. Commands that write no timestamps keep overlapping their producers, and nothing changes where producers are always waited for on the host. KUnit: asahi_g17_cross_engine_timestamps (timestamp_writers_wait_for_cross_engine_publication). Fixes: #3243 Signed-off-by: DjDeveloperr <[email protected]>
|
Verdict at Blockers: none Checked:
Evidence
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J714s (MacBook Pro 14" M5 Pro, G17S B1) A/B at Setup:
1. The #3243 multiview cases, one case per process. On CTS 1.4.7.1,
2.
3. BeamNG,
4. Kernel log: 0 GPU MMU faults, 0 G17 recoveries, 0 firmware crashes and 0 WARN/BUG/Oops in every window on both kernels. The base CTS window had one "compute publication … gave up" (main's linux#3235); the head had none. Reading: on the J714s the new path runs. |
|
J700 (MacBook Neo, A18 Pro, G17P) A/B at Setup:
The DeviceLost results:
Not run here: these timestamp cases on stock Neo state: every boot cleared the PMU boot-error count and read it back as 00. The Neo is back on the stock |
There was a problem hiding this comment.
Verdict: CLOSE or rework at 72a4de93 (do not merge as-is)
Blockers:
- Hardware A/B verification on both target platforms shows this change does not fix
#3243and causes a performance regression:- J714s (M5 Pro, G17S): all 48
#3243multiview query timestamp cases still fail, and BeamNG runs 7.8% slower. - J700 (Neo, G17P): the same 42/48
#3243cases still fail identically to base.
- J714s (M5 Pro, G17S): all 48
- Do not merge a change that adds host synchronization overhead without fixing the target bug; either close this PR or rework after root-causing
#3243.
Checked:
- Reviewed PR description, diff (
drivers/gpu/drm/asahi/g17/queue/mod.rs), and both A/B hardware test reports at72a4de931df0.
Evidence
- J714s and J700 A/B comments on this PR at
72a4de931df0both confirm 0/48#3243failures resolved and -7.8% BeamNG FPS on G17S.
|
Closing as part of the stale-PR closeout. Your own A/Bs at |
What: Fixes #3243. Since #2552, a G17 command that writes timestamps can overlap a cross-engine producer whose host-written timestamps aren't published yet. On G17P its timestamps then come out earlier than the ones written before it, and 42 of the 48 multiview query timestamp cases fail. With this change, a timestamp-writing command waits on the host for such producers, as a query-accessing compute command already does. Commands that write no timestamps keep #2552's overlap.
Tested: host build of
drivers/gpu/drm/asahi(asahi.config, LLVM, Rust,CONFIG_KUNIT=y) at72a4de931df0: builds with no new warnings, and the new KUnit case compiles. No hardware row yet.Risk: two-way door · G17P (A18 Pro) and the M5 boards that don't wait for producers on the host; elsewhere the decision doesn't change
Not yet: a J700 row with the 48 multiview cases and the query/timestamp CTS against base. A J714s row with the same cases plus a game-perf sample, since timestamp-writing passes no longer overlap. CI.
Details
EnqueueOrdering::build()decides, for each covered producer on the other engine, between two orderings:scheduledfence, with the consumer's own publication chained behind the producer's.#2552 made the second the default when producers aren't waited for on the host. It kept the host wait only for query-accessing compute behind a producer with a pending publication.
That misses a consumer that writes timestamps. Running next to the producer, it stamps before the producer's timestamps are published. A render chained behind a predecessor writes its timestamps on the host at publication, while a compute timestamp holds the GPU time it ran at. So the order of the values no longer follows command order. Multiview query cases alternate render passes with timestamp writes, which is where it shows: "Fail (timestamp)", with no faults or recoveries. The Neo bisected this to the #2552 merge
f0c5cb1a80eb: its first parent passes 48/48.The decision now goes through
observes_published_timestamps():Destinations::has_outputs()) host-wait for producers with a pending publication and chain nothing, as before drm/asahi: overlap cross-engine commands with timestamped producers on G17 #2552;host_producer_waits()is true, every producer is still host-waited.build()takes the consumer'swrites_timestamps. The existing KUnit cases passfalse, so they keep checking #2552's overlap. The newtimestamp_writers_wait_for_cross_engine_publicationchecks four plans:Cost: a pass that writes timestamps behind other-engine work with a pending publication loses the overlap and waits on the host, which was the behaviour before #2552. Games that don't time passes on the GPU are unaffected.
Evidence
./linux-build/build kernel --profile asahi <tree> -- olddefconfig drivers/gpu/drm/asahi/withCONFIG_KUNIT=y: exit 0. The new case is in the module object, and there's no warning ing17/queue/mod.rs.--strict: 0 errors, 0 checks, and 1 warning for a 101-column line. The file already has longer lines, and rustfmt accepts it.