Repository navigation
drm/asahi: g17: G17P cross-queue sync fast paths and compute MCache tables - #1892
Merged
Merged
Conversation
Userspace lists the buffers a compute command writes (the compute attachment list), and fragment kicks already name their attachments in an MCache table when the firmware takes one. Compute kicks never did: the list was validated and dropped. Give G17P compute kicks the same table: the command's write ranges, as attachment-class ranges translated in the work's UAT context, in the MCache space of the descriptor's main register array, which the kick entry names through the descriptor's client alias like its register bindings. Firmware builds without MCache tables and M5 command sets keep sending none. Signed-off-by: Diljit Singh <[email protected]>
Every logical queue took its own execution context (TTBAT slot and context id), even the queues of one VM. GPU caches are tagged by address and context, so queues of one client in separate contexts only see each other's writes after the memory-scope write-back that ends each command, and every cross-queue hop pays for it. It also spends one of the machine-wide execution contexts per queue rather than per client. On G17P, let the logical queues of one VM share its live execution context. Each sharer keeps its own scheduler page, QoS identity and work list; only the context id is common. Work keys are the context id plus the low six bits of a work-state word, so sharers draw work-state indices from one claim map. Kills and scheduler releases stay keyed by the per-queue scheduler page. The last sharer's explicit release returns the root; a sharer dropped without one leaves it to the last reference, as an unshared context does. M5 is unchanged. Signed-off-by: Diljit Singh <[email protected]>
A G17P compute command that consumes another queue's compute output waits through a completion-wait record: the firmware releases it once the producer's completion stamp lands, well after the producer's GPU work ended. Between kicks of one execution context the GPU needs no write-back, so the kick entry's dependency alone orders them, as M5's shared-ring queues already do. Name a source of the consumer's own execution context as a kick-entry dependency and leave out its completion-wait record. Sources in other contexts keep the record. Signed-off-by: Diljit Singh <[email protected]>
A G17P compute kick whose entry names another queue's kick also carried a predecessor record after its announcement. With cross-queue inputs of one execution context ordered by the kick entry itself, the record only adds an item for the firmware to walk on every hop. Keep it for the queue's first kick, which installs the queue. Signed-off-by: Diljit Singh <[email protected]>
…nit harness The module initializer now also initializes the registry of execution contexts shared by a VM's G17P queues, before either adapter registers. The probe-init harness compiles that initializer: give it a stub that records the init, and check it is done before registration like the binding and queue-share registries. Signed-off-by: Diljit Singh <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four G17P changes for cross-queue synchronization and compute writes (M5 and other generations unchanged):
All four are on by default, with no switch.
Testing
Neo (J700, G17P), on the default kit's kernel, with a test build where each change sat behind a same-boot switch (same code paths as these commits), one boot, A/B per switch:
These exact commits get their own hardware row (the same rows plus the fast merge gate) in the next default-kit qualification.
tools/asahi/run-host-tests.py, every g17 test plus queue-priority and m3-runtime, which read the changed files): 33/33 passed.🤖 Generated with Claude Code