Repository navigation
T6050: display coprocessor DART and power helpers for its restart after a wake - #2027
Merged
Merged
Conversation
After a strict warm restart, as after a sleep or a stop and restart of a coprocessor in place, every buffer request has to be answered from the buffers kept from the first boot, and a request for one that was never set up fails the boot with -EPROTO. The firmware asks for its crash log's buffer only when it crashes, so that buffer is normally never set up before a restart, and a crash after one ended the boot with -EPROTO instead of giving its crash log. Serve the crash log endpoint's buffer request after a strict restart as at the first boot. Every other endpoint keeps the strict rule. Signed-off-by: Diljit Singh <[email protected]>
On the T6050 (M5 Pro) each firmware 27 display coprocessor is stopped and restarted once after a wake, outside the system sleep (the display driver's part follows in the series). Its DART has to go down and come back with it, and the internal display pipe's DART loses the streams Linux owns when the display's power domain is cycled for that restart. Three helpers for the display driver: - apple_dart_m5_display_cycle(): at a stop, the error interrupts masked and cleared, the coprocessor's streams 23 and 24 disabled one write each, a TLB flush, then the DART's GAPF slice set to 0x2; before a start, the slice back to 0x12, the diagnostic lock and the error mask cleared and both streams enabled. These are the writes macOS makes around every stop and run bit of a display coprocessor. No translation table is touched. The display coprocessors' DARTs have no GAPF range in the J714s's tree, so each one's slice is found by the DART's address. - apple_dart_m5_display_snapshot(): before the display's domain goes off, every stream with a valid context is remembered, with the enabled streams. - apple_dart_m5_display_rewrite(): once the domain is back on, every stream that is not one of the firmware's locked ones and no longer reads as remembered is written back, and the TLB is flushed. Without it the firmware's first scan-out after the restart faults on the framebuffer stream's cleared context entry. Only a T8110-type DART is accepted, and only the J714s's display coprocessors' DARTs have a slice. Signed-off-by: Diljit Singh <[email protected]>
…its restart On the T6050 (M5 Pro) each firmware 27 display coprocessor is stopped and restarted once after a wake, outside the system sleep. A stopped display coprocessor starts again only if its power domains are cycled between the stop and the start, as macOS does at that point: with the domains left on, the firmware gives no HELLO after the run bit. Two helpers for the display driver, both on the sleep profile's display power words (ps.disp[]): - apple_sleep_m5_display_power(): the internal display's CPU, FE and SYS words, lowered (CPU, the coprocessor core's gate pair, CPU, FE, SYS) or raised (SYS, FE, CPU, the gate pair, CPU), each step polled until its state has settled. The display pipe DART's own streams are remembered before the power-off and written back after the power-on (m5_disp_dart_rewrite=0 leaves them). The display driver makes the PMC requests around it. - apple_sleep_m5_dispext_power(): the same for one external display coprocessor, found by its device, with its bits in the PMC's boost and bandwidth enable words cleared before the power-off and set after the power-on. The PMC's request word is left alone: the other external coprocessors stay on. The values and the order are the ones macOS uses for these restarts. The sleep's entry and exit don't call either; both refuse unless the T6050 profile is the one running. Signed-off-by: Diljit Singh <[email protected]>
This was referenced Nov 16, 2026
Merged
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.
On the J714s (MacBook Pro 14", M5 Pro, T6050), each firmware 27 display coprocessor has to be stopped and restarted once more during the wake from a deep sleep, outside the system sleep itself, before the internal panel lights (the display driver's part is in the follow-up PRs). For that restart the coprocessor's DART and power domains go down and come back. These are the three helpers the display driver calls for it.
soc: apple: rtkit: after a strict warm restart, the crash log endpoint's buffer request is served as at the first boot. The firmware asks for that buffer only when it crashes, so it is never set up before a restart, and a crash after one ended the boot with-EPROTOinstead of giving its crash log.iommu/apple-dart:apple_dart_m5_display_cycle()stops and starts a display coprocessor's DART around its restart (error interrupts masked and cleared, streams 23 and 24 disabled, a TLB flush, the GAPF slice to its off value; and back);apple_dart_m5_display_snapshot()/_rewrite()keep the internal display pipe DART's Linux-owned streams across the display domain's power cycle. Without the rewrite, the firmware's first scan-out after the restart faults on the framebuffer stream's cleared context entry.soc: apple: sleep:apple_sleep_m5_display_power()andapple_sleep_m5_dispext_power()lower and raise the internal or one external display coprocessor's power words (from the T6050 profile'sps.disp[]) and its core gate pair or PMC boost and bandwidth bits, with the values and in the order macOS uses for these restarts. Without the power cycle, a stopped display coprocessor gives no HELLO after its run bit.T6050 only: the DART helpers accept only T8110-type DARTs and know only the J714s's display coprocessors' DARTs, and the power helpers refuse unless the T6050 sleep profile is the one running. The sleep's own entry and exit don't call any of them. On their own these commits change nothing at run time.
Known limitations
apple_dart_m5_display_rewrite()writes back any unlocked stream whose remembered registers differ, and a stream that was invalid at the last snapshot keeps what was remembered for it before. A stream Linux detached between two snapshots could get its old table back; tracking which streams were valid at the snapshot would close that.Dependencies
None (base
integration/aurora). Used by the DCP wake PR (#2028) and the one-restart PR (#2029).Testing
Run on the J714s as part of the private test stack whose public form this series is (with #2028, #2029 and #2030): three deep sleeps, panel lit 0.84 s after each wake, one restart of each display coprocessor per wake. That kernel had these commits with their diagnostics at info level; here they are at debug level.
Checks
make ARCH=arm64 LLVM=1 Image modules, the M5 kit's configuration) of this head: links (vmlinux, Image, 1774 modules), 0 warnings.--strict): 0 errors; the warnings are the author name against the sign-off's and a few lines over 100 columns.🤖 Generated with Claude Code