Repository navigation
M3 Max (J516C): on-demand parameter buffer, panel EDID and 120 Hz, CDM walk fix (stacked on #177) - #182
Conversation
[Medium impact] The PR appears safe to merge based on the code reviewed. SummaryAdds J516C panel identification and faster swaps, changes G15 parameter-buffer backing and reclaim, and expands the CDM walk limit.
|
maralcbr
left a comment
There was a problem hiding this comment.
Thanks @malik-na, this is solid J516C work, and the before/after table makes the case well: no fail-stop on the second dEQP run, no crashes under concurrency, and the PB comes back down at idle. The EDID builder, the J516C-only swap stamps, the Kconfig select and the loader log all look right to me.
Before merge:
- CI hasn't run on this branch.
kernel-ci.yml:19-21only triggers for pull requests tointegration/aurora, so nothing ran here: no per-commit compile, no host suites, no KUnit for the newapple-dcp-panel-edidsuite or the newv14-boardcases. Once #177 lands and this targetsintegration/aurora, it needs a fresh push (retargeting alone doesn't start a run) and aci:buildrun so KUnit and the package build happen too. Locally at35e74f79:check-commits.pypasses (11 commits signed off, two checkpatch warnings), andg15-pb-growth-tests.py --mutations,g15-zero-words-tests.py --mutationsand the asahi-g15 selftest (70 ok, 2 ignored) pass.dcp14-panel-tests.pyfails at your merge base on the J514C assertion, but a5a2f02 on the current base fixes that, and it passes on a trial merge, which is clean.
Should fix before merge:
- Kept backing isn't freed if no render follows a client-boundary re-init. With more than 2047 blocks posted, the 50 ms path in
reclaim_check()setsrecovery.reinitand keeps the backing. From then onreclaim_check()andreclaim_delay_ns()both return early on the pending re-init (pools.rs:709,pools.rs:839), so the 1 s free never runs until the next render. A machine that goes idle right after a heavy client (screen locked, display off) keeps up to the whole 512 MiB heap. Please let the long-idle free run when the pending re-init came from a reclaim, and arm the poll for the remaining long-idle delay, not the expired 50 ms one. A growth-harness case with no render after the drain, checking that nothing wakes in a loop, would cover it. - Re-initializing under a live client is guarded only by time. ab98a72 says a re-init with no idle time, between two renders of one client, faulted at the heap base.
drain_reinit_due()(growth.rs:178) and the 1 s reclaim don't know whose render comes next, so a single client whose renders are more than 50 ms apart, with over 2047 blocks posted, gets the same mid-client re-init, just later. Could you either explain what faulted and why the firmware is quiescent after 50 ms, or run one process through a heavy scene, idle 60 ms and then 1.1 s, render again, and post the fault count? If that shows a problem, keying the 50 ms path on the next render prefix coming from a different VM than the last published one is one way out. - The EDID says gamma 1.00. The block is zeroed (
dcp-panel-edid.c:89) and byte 0x17 is never set, and 0 there encodes gamma 1.00, not "unknown". 0xFF doesn't fit either, because in EDID 1.4 it points at an extension block this EDID doesn't have. Please set a value you can justify for this panel (0x78 if a nominal 2.2 is right) and assert it in the KUnit test.
Smaller things:
reclaim_due()anddrain_reinit_due()(growth.rs:162,:178) also fire when nothing grew: ag15_pb_reclaim_blocksbelowg15_pb_blocks, or ag15_pb_blocksabove 2047, re-initializes after every qualifying idle. Requiringposted > initialin both, mirrored inreclaim_delay()(growth.rs:197), fixes both cases.- While a reclaim's re-init is pending,
publish()keeps one flight and no mixed prefix until the next render (engine.rs:559-565,:723-725), so a compute-only client right after a reclaim runs one flight at a time. Fine as it is, but worth a line in the PR body. - 33922ce's message says 120 fps was measured on an earlier present path, "not yet on this one", while the PR body now has kmscube at 120 fps on this branch. Worth updating the message so the history carries the result.
- The installer writing
chosen.asahi,t6031-gpu=0and the missing J516C software-rendering fallback should be tracked as issues in their own repos, so they don't get lost behind this PR.
Not a code issue: the PB changes also change the T6030 defaults (64 blocks at start, reclaim on), and they're untested there. Whether the M3 Pro gets them now or keeps #177's defaults until there's a T6030 run is a maintainer call, and I'll settle it before merge.
For release (not the source merge): suspend and resume on the J516C with this branch, cold-boot evidence, and a T6030 run if the new defaults apply there.
| if level == 0 | ||
| || !self.engine.flights.is_empty() | ||
| || !self.engine.pending.is_empty() | ||
| || self.recovery.reinit |
There was a problem hiding this comment.
After the 50 ms drain sets recovery.reinit with the backing kept, this return (and the one at :839) stops the 1 s free until the next render, so an idle machine keeps the heavy client's backing.
| /// ms) never reach `g15_pb_idle_ms`, and posted blocks never come back while a PB lives, so | ||
| /// without this they run the heap to the maximum. A re-initialization with no idle time, | ||
| /// between two renders of one client, faulted at the heap base. | ||
| pub(crate) const fn drain_reinit_due(&self, idle_ns: u64) -> bool { |
There was a problem hiding this comment.
This is time-only: a single client with renders more than 50 ms apart and over 2047 blocks posted gets the mid-client re-init that faulted at 0 ms. Requiring posted > initial here and in reclaim_due() also stops re-inits when nothing grew.
| manufacturer = manufacturer << 5 | (id->vendor[i] - '@'); | ||
| } | ||
|
|
||
| memset(block, 0, sizeof(*block)); |
There was a problem hiding this comment.
Byte 0x17 stays 0 after this, which encodes gamma 1.00. Please set a value you can justify and assert it in the test.
maralcbr
left a comment
There was a problem hiding this comment.
Follow-up on my earlier review, still at 35e74f79. Everything from that review is still open. These points are new.
Should fix before merge
- Recovery can strand a growth request.
refill_backing()returns early wheneverrecovery.reinitis set (g15/pools.rs:637). A fragment kill sets reinit while later same-VM flights are only marked doomed and may still be running (g15/recovery.rs:222-224). Once their reserve is used up,accept()returnsWait(pools/growth.rs:235) and nothing refills it. That flight then holds the engine:publish()admits no other VM, and no new same-VM prefix while reinit is pending (engine.rs:559-567). That lasts until its deadline arms another kill, and a failed recovery there fail-stops every VM (recovery.rs:373-381). Before this PR,back_pb()allocated regardless of reinit. Skipping the refill only when reinit is pending and no flights are live would keep the reclaim case and close this one. - Freeing posted blocks before the re-init. A level-2 reclaim frees and unmaps every chunk above
keep_chunks()while the firmware still has up topostedblocks published. Nothing touches them until the next render's InitBM, so this is safe only if an idle engine never reaches those blocks: no compute-only client after a reclaim, no firmware background PB work. Since a no-idle re-init faulted at the heap base, please say what makes the idle case safe, or add a test that runs compute right after a level-2 reclaim and reports faults. - Rebase onto #177's current head and run CI there. #177 has moved to
03c3afe7, and its follow-ups touchedg15/mod.rs,g15/boot.rs(Session::uat()no longer returnsResult) and thedcp.cbind paths. GitHub says it merges cleanly, but the combined tree hasn't been built or tested.
Smaller
stats.freedis counted beforevms.open()can fail (pools.rs:732-735). On that failure the VM mappings keep the pages, so the stat overstates what was freed.dcp_panel_edid_update()always writes the DT panel size intodisplay_info, whiledcp_update_connector_dimensions()prefers the firmware'sdcp->width_mm/height_mm(dcp.c:585-598). Calling the existing helper after the update keeps one source of truth. The newdcp_get_modes()branch also skips the firmware-derived path without clearingdrm_edid_firmware_derived.- Beyond the gamma byte: the block has manufacture year 0 (1990) and no detailed timing in the first descriptor, which EDID 1.4 requires. libdisplay-info based compositors will flag it as non-conformant. A real year (or the model-year flag) is cheap to add.
- The CDM byte budget lets one submission walk up to 1,064,960 barrier words (4.06 MiB,
gate.rs:33,:140), about 130 times the old 8192-record cap. Reads are cached in 256-byte spans, so it's probably fine, but it's worth checking how long a worst-case walk holds its lock.
Maintainer decision: whether the M3 Pro gets the new PB defaults (64-block start, reclaim on) before a T6030 run. I'll settle that before merge, as I said.
chriskearney
left a comment
There was a problem hiding this comment.
Thanks, Naeem. I reviewed 35e74f79 and reran the G15 selftest (70 passed, 2 ignored), PB growth harness (24 passed, all 22 mutants caught), and zero-word checks (15 passed, 2 ignored).
I can reproduce Marcelo's live-flight refill finding with the actual bodies extracted by your PB harness:
let mut f = Firmware::new(); // one live render
f.pools.ledger.posted = f.pools.ledger.backed;
f.recovery.reinit = true;
f.queue();
for _ in 0..4 { f.pass(); }
assert!(f.events.grow.is_empty());That assertion fails: posted=256 backed=256 waits=4 refills=0. Limiting the refill skip to reinit && flights.is_empty() makes this case pass. This is a host reproducer of the stalled request, not a hardware fault claim. Please keep separate tests for pending re-init with no flights and pending re-init with a still-running render; the existing pending_reinit_backs_nothing case currently has a live flight and requires the behavior that causes the stall.
One additional test gap around the reclaim review: the harness's Pools::drop_chunks() calls ledger.reinit() immediately, but production reclaim_check() frees the chunks and defers that reset until the next render. So freed_chunks_are_mapped_again exercises a cleaner state than production: it resets the posted count before the intervening compute-only/idle interval. Also, the growth harness extracts neither reclaim_check() nor reclaim_delay_ns(), so its passing mutation checks don't cover the pending-reinit timer problem. Could those tests run the actual reclaim/free and scheduling bodies, keeping the old posted count until InitBM, with a same-client render after 60 ms / 1.1 s and a compute-only submission between reclaim and InitBM?
I agree with holding the reclaim changes for those fixes and the lifetime check Marcelo requested. I'm also building the clean combination with the current #177 head for a bounded M3 Pro lab boot; I'll report that separately and won't treat a successful boot as proof of the reclaim edge cases.
|
I also ran a bounded M3 Pro/J516S hardware check with this head ( It booted with all 12 CPUs. OpenGL and Vulkan hardware readback passed, as did five renders per context at 100k, 1m and 4m triangle instances. Each context stayed open across 60 ms and 1.1 s pauses; the longer pauses also had a compute dispatch and checked readback before the next render. No GPU recovery, hang kill or host fault was recorded. The PB counters showed real growth and deferred backing allocation: This does not cover the recovery/refill issue above or establish reclaim safety: the run never crossed the 1024-block reclaim floor or the short-idle threshold, and the four backed chunks were still needed for the posting plus reserve. It also doesn't test the J516C panel changes. The separate Omarchy test runner could not execute (exit 126, its existing directory permissions), so I'm not counting that suite as passed. An initial attempt also stopped on my own test's incorrect assumption that Rust module parameters had sysfs files; that was corrected before the completed run. The original kernel, boot files and package inventory are restored and checked. So there is a useful T6030 boot/render data point now, but I'd still address the recovery/refill and test-model issues before merging. |
The DCP gives no EDID for a built-in panel, so on the 14.7 panel role
eDP-1 has an empty edid property and compositors see no make, model or
physical size.
Add a builder for a two-block EDID from the panel's device-tree node
and a table of the known panel models:
- the base block (EDID 1.4) names the panel by the PNP ID of the
vendor prefix and the model of its most specific compatible
("apple,panel-j516" gives APP and the monitor name J516), gives its
size, the model year (2023 for the J516), a nominal gamma of 2.2 and
P3 primaries with a D65 white point (the panel is a P3 wide-colour
panel, and the sRGB transfer function of Display P3 approximates a
2.2 gamma);
- its first descriptor is a detailed timing, as EDID 1.4 requires,
with the panel's geometry at 60 Hz: the same totals and horizontal
porches as the panel's mode, the vertical front porch at 63 lines.
The panel's own timing, 3456x2234 at 120 Hz, does not fit: the
detailed timing's pixel clock field is 16 bits in 10 kHz units (at
most 655.35 MHz) and the panel needs 3536 x 2456 x 120 =
1,042,129,920 Hz; its 6-bit vertical front porch cannot hold the
panel's 118 lines either;
- a DisplayID 2.0 extension carries the real 120 Hz timing as its
preferred Type VII timing (1042130 kHz, the DCP mode line with the
notch rows shown: 3456 3464 3496 3536 / 2234 2352 2360 2456), with
the display parameters (size, native pixels, colour, gamma).
Neither block is a mode source: DRM modes still come from the DCP
firmware, and the update adds no mode. There is no product code,
serial number, luminance or range descriptor. edid-decode and
libdisplay-info both report the EDID conformant.
dcp_panel_edid_update() publishes the EDID on a connector. Add a
base_edid flag to the 14.x board records, set only in the J516C
record. On that board, read the make and product from the panel node's
first compatible at bind, and when a probe has modes and no other EDID,
publish the panel's EDID sized as the connector is
(dcp_update_connector_dimensions(): the firmware's size, else the
node's), then give the connector back its size in millimetres, which
the EDID update replaces with whole centimetres, and clear the
firmware-derived EDID flag. Displays with a firmware EDID, the J514C
(whose record carries J514S panel values) and the T6030 panels (J514S,
J516S) leave the flag clear and are unchanged. On the J516C the
connector keeps its one firmware mode, 3456x2160 at 120 Hz.
KUnit (apple-dcp-panel-edid): the EDID is valid to drm_edid_valid(),
drm_edid_get_product_id() and drm_edid_get_monitor_name() give APP, no
product code or serial and J516; the base block holds 35x22 cm, gamma
2.2, model year 2023, the P3/D65 chromaticity, the 60 Hz detailed
timing field by field and one extension; the DisplayID block holds its
header, display parameters and every Type VII field of the 120 Hz
timing, and both checksums; an update publishes 256 bytes and adds no
mode. The fixture's connector uses the atomic state helpers.
apple-dcp-v14-board checks that only the J516C record sets the flag
(J514C, T6030 and J613 do not).
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
On the J516C the 120 Hz panel presented at 60 fps: the 14.7 swap record is sent with its timestamps zeroed, and the firmware then completes at most one swap per 16.7 ms. Counter values (1 GHz on T6031) in the timestamp slots make the firmware time out on the first swap. Write the constant 120 in timestamp slots 0, 1 and 6 instead, a time that is never in the future, after the swap record is encoded. Add a swap_timestamps flag to the 14.x board records, set only in the J516C record, and stamp a swap only for the internal panel of such a record. The J514C (untested), the T6030 (J514S, J516S) and T8122 panels and the external processors, which have no board record, send zero timestamps, byte for byte as before. The counter timestamps of the IOMFB template path (VRR modes on a main display) are not used by the native 14.7 path and are unchanged. Measured on the J516C on this branch: kmscube (atomic) presents at 120 fps (120.03 on two boots) on the panel's 120 Hz mode, 3456x2160 with the 74 notch rows hidden, and the first swaps of a boot complete in 2.9 to 8.1 ms instead of 16.7 ms. KUnit (apple-dcp-v14-board): the J516C record stamps its internal panel's swaps; the external role, the J514C, T6030 and J613 records and no record do not; a stamped swap holds 120 in slots 0, 1 and 6 and is otherwise the encoded record, with and without a surface. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
…rowth ledger The PB ledger only knows the posted count. For backing that is allocated after a reply instead of before it, the ledger also has to know how many blocks are backed, grant a request only from those, and start over at a re-initialization without forgetting the backing. Add `backed` to the ledger. `accept()` now returns an answer: - a grant, clipped to the backed blocks above the posted count; - a refusal at the maximum (the refusal bound is unchanged); - a wait when no backed block is left: the request keeps its counter and can be accepted again once more is backed. `reinit()` returns the posted count to the initial size and keeps the backing; Pools::init() uses it instead of a new ledger. The growth chunks that back_pb() allocates before an answer are now 128 blocks (16 MiB) instead of 32. answer_request() copies the backed count into the ledger after back_pb(), so no request waits yet. Host tests (pools/growth.rs, run by the asahi-g15 selftest): the clamps and the producer bound over the constructor's boundary values with the heap backed, growth to the maximum and re-initialization, and grants clipped to the backing, with waits that keep the counter. The ledger is shared by the T6030 and the T6031; this is untested on the T6030. The growth harness follows the chunk size and the ledger reset. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
…h a reserve back_pb() allocates and maps the backing of a growth request before the answer, while the firmware waits for it. The allocation has no time bound (shmem pages with __GFP_RETRY_MAYFAIL), and a failure leaves the request unanswered until the host deadline. Keep one chunk of backed blocks in reserve above the posted count and back the next chunk after the replies of a poll pass: - the heap is backed in chunks of 128 blocks (16 MiB), each a gpu_backing() object at its fixed client GVA (chunk_gva()); - when the GPU starts, the chunks of the initial posting and one reserve chunk are backed (9 with the initial 1024 blocks); - answer_request() grants only from backed blocks; while fewer than 128 remain above the posted count, refill_backing() backs chunks at the end of answer_growth(), after every reply of the pass; - with the reserve dry (an allocation failed), a request waits: it goes back to the head of the queue with its counter and is answered by a later pass once a chunk is backed; - a pending re-initialization backs nothing while no render is published; a render published before it (the flights behind a fragment kill) is still backed, or its requests would wait until the deadline. A compute-only flight gets none: it cannot ask for growth. Mapping stays per VM and before the VM can reach a block. A VM maps every chunk it lacks at the start of its prefix's publication (map_pb(), with its one-VM check), and a chunk backed by a refill is mapped into the VM of the flights before the ledger counts it. If that mapping fails, the chunk is dropped again and the next pass retries. The aliases are held in the VM's own heap list (VmState::map_heap()), which keeps the object of each alias. A chunk whose object changed is unmapped and mapped again, and aliases past the backing are dropped. back_pb(), running_vm() and the per-VM count are removed: no grant can name a block that the running VM has not mapped. This applies to the T6030 and the T6031, which share this code; it is untested on the T6030. The debugfs pb: line appends waits and refills. The growth harness now runs answer_growth(), answer_request(), map_pb(), refill_backing() and the VM heap-mapping bodies. Its new cases: - the start backing; - allocation only after the pass's replies; - a dry reserve that makes a request wait and keeps its order; - a failed refill map that drops the chunk; - a pending re-initialization with no flight, with a compute-only flight, and with a render published before it; - catch-up at publication, including a partial one. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
The initial posting is 1024 blocks (128 MiB), with 9 chunks (144 MiB) backed when the GPU starts. On the J516C, an idle desktop with a 64-block start stayed at 64 posted blocks (8 MiB), and growth is a round trip of 1-2 ms per ten blocks. Post 64 blocks at (re)initialization by default, settable with g15_pb_blocks (64..4095, read-only after boot). The PB then needs two chunks (32 MiB) when the GPU starts: the posting and the reserve. tuning::PB_BLOCKS is removed. g15_pb_max_blocks, the firmware's growth maximum, is still raised to at least the initial posting; its help text no longer says that the 512 MiB heap is allocated in any case. This applies to the T6030 and the T6031, which share this code; it is untested on the T6030, and g15_pb_blocks=1024 restores the old start. The zero-words harness pins hw.rs whole; its hash is refreshed, and its T6030 configuration module stays pinned to the original bytes. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
Posted blocks never come back while a PB lives. The firmware recycles pages inside its own pool and the records give the host no view of it, so the posted count only grows until a recovery re-initializes the PB. On the J516C one dEQP case takes about 1200 blocks past the firmware's maximum each time it runs. The second run of one dEQP list exhausted the 512 MiB heap, and the GPU fail-stopped after the refusals. Re-initialize the PB when the engine has had nothing published and nothing pending for g15_pb_idle_ms (1000), with more than g15_pb_reclaim_blocks (1024) posted: - the next render prefix takes the re-initialization path of a recovered abort (fresh lists and manager, InitBM of the initial blocks), with no halt; - with g15_pb_reclaim 2 (the default), the chunks above those of the initial posting and the reserve are freed at once and unmapped from every VM of the registry; a VM that publishes later drops its stale aliases first (VmState::map_heap()); a chunk counts as freed only once every VM's alias of it is unmapped; - g15_pb_reclaim 1 re-initializes only, 0 never; - nothing is re-initialized when nothing grew since the initialization (posted == initial), whatever g15_pb_reclaim_blocks is. The idle clock is noted at the end of every poll pass and publication and when a job arrives. The check runs in idle poll passes and when a job arrives at an idle engine, before its publication, because an idle poll is not re-armed. This applies to the T6030 and the T6031, which share this code; it is untested on the T6030 (g15_pb_reclaim=0 turns it off, and g15_pb_blocks=1024 restores the old start). The debugfs pb: line appends reclaims and freed chunks. Host tests: the idle clock, the reclaim test of the ledger, a heavy scene freed and refilled, and (growth harness) a VM that maps chunks freed and backed again from their new objects. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
…undary The idle reclaim needs g15_pb_idle_ms without work. Heavy scenes started back to back, each by a new client a few hundred ms after the last, never reach it. On the J516C three such scenes of about 1420 blocks each ran the heap to its maximum, and the fourth hung the GPU into fail-stop. Re-initialize also after 50 ms idle with more than half the maximum posted and grown since the initialization (an initial posting above half the maximum is not drained). 50 ms is longer than the gaps between one client's renders. On the J516C a re-initialization with no idle time faulted at the heap base, at a client switch, the second time in a row with no recovery between; with 50 ms of idle none faulted, also between two renders of one client 60 ms apart. This path keeps the backing, so the next scene does not allocate it again. The idle reclaim now also runs when more chunks are backed than the posted blocks need (free_due()), so backing kept this way is freed even if the next client posts below g15_pb_reclaim_blocks. With no render after the client boundary, the re-initialization stays pending, and with g15_pb_reclaim 2 the check frees the backing above the kept chunks once the engine has been idle for g15_pb_idle_ms (a recovery's pending re-initialization still stops the check). This applies to the T6030 and the T6031, which share this code; it is untested on the T6030 (g15_pb_reclaim=0 turns it off, and g15_pb_blocks=1024 restores the old start). Host tests: back-to-back heavy scenes never reach the maximum and keep their backing, and kept backing is freed at the next long idle. The growth harness also runs reclaim_check(), free_backing() and note_idle() over a clock: a heavy client that exits with nothing rendered after it is re-initialized after 50 ms and its kept backing freed after the long idle, its posted count kept until the InitBM; at level 1 the backing stays; a recovery's pending re-initialization frees nothing; nothing grown, nothing is re-initialized. The reclaim keeps the posted count until the next render's InitBM, as the driver does: the same client rendering again after 60 ms grows again from the kept backing with nothing allocated, after 1.1 s over freshly backed chunks mapped before they are posted, and a compute-only submission between the reclaim and the InitBM maps, backs and posts nothing. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
…ecords The CDM gate walks a compute stream from its base through its links and refuses it after 8192 records. A legitimate stream can be longer. On the J516C, the three dEQP-VK multi_draw.mosaic cases with max_draws and tessellation (1024 tessellated draws, several launches and barriers each) were refused: "rejecting CDM record budget record", then EINVAL from the submit. The gate is shared by the T6030 and the T6031. It already admits at most 64 links, and Mesa's encoder links to a new 64 KiB block when one fills, so a stream that fits the link budget is at most 65 blocks. Bound the walk by the bytes of its records instead: at most (64 + 1) * 64 KiB (4160 KiB) of stream, whatever the mix of 4-byte barriers and 24- to 40-byte launches. A stream without TERMINATE still ends at that bound or at the link budget, so the walk stays bounded: at most 1064960 record reads of 4 bytes. A walk does not check again the last page it found good, for a program or for an indirect launch's 12 argument bytes, and it makes at most 16384 page checks; one more is refused as "CDM page check budget". The walk holds no device lock: the queue's mutex covers the SUBMIT, and the VM's lock is taken per check (about 4 us on the J516C) and per 256-byte read (about 5 us). Without the cache and the bound, a stream of 24-byte indirect launches with distinct argument pages made one check per launch: about 0.8 s per compute command and about 51 s per 64-command SUBMIT. Now it is at most about 149 ms per command and about 9.5 s per SUBMIT. Mesa's indirect arguments move to a new page every few dispatches: 40000 dispatches made 41410 checks in 224 ms before and 6848 in 94 ms after, and the largest stream the link budget admits (47000 dispatches) makes 8047. The 608 dEQP-VK multi_draw.mosaic max_draws with_tess cases pass. Host tests (asahi-g15 selftest): 10240 barriers and a terminator are admitted; a terminator in the last word of the budget is admitted and one past it refused; a stream of the budget without a terminator is refused; 64 links are admitted and 65 refused; 1000 launches in one argument page make 2 page checks; a program and 16383 argument pages are admitted and one more page is refused without its check; 170000 launches over 16 argument pages are admitted with 17 checks. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
The G15 backend loads the T6031 board images with kernel::firmware (g15/board/blob.rs), which exists only with CONFIG_RUST_FW_LOADER_ABSTRACTIONS. DRM_ASAHI_G15 does not select it: the symbol comes only from APPLE_AOP, APPLE_SEP or nova-core, so a configuration without them fails to build the driver. Select RUST_FW_LOADER_ABSTRACTIONS from DRM_ASAHI_G15. It depends only on RUST, which DRM_ASAHI already requires, and selects FW_LOADER. Built with APPLE_AOP and APPLE_SEP off: the option resolves to y and drivers/gpu/drm/asahi builds. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
…out new work The reclaim check runs in poll passes and when a job arrives, but an idle engine runs no poll pass: the pass that retires the last flight is not re-armed. On the J516C, a client-boundary re-initialization kept 23 chunks (368 MiB) for a client that then posted 264 blocks. With no new job they were still held 15 s later, and only the next job's arrival freed 21 of them. When a poll pass ends with the engine idle, compute how much longer the engine must stay idle before the reclaim check would act (Ledger::reclaim_delay(): the idle reclaim at g15_pb_idle_ms, the free of kept backing at level 2, or the client-boundary re-initialization). Then queue the poll work for that delay. The pass it runs takes the device lock and runs the idle path: note_idle(), then reclaim_check(). Nothing is armed while busy, while a recovery or its re-initialization is pending, or when nothing can become due. While a reclaim's re-initialization is pending (a client-boundary one keeps the backing), the poll is armed for the rest of g15_pb_idle_ms at level 2 (Ledger::pending_free_delay()), not for the expired 50 ms, so the check frees the kept backing of a heavy client that exits with no render after it. A job's arrival re-arms the poll work for its publication, which replaces the expiry. The delay mirrors the checks, also in requiring growth since the initialization. This applies to the T6030 and the T6031, which share this code; it is untested on the T6030 (g15_pb_reclaim=0 turns the reclaim off, and g15_pb_blocks=1024 restores the old start). Host test (pools/growth.rs): over levels, floors, idle times, posted counts and backing, the delay is the first idle time at which reclaim_due(), free_due() or drain_reinit_due() holds. None of them holds one nanosecond before it, and none ever holds when there is no delay. The J516C case gives g15_pb_idle_ms at level 2 and nothing at levels 0 and 1. The growth harness also runs reclaim_delay_ns() and drives the idle poll work as poll.rs arms it: a heavy client that exits with nothing rendered after it wakes the poll at 54 ms (the re-initialization) and at 1004 ms (the free), and nothing is armed after; an idle reclaim arms nothing once its re-initialization is pending; nothing is armed at level 1, for a recovery's re-initialization, or when nothing grew. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
The boot loader enables the T6030/T6031 GPU node only when its chosen.asahi,t603x-gpu setting is on. With the setting off, as the installed m1n1 configuration of a J516C can have it (chosen.asahi,t6031-gpu=0), the node stays disabled. The adapter then never probes, and the kernel log gives no reason why there is no native G15 GPU. At module activation, log one line when /chosen carries asahi,t6031-gpu or asahi,t6030-gpu and the matching GPU node is disabled. The line names the node and the property's value. Nothing else changes; machines without the property log nothing. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
35e74f7 to
a089fd0
Compare
|
@maralcbr (review of 2026-10-22) CI hasn't run on this branch. Agreed, that needs the retarget to Kept backing isn't freed if no render follows a client-boundary re-init. Fixed. With a Re-initializing under a live client is guarded only by time. I ran your sequence on the The EDID says gamma 1.00. Fixed: 0x78, a nominal 2.2. These are P3 wide-colour panels,
Compute-only client after a reclaim runs one flight at a time. Added to the PR body as 33922ce's message. Updated: it now gives the result on this branch, kmscube at 120.03 fps Installer T6030 defaults. Yours to settle, as you said; nothing changed here. |
|
@maralcbr (follow-up of 2026-10-23) Recovery can strand a growth request. Fixed in Freeing posted blocks before the re-init. On the J516C I ran compute right after a Rebase onto #177's current head. Rebased onto
Manufacture year 0, no detailed timing first. Fixed. The EDID has model year 2023 and P3 The CDM byte budget. You were right to ask. Measured on the J516C, the walk holds no device |
|
@iconidentify Thanks for the reproducer. It is now On the test model: |
|
@iconidentify Thanks for the T6030 data point and for being clear about what it doesn't cover. The reclaim |
There was a problem hiding this comment.
Thanks, Naeem. Rechecked a089fd06488aa5edb09674a8d3ca71b56db07087; my blocking findings are addressed.
The refill now distinguishes a live render from compute-only/no-flight re-initialization. The harness runs the actual reclaim/free/timer bodies, keeps the posted count until InitBM, and covers the stranded-request reproducer, 60 ms/1.1 s same-client renders, intervening compute, and idle with no further render. The connector fixture also supplies the atomic state helpers that were missing. A focused ARM64 QEMU run with lockdep and KASAN now passes all six panel-EDID cases with no guest warnings.
I reran the PB harness: 37 cases pass and all 37 mutants fail on their intended assertions. The tested-body hash matches the exact PR tree. The G15 host selftest passes 74 Rust tests with two expected ignores. A local #177+#182+#187 combination also builds Image, modules and DTBs with LLVM 22.1.8/Rust 1.93.1 and both native GPU options enabled.
Hardware follow-up on a089fd06: our local #177+#182+#187 combination completed a one-shot test and a normal default boot on the M3 Pro/J516S. All 12 CPUs, hardware GL/Vulkan readback, Wi-Fi and dock Ethernet passed. The compositor reports both externals at 4K60 (Samsung 59.997), with the Dell rotated 270 degrees; no host warnings or GPU recoveries/hang kills. A local module-retention mistake was repaired before the completed normal boot. This is bounded boot/render coverage, not a hardware test of the reclaim edges or J516C panel.
Approving the fixes. I retargeted this to integration/aurora now that #177 is merged and requested full CI with ci:build; that run should finish before merge.
|
Lab laptop qualification of this PR at head a089fd0. What was built: a hand-built linux-aurora package (no pacman signature; sha256 checked before install), release 7.2.11-pr182-ARCH+, built from the rebased head of this PR (stacked on #177). It was installed as a one-shot Limine entry on each laptop, and each laptop returned to its stock kernel afterwards. Boot ids below are the stock boot, the candidate boot and the stock return boot. Laptop (model) | boots (stock -> candidate -> stock) | result CI on this head: 20 checks pass, 4 skip (ci/KUnit, ci/boot, ci/package, attest are skipped, not failing), plus the Greptile review pass. Regressions: none found. Notes:
What this does not test:
|
00e601f
Stacked on #177; merge after it. This adds the J516C (M3 Max, T6031) work from aurora-silicon/linux#363 that #177 does not carry, ported onto #177's code. It also fixes three problems found by booting #177 on a J516C.
Commits
d77c5566drm/apple: give the J516C panel an EDIDe3f69b77drm/apple: stamp the J516C panel's 14.7 swaps94148052…59aced96(5 commits)ae93621adrm/asahi: g15: m3: bound the CDM stream walk by bytes, not by 8192 recordsmulti_draw.mosaic.*max_draws*with_tess*dEQP cases. The walk is now bounded at 65 x 64 KiB of records, the 64-link limit is unchanged, and the last page found good (program or indirect arguments) is not checked again, with at most 16384 page checks per walk ("CDM page check budget"). Worst case on the J516C: about 149 ms per compute command (about 0.8 s without the cache and the bound).c562b82ddrm/asahi: g15: select the Rust firmware loader abstractionsselect. Without it, a config with APPLE_AOP and APPLE_SEP off fails to build (kernel::firmwareunresolved).aa142eeddrm/asahi: g15: m3: run the PB reclaim check after the idle time without new worka089fd06drm/asahi: g15: say when the boot loader left the GPU node disabled/chosen/asahi,t6031-gpu(ort6030) left the GPU node disabled. Before this, the driver logged nothing.Parameter buffer
g15_pb_blocksg15_pb_reclaim,g15_pb_idle_ms,g15_pb_reclaim_blocks)Kept from #177: the 4095 posted cap, mapping at publication with its one-VM check, and the checked backing helper.
publish()keeps one flight and no mixed prefix (engine.rs), so compute work submitted between the reclaim and the next render's InitBM is published one prefix at a time. No backing is allocated or posted for it (tested:compute_between_reclaim_and_initbm), and the first render re-initializes as usual. On the J516C, 8 compute dispatches in that window (between about 60 ms and 1.2 s after a level-2 free) all ran correctly with no fault.g15_pb_idle_ms(level 2), and the poll is armed for that, not for the expired 50 ms.T6030 note: these PB changes are in shared G15 code, so they apply to the M3 Pro too. They are untested on a T6030.
g15_pb_blocks=1024restores the old start, andg15_pb_reclaim=0turns the reclaim off.Tested on a J516C (M3 Max, 14.7 firmware, native Mesa aurora-silicon/mesa#25)
Booted with #177's own J516C device tree. Results are #177 head vs this PR:
host_write_index_buffer.1048576: 1 run + 4 after idle + 8 back to backStatic checks:
tools/aurora-ci/check-commits.pypasses;--strictgives 0 errors;d60121ff: per-commit build, the G15/DCP host suites, KUnit (1541 pass, 0 splats), and J516C runs. See the per-item notes in the replies.Needed outside the kernel (installer / distro)
chosen.asahi,t6031-gpu=1. Integrate reviewed G15, T6030 dock and platform fixes on the 7.2.11 update #177's installer writes0for the M3 Max. With0, the GPU node stays disabled and this PR now logs:native G15 not started: the boot loader left the GPU node ... disabled.Not covered