Repository navigation
drm/asahi: g17: hold tiling for indirect waits only while a sibling is busy - #4258
Conversation
…s busy linux#3991 made a render on a queue of two render pairs (G17C, G17D) hold its tiling kick behind every fragment-only compute wait and every same-VM attachment overlap. Either may stand for an earlier render on the queue's other pair, which `fragment_busy` does not drain, and a tiler-heap overflow partial render must not run ahead of that render. Such a render exists only while another pair of the owner holds one that has not retired. A queue that keeps its renders on one pair, as a shallow queue does, still had its tiling held behind compute. On J775c, rt.scene with ray queries lost 7-17 % of its frame rate with linux#3991, its raster time growing by its acceleration-structure build time. Promote those two waits only while another pair of the owner holds a render that has not retired, or one parked for replay, resident or lent out. The device-mutex path samples this when it publishes and the direct path when it lends the pair. A compute wait of the render was published before it, and so was any render that compute waits for. RenderDependencies starts with the promotion on, so a path that does not sample the pairs keeps the ordering it had. A fragment wait that names a render of another pair is still promoted always. A queue of one pair (M5 Pro and smaller, A18 Pro) never promotes the two waits, as before. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
J775c (M5 Max, two-pair G17C B1, 64 GiB) ABBA peer-kit receipt for
|
|
Merge evidence for c924253. Two-pair hardware (J775c, M5 Max, G17C). satchlj's ABBA run of the peer kit (receipt above) gave One-pair queues (J714s M5 Pro, smaller M5, A18 Pro) behave as on main, so no J714s row is needed.
Review. The direct path samples the siblings when it lends the pair, before it takes the render lock and gathers the attachment overlaps. That's safe because one queue's renders publish one at a time: the ioctl doesn't publish while the scheduler backlog is non-zero, and the scheduler thread releases the backlog only after Against current main. Main 787efea is 37 commits past the PR base and includes #3390 (inline cross-engine publication) and #3411 (single-pair depth 64) in the same g17 files. Neither changes when a queue's renders publish or which pair count
Main has since moved to ade5247, but those 12 commits don't touch |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Merge check on current main: main |
What: On queues with two render pairs (G17C, G17D), a render's fragment-only compute waits and same-VM attachment overlaps go onto its tiling kick only while another pair of the same queue holds a render that hasn't retired (or one parked for replay). When the other pair is idle, tiling overlaps compute again, as it did before linux#3991. A fragment wait that names a render on another pair is still always ordered.
Tested: g17 host tests 384/384 in the pinned workflow image, including all 13 mutations of
g17-render-partial-order(2 new). Warm module-only build on pc (aurora_defconfig, LLVM): base and head build, and onlyaurora.kochanges source. W=1 ofdrivers/gpu/drm/asahi/gives the same 39 warnings on both. Hosted: KUnit asahi 637 passed and 1 skipped of 638, including the newa_two_pair_queue_with_idle_siblings_tiles_beside_its_compute_waits_and_hazards; apple-build and host-tests pass.Risk: two-way door · M5 Max / M5 Ultra (two-pair G17C/G17D) render ordering. One-pair queues are unchanged.
Not yet: a G17D (M5 Ultra) run. The two-pair A/B on J775c is done: satchlj's ABBA run of peer-j775c-4258-c924253c-20261204 gave
VERDICT FIX(rt.scenelight d2 fps +18.4 %,fps_timedmedium..extreme +7..+13.5 %, 0 CTS status diffs in renderpasses + synchronization, stress 5/5). The receipt and the merge evidence are in the comments.Details
Why. satchlj's same-Mesa A/B on J775c (main
ebfb5226vsf21d1ed0, Borealis23f7c8697dbc,gpubench-rt-vk rt.scene trace=query): untimedlight d2went from 7,503 to 6,216 fps (-17.2 %). Timed medium..extreme d2 lost 7-12 %fps_timed, andgpu_raster_usgrew by +156..+2,186 µs, matchinggpu_as_us. #3991 promotes the fragment-only compute waits and attachment overlaps of every render on a two-pair queue (ordered_partial && render_pairs > 1). In this scene, the render's fragment half waits for the AS build, so its tiling waited for it too.When the promotion is needed.
DRM_ASAHI_FEATURE_ORDERED_PARTIAL_RENDERSpromises that a partial render starts after the fragment work its fragment half is ordered after: the pair's own earlier fragment work (fragment_busydrains it) and the renders its fragment barriers name. Those named renders are promoted on every queue, as before. A compute wait or an attachment overlap matters only when it stands for a render of the queue that runs on another pair. Such a render exists only while another pair of the owner holds one that hasn't retired:The two-pair admission keeps a queue at depth 1-2 on one pair (
SIBLING_BACKLOG = 1). So atd2the other pair is normally idle, and this change applies.Change.
Registry::sibling_render_in_flight(slot, owner)(runtime/render.rs) checks every other pair the owner holds. A resident pair counts whenPair::in_flight()is true (active, parked replay or configuration). A lent pair counts when itsborrowed_activeorborrowed_replaysnapshot is set, the same wayrender_in_flight()treats lent pairs.publish_render(submit.rs). The direct path samples it inlend_render, under the same device-mutex hold that resolves the compute waits it copies into the loan, and carries it inLoan(direct.rs).render_barriersnow usesordered_partial && render_pairs > 1 && dependencies.sibling_in_flight.RenderDependencies::EMPTYstarts with the flag set. Any path that doesn't sample the pairs keeps drm/asahi: g17: order cross-pair partial renders and advertise feature on two-pair M5 #3991's ordering.One-pair path (J714s and smaller M5, A18 Pro) is unchanged.
render_pairs > 1still gates the promotion, andpairs::per_owner()is 1 there. The new flag can't turn the promotion on, so the kick barriers stay the same.Evidence