Repository navigation
M3 Pro/Max: G15 as the T6030/T6031 GPU driver, and integration/#358 display and platform union - #148
DjDeveloperr wants to merge 49 commits into
Conversation
The M3 Pro (T6030) has the SIO coprocessor too; on the J514S it carries the built-in HDMI port's audio (DPA1, channel 0x66), as the M1 Pro/Max SIO does for their HDMI port. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…pects The ADT records each SIO client's channel configuration with the client (dp-audioN dma-channels: channel, data shape, timeout, FIFO size, threshold). On the M3 Pro (T6030) the DisplayPort audio channels refill their FIFO at 0x600 bytes: [0x66, 2, 0, 0x800, 0x600, 0, 0, 0] for DPA1, the J514S HDMI port's, and the same for DPA0/DPA2. Configure that threshold for an apple,t6030-sio controller, and publish every period descriptor whole (its other fields zero), since a descriptor slot may come back from an earlier transfer. The boot tables stay the boot loader's (apple,sio-firmware-params), as the binding has it. Behind APPLE_SIO_T6030, so that other configurations build the driver unchanged. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The G15 generation of the asahi GPU driver, added later in this series, links page tables into the UAT of the GPU's firmware coprocessor, whose table walker does not snoop the CPU caches. The tables are ordinary RAM pages that the shared page-table code allocates and writes through the cacheable linear map; they are not DMA-mapped, so the DMA API has nothing to sync them with. Each table, and each changed entry, has to be cleaned to the point of coherency before the firmware can walk it. Export the existing dcache_clean_poc() to GPL modules for that, instead of adding a new cache maintenance helper. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: applied unchanged from aurora-silicon/linux PR #358] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The SIO coprocessor (ASC at 0x289c00000, mailbox at +0x8000, interrupts 907..910, stream 0 of the SIO DART) is the DMA controller of the DisplayPort audio interfaces. As on the other SoCs it stays disabled: the boot loader reserves its firmware, describes its parameters and enables it. Its firmware sets up the SPI, UART and audio DMA shims whichever of them its clients use, so SPI_P, UART_P and AUDIO_P join SIO as parents of the SIO CPU domain, as t8103, t8112, t600x and t602x describe them. The J514S built-in HDMI port's audio is DCPEXT0's audio service with DPA1, the DisplayPort audio interface linked from DCPEXT0's port@0, whose samples SIO channel 0x66 carries; DPA1 is in its own power domain. This is the M1 Pro/Max HDMI port's arrangement (dcpext0, dpaudio1, SIO 0x66). Enable the SIO mailbox, the alias the boot loader looks the SIO up by, and DPA1's audio controller. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the DPA1 audio controller, DCPEXT0's port@0 and the SIO alias and mailbox enable go into t603x-j514s-j516s-hdmi.dtsi against integration's dcpext node (the PR's t6030-j514s-dcpext.dtsi is not carried); the t6030.dtsi and t6030-pmgr.dtsi hunks are unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The J514S HDMI port's audio is DCPEXT0's DP/HDMI audio service (EP 0x29, DCPAVAudioInterface) with DPA1, whose samples the SIO coprocessor carries. On DCP firmware 14.7's external role the service numbers its methods as 13.5 does, but differs from what the driver does for M1/M2: - An element's ElementData, the link data every link method takes, is 32 bytes, not 24; the last eight are opaque and must be kept. - StopLink (0/10) and CompleteLink (0/11) carry the link data as PrepareLink and StartLink do, and every link method answers an IOReturn at body+48. - One link per stream start: the SIO channel is configured, PrepareLink sent; the cyclic DMA is issued before StartLink; on stop the DMA is terminated and drained before StopLink and CompleteLink. A link that was only prepared (a format probe) is completed at hw_free, the link of a connection that has gone is dropped unsent. No DPA reset follows CompleteLink: it silenced every later stream on this machine. - The catalog of a sink's audio elements can be large (114 elements on a TV): it is queried with a 256 KiB capacity. - An open DCPAV interface is a client the firmware waits for, up to 10 s, before it removes a terminated interface, and the sink's link with it. So the card follows the connection but the service is not opened with it: the PCM opens it (Open, command 4, status and opened Boolean checked) and its close closes it (Close, command 5). A Terminate report on an open service disconnects the card and closes the instance from a work item; an instance that goes away takes its open with it, and its successor is never closed for it. - The open, close and link calls wait for their replies without srv_rwsem and plug_lock, which the endpoint's receive path takes when an instance is published or removed: the instance the PCM opened is kept under a mutex of its own. When the card is disconnected for the display or the sink, an open PCM's link is completed on the still open service first; otherwise the firmware keeps it prepared and refuses every later PrepareLink. - The role's CEC interface (DCPDPCECInterface) broadcasts the same reports on the endpoint; it is matched and its reports dropped. The external role starts the audio endpoint on the driver's opt-in (appledrm.hdmi_audio), as the other DCPs do, for a controller whose port@0 links an audio device, once per session and after the sink's first EDID: with the endpoint's interfaces published, every CopyEDID made the firmware rebuild them and re-plug the sink. The audio service is connected when the display is powered on (A472 on) and disconnected when it is powered off and before the sink is released. Everything is behind DRM_APPLE_DCP_T6030_EXT and the 14.7 external role: other configurations build these files unchanged, and an M1/M2 DCP's 24-byte link data still goes out as the same 64 bytes. Tested on the J514S HDMI port: PCM streams through the card, DPMS cycles and firmware re-plugs with a PCM open. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: keyed to integration's native T6030 external pipe, dcp_is_v14_7_external() (DCP_FIRMWARE_V_14_7 with external_native), in place of the PR's iomfb_is_v14_7_external(), and gated by a new DRM_APPLE_DCP_T6030_AUDIO option (default y under DRM_APPLE_AUDIO) in place of DRM_APPLE_DCP_T6030_EXT. The PR's dcpext-t6030.c lifecycle hunks become: the AV endpoint is started from dcp_get_modes() once the first EDID is installed (dcp_external_audio_start(), external_audio_work in dcp.c, disabled across unbind and system sleep); the audio service is connected after A472 on and disconnected before A472 off in dcp_v14_external_modeset() and iomfb_v14_7_poweroff(), and av_service_connect() waits for iomfb_v14_7_external_powered(); integration's dcp_poweroff() and DPTX release paths already disconnect the service. The av.c branches drop the pinned service through the out label, as integration's service pinning requires. The AV endpoint's RTKit messages were already routed to dcp->avep by the DCPLink receive path.] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
Prepare the shared layers for a generation whose firmware the boot loader leaves loaded, whose UAT regions are not System RAM and whose UAT walker does not snoop the CPU caches (G15, the M3 Pro). Nothing changes for G13, G14 or G17: - gpu::Gpu gains default methods, each returning the current behaviour: user_range() (the GET_PARAMS VM range, by default the geometry's usable range), tracked_submission() (use the VM_BIND batch and SUBMIT output-fence paths that file.rs selects for G17 by type), soft_faults() (whether SOFT_FAULTS may follow fault_control), prepare_new_objects() (populate, clean and pin new user objects before any CPU view exists) and bind_batch_limit() (a bound on VM_BIND batches, None by default). - file.rs consults them; gem.rs adds prepare_new_object(), which pins an object through its DMA mapping: on a device that is not DMA-coherent that cleans the freshly zeroed cacheable alias to the point of coherency. - mmu.rs adds Uat::new_adopted() for a handoff the generation establishes itself. It maps the handoff and the TTBAT write-combined from physical ranges, names the firmware's kernel root as the upper half of user contexts, and keeps the kernel VM below a driver-owned shadow root whose window entries the generation links into the firmware's own table. Vm::with_tracked_status() attaches status and job lifetime tracking without the G17 context views, footprints and residency reclaim, and a few accessors serve the generation's VM handling and stream checks. - Page tables of an adopted UAT clean every new table page before its parent names it, every changed table or leaf descriptor after the store, and the zeroed root at creation, and end each mutating walk with a DSB. - regs.rs adds SGX accessors at runtime offsets. The generation-only items are built only with CONFIG_DRM_ASAHI_G15, which a later patch adds; without it the page-table cleaning is a constant false, so G13/G14/G17 page-table writes are unchanged. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the hooks live on drm_gpu::DrmGpu as well as gpu::Gpu, since file.rs dispatches through the backend trait here; file.rs recognizes G17 through AsahiData::g17() and tracked_submission() selects the same paths for G15, including VM_STATUS_MIRROR; the page-table cleaning reuses this tree's `noncoherent` table publication (enable_clean_poc() sets it and publishes the root) instead of a separate clean_poc walk; Uat::new_adopted() builds the integration UatInner/UatConfig (published-roots config: no M3 owner, legacy PPL lock, no handoff cache-flush requests) and Vm::new() enables the cleaning when the UAT asks; the lifetime paths that integration routes to the M3 owner for non-published VMs (install_driver_mappings, driver_range_overlaps, unmap_user_ranges, drop_mappings_now) take the lifetime path for a tracked VM; prepare_new_object() also marks the object held, as this tree does for pinned objects] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
First part of the G15 generation (T6030, M3 Pro: J514S, J516S) of the asahi driver: bringing the firmware the boot loader left loaded (RTKit 2419, the macOS 14.7-14.8 stub) to READY. The generation is built from the patch that adds its UAPI glue and Kconfig option. - adt: the boot loader's ADT copy (phram "adt"): the GPU regions and firmware segments, performance states, admission of their layout. - identity: the exact firmware build, by the SHA-256 of its loaded TEXT with the GKTS entropy bytes zeroed. - board: the three board templates (HardwareData, Globals, Power) of that build, verified by hash at boot, and the DVFS tables rebuilt from this machine's ADT. - uat: the PPL handoff: the window mappings, the PPL lock exchange, the startup epoch, and the host window under a RAM shadow root whose L2 entries are mirrored into the firmware's shared L2 page, with every table the firmware can walk cleaned to the point of coherency first. - object: firmware objects on GEM kernel objects (populated and DMA-mapped before any write-combined access), the firmware cache classes, a bump allocator with guard pages, and the lower and client aliases. - initdata: the 49-object initdata graph at its canonical VAs and its live words (root, runtime, control). - channel, event: posting to the submit channels (also behind unconsumed records), the device-control ring, draining the receive rings and decoding the event ring. - boot: probe-time admission (board, PMP supplier, DMA mask, ADT, firmware identity, MMIO, runtime-PM hold; a DMA-coherent GPU device is refused, as its firmware objects would not be cleaned), the RTKit operations on the C RTKit API (the only buffer accepted is the inherited one inside firmware DATA), the start to READY (PMP AGX vote, hardware identity and core masks, cold-only check, RTKit, UAT adoption, initdata, DEVCTL 0x13 and 9), and an orphan state that retains and drains a session whose start failed. - glue.c: C helpers without Rust bindings (SHA-256, the board check, the runtime-PM hold, the module reference, the phram lookup, ioremap_wc). A firmware session cannot be stopped once started: everything it can reach is retained until reboot. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit 0154c24) [port to integration/aurora: the PMP AGX vote goes through this tree's PMP C bridge, apple_pmp_set_device_power(0x0f, 5, 1), which sends the same request word the J514S bridge did; the supplier is linked with apple_pmp_link_device() only when the GPU node names it with apple,pmp, and a vote while no PMP is registered defers the probe; the board check is of_machine_is_compatible(j514s|j516s) in glue.c instead of the PR's pmp-display bridge; RTKit uses the GPU node's single unnamed mailbox, as the static t6030 node has no mbox-names] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The G15 firmware is classic: one ring per engine (TA, FS, compute) and ordering expressed by in-ring barrier records that wait on another queue's stamp. All logical queues and VMs share one persistent compute graph and one render graph: - graph: the compute graph, the TA/FS render queues, notifiers and InitBM, class-2 queue-info rows, and the waited Globals +0x9b0 = 0 import before the queues are first exposed. - slots: compute slots, render pass slots and clustering buffers, with their CLEAN/USED/DIRTY/CLEARING/STALE states scrubbed on a dedicated unbound, memory-reclaim workqueue. - encode, fw/work: the compute, TA and FS work images and microsequence records of this firmware build. - engine: commands of a job are published as prefixes (consecutive commands of one engine, or of both in API order), each member in a claimed slot, with per-edge barrier types, priming prefixes after a recovered abort, submit-ahead behind unconsumed records, compute horizons ahead, and at most two flights in flight (the second of the same VM). The order is total, which satisfies every valid header barrier and EXACT_PRIOR ordinal. Firmware-visible writes keep a fixed order: images, thresholds and counters, a barrier, the queue WRITEs, a barrier, then the compute/FS/TA records and doorbells. - poll: the poll pass, under the device lock: drain the receive rings, retire flights on their stamps with trailing polls, answer parameter-buffer growth, check hangs, publish; a completion hrtimer with a one-jiffy backup; the asahi-g15/stats debugfs file and opt-in phase timers (debug_flags bit 49). Fences are signalled after the device lock is dropped. Built with the generation from the patch that adds its UAPI glue. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit 0a2dcce) [port to integration/aurora: applied unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…licy - recovery: deadlines for a published prefix without progress (g15_deadline_ms) and for a started compute (g15_compute_deadline_ms), the compute hang kill through Globals +0x1c/+0x24 and a posted DEVCTL 0x13 with publication frozen, its waited disarm, the retirement verdict of a killed prefix, and the halt/resume handshake answering up to four further halts while draining (g15_recovery; 0 makes every halt fail-stop). Whatever cannot be recovered latches fail-stop: every VM reports EIO, and everything firmware-visible a failed command may still reference is retained until reboot. - pools: the render UMA and parameter-buffer allocators with an uncached spare set, their initialisation and the takeover of the spares after an abort, and parameter-buffer growth answered from the poll pass with an epoch gate (K = 4096). - power: the firmware idle policy initdata writes into Globals: standby 2500 us instead of the template's 700 (with 700 us the GPU powers down between works about 100 us apart and pays about 300 us at the next pickup), minimum confidence 0.5, and the finite-delay branch instead of the predictive one, which makes 2-3 % of works under sustained low-duty submission pay a power-up. The pure decisions (receipt comparisons, the compute hang test, the growth ledger, the idle words) live in core-only submodules. Built with the generation from the next patch. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit f0f8523) [port to integration/aurora: applied unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
apple_pmp_set_device_power() waits for the supplier's readiness report before sending a power command. On the T6030 the PMP node names no report (the display gate points the display processors at the report entries, not the PMP), so apple_pmp_report_wait_supplier_ready() falls to the T8122 wait and returns -ENODEV: no T6030 consumer could vote. The G15 GPU generation votes for PMP device 5 (AGX) before it starts the firmware, through this function. A registered T6030 PMP has already started its firmware and endpoint (pmp.rs registers after that), and apple_pmp_send_power_command() waits for the firmware's acknowledgement, so treat the missing report as satisfied for the T6030 PMP only. Every other supplier keeps the readiness requirement. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…nk swap The MacBook Pro (M3 Pro, J514S/J516S) internal panel runs DCP firmware 14.7 through Aurora's DCPLink session (iomfb_v14_7.c), which presented frames but never set the panel level: integration had no backlight device for it. The 14.7 swap request carries the level in nits inside its 0x508-byte prefix: a present byte at +0x354 and the level as an unaligned IEEE 754 binary64 at +0x35c, both zero when the level does not change. The block sits in the opaque gap between the background colour (+0x154) and the first surface record (+0x508) of integration's swap layout (iomfb_v14_7_swap.h: DCP_V14_SWAP_BACKGROUND, DCP_V14_SWAP_SURFACE), the same prefix aurora-silicon/linux PR #358 (Eryk Wieliczko) validated for this panel (its static asserts place bl_nits_present at 0x354 and bl_nits at 0x35c of its dcp_swap_v14_7). Policy, as PR #358 has it for this 500-nit mini-LED panel: at most 500 nits (less if the panel's apple,max-brightness says so), 140 nits presented by the first present after takeover, levels jump (no fade), and the level goes out only when it changes. It runs on the H17P backlight state machine (dcp_backlight.c): dcp_backlight_prepare() reserves the level just before A407 and the swap's result completes it; a level request kicks a brightness-only present that repeats the last frame from backlight_work under the RPC lock; CRTC off blanks at 0 nits (dcp_backlight_dpms) and the next present after CRTC on carries the level again; a refused present is retried with the policy's backoff. dcp_backlight.c admits the 14.7 panel next to H17P (a jump instead of a fade at configuration, the level request path instead of the DAC tables, no device without an active policy), and the panel's probe initialises the policy. The backlight device registers from bl_register_wq once the panel has started. External 14.7 pipes encode the same zero level block as before: their swaps are byte-for-byte unchanged, and nothing here runs for them, nor for M1/M2 or H17P. The level block encoding (dcp_v14_nits_binary64()), the policy constants and the dcp_backlight.c changes follow PR #358's iomfb_v14_7_present.h and dcp_backlight.c; the present path itself is integration's. Not yet tested on hardware. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
Complete the G15 generation (T6030, M3 Pro) with what userspace sees, and build it behind the new DRM_ASAHI_G15 option (default n): - vm: user VMs, each holding an exclusive TTBAT slot (ASIDs 1..63) for its lifetime, with the shared graph's client aliases mapped into every one, in VA ranges that belong to the kernel in every VM. - queue, job, fence: logical queues own no firmware state. Each has one DRM scheduler with 16 credits; a SUBMIT is one job with one hardware fence, handed to the device-global engine, and fences signal in queue order with the VM status latched first. QUEUE_DESTROY drains the queue. - command, gate: SUBMIT parsing and validation, in order: the stream's structure, the timestamp handles, the header barriers and EXACT_PRIOR ordinals (the semantics of the G17 rules; the engine's total order satisfies every valid one), every command's mapped spans with the right access, and the CDM/VDM stream gates that admit only known records (g15_stream_gate). - timestamp: timestamp buffers mapped into the firmware's 64 MiB arena in the host window, where the firmware writes nanoseconds directly. - params: GET_PARAMS (feature word 0x3e, QUEUE_LIMITS, identity), VM_BIND batches of at most 1 << 20 operations. SOFT_FAULTS, FEW_PRIMITIVES and RENDER_RAY_QUERY are never advertised; FRAGMENT_BARRIERS only with g15_early_tiling. - mod: the generation's GPU, its shared state and device lock, and its platform driver for apple,agx-t6030. The driver is registered separately from the other generations and has no module alias: the M3 must start its GPU only after the native display is up, so the firmware boots when userspace loads the module afterwards. It suppresses its bind attributes, and a started session keeps the module and everything the firmware can reach until reboot. The module parameters g15_* carry the few tunables that stay tunable (load time only): deadlines, the repoll and completion intervals, the firmware idle standby time and confidence, recovery, the stream gates and early tiling. Tested on the J514S with Mesa's asahi Vulkan and Gallium drivers: a Minecraft Vulkan replay runs at about 161 FPS with identical frames, the deqp-vk memory model, compute, render and submit subsets show no failures, and induced compute and render hangs are ended and recovered without a firmware crash. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit 13a93ec) [port to integration/aurora: the generation is a backend of the shared platform driver instead of a second platform driver without module alias: asahi.m3_backend gains the value g15, and auto starts it on the validated J514S/J516S boards when CONFIG_DRM_ASAHI_G15 is built (asahi.m3_backend=runtime keeps the M3 runtime; without the option auto keeps starting the runtime); AsahiDriver::probe_g15() keeps the device bound with no DRM device when the probe fails after the firmware was touched; drm_gpu::Backend::G15 adapts gpu::Gpu to the DrmGpu file layer, and file.rs keeps the M3 runtime's per-SoC feature rules off a G15 device; the command stream check requires the ts_frag_end_copies/ts_end_copies arrays of this tree's UAPI layout to be empty, as G17P does, since G15 implements no timestamp copies; the crate root is renamed asahi_core.rs so that g15/glue.o can be linked into asahi.o; the Kconfig text follows] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The T6031 GPU is the same firmware generation as the T6030's (RTKit 2419, the same initdata graph and canonical VAs) on a different SoC: four clusters of ten core slots, so the enabled-core mask is two words (+0xe01500 and +0xe01504), identity words 0x07041100/0x0021040a, revision 0x12, and the GPU is powered by its power domain alone (there is no PMP vote on this SoC). Its GPU node is in the kernel device tree, filled by the boot loader (the UAT regions, the loaded firmware segments as fw-text and fw-data with their VAs, and the operating points), so the regions do not come from an ADT export. Make the SoC-specific parts of the G15 driver a property of the configuration row instead of module constants: the machine check and the PMP vote (Platform), the source of the regions (the ADT export or the GPU node), the initdata placement that differs between firmware builds (Layout: root version, HardwareData VA, size, cached prefix and fourth view, the IOMapping table), the board images (Board) and the compute register values that scale with the cluster count (ComputeRegs). The identity read fills one core mask per cluster, up to four, and GET_PARAMS reports as many as the SoC has. Add the T6031 row matched by apple,agx-t6031. It carries no firmware pin and no board data yet, so admission prints the measured TEXT identity and stops before anything firmware-visible. The T6030 row keeps every value it had; its behaviour is unchanged. Signed-off-by: Naeem Malik <malik2015naeem@gmail.com> (cherry picked from commit 7dfc3c2) [port to integration/aurora: the row is selected by the shared platform driver (asahi.m3_backend=g15, or auto on the J516C when the generation is built; every other value and board keeps the T6031 runtime selection) instead of a second OF match table; both SoCs use the GPU node's single unnamed mailbox; the T6030 row keeps this tree's PMP vote through apple_pmp_set_device_power; the T6031 node is integration's static t6031-gpu.dtsi, which the boot loader fills with the same region and segment names this row reads] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The GPU firmware TEXT a J516C's macOS 14.7 boot chain leaves loaded (iBoot-10151.140.19.700.2, RTKit-2419.140.12.release): TEXT 0x64000 and DATA 0x140000 bytes, the GKTS entropy marker at 0x5cf28, SHA-256 of TEXT with the 8 entropy bytes zeroed c26ec89c1150eb6549cf602e012d0c5f49eb756e896d6bb8342cb2c5d98b332c, measured on the loaded segment of a J516C. The same machine started through a macOS 14.8.x chain carries a different stub whose full digest has not been recorded. For that case, and for the next build of either stub, add g15_accept_text_prefix: an unpinned build whose digest starts with the given 8 bytes is admitted for that boot with a warning that prints its full identity, so it can be pinned by the next kernel without a second measurement boot. Off by default. Signed-off-by: Naeem Malik <malik2015naeem@gmail.com> (cherry picked from commit 9609d14) [port to integration/aurora: the module parameter is added to the renamed crate root asahi_core.rs] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The T6030 board templates do not fit the T6031: its HardwareData record is 0xb480 bytes (the fourth HardwareDataB view at +0xb400), its root version word is 0x0c08e21e84820490, its IOMapping table has 17 slots at the T6031 register blocks (Fender at sgx+0xd00000 with a 0x144000 window, eight 0xd8000 memory-cache instances, the clock generator at sgx+0xe1c000, the ANE doorbell at 0x3c945c000, ...), it has four per-cluster voltage tables, and hundreds of its words differ from the two-cluster image. Everything here was read on a J516C: the device tree the boot loader hands over, the SGX registers and that machine's initdata. Give the T6031 row its layout and IO table (VAs packed from 0xfffffc2068000000 as the T6030 table is) and take its three board images from one firmware file, asahi/t6031-j516c-board.bin, pinned by SHA-256 and built into the kernel with CONFIG_EXTRA_FIRMWARE: the images that machine's firmware accepted, as the earlier J516C driver uploaded them. The build checks the file's IOMapping records against the layout, then writes what it owns: the TTBAT address, the IOMapping VAs, the timestamp arena, the creation timestamp and the idle policy. The HardwareData object is placed 16-byte aligned (0xfffffc20406fb580) and mapped ASC-cached as a whole: the firmware's MTR alarm handler does a 64-bit atomic in HardwareDataA, which faulted at the T6030 placement on T8122. The T6030 path (templates, DVFS from the ADT, the S8 request words) is unchanged. Signed-off-by: Naeem Malik <malik2015naeem@gmail.com> (cherry picked from commit 04e10f0) [port to integration/aurora: applied unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The compute work image carries four cluster-sized register values that the two-cluster G15S values get wrong on the four-cluster G15C, where they fault the first job: the saved-state pointers into the preemption buffer at +0x2980 instead of +0x1480 (0xd80 plus 0x700 per cluster), UMA PTC (0xa599) 0x6000400020 instead of 0x13200400020, DUPM (0xd411) 0x3c000000140 instead of 0x200000001 (32 N | 96 N << 32 for N = 10 cores per cluster) and 0x1a0e9 = 0 instead of 8. The J516C's own driver also encodes a queue's first command with the saved-state pointers and the 0x12091/0x101d9 words zero; the G15C commands here are all encoded that way, which is how compute work first completed on a J516C. The values were read from 38 compute commands on a J516C and verified by the register-fault analysis of the earlier J516C driver's boots. The T6030 values are unchanged. The render (TA/FS) values for the G15C are not known yet and stay the G15S ones. Signed-off-by: Naeem Malik <malik2015naeem@gmail.com> (cherry picked from commit 9174c1e) [port to integration/aurora: applied unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
On the T6031 the boot loader describes the four UAT regions as
reserved-memory nodes without no-map (uat-ttbs, uat-pagetables,
uat-handoff, uat-pagetables-l2), so the kernel maps them and /proc/iomem
lists them as System RAM. The T6030 admission requires every region to be
outside System RAM (its regions are boot-loader carveouts) and maps them
write-combined, which refused the T6031 GPU at its first region ("GPU
region 0 (ttbs) ... not admissible", J516C boot t86) and would have
failed the write-combined remap of RAM next.
On the device-tree platform, admit a UAT region that lies entirely in
System RAM as well, and map such a region through the kernel's own
mapping (memremap MEMREMAP_WB) instead of write-combined, in the handoff
window and in the adopted UAT: what the shared driver does for the other
generations' handoff and TTBAT regions, and how the earlier J516C driver
reached the same regions. The firmware segments must still be outside
System RAM. Carveouts keep the write-combined mapping, so the T6030 path
is unchanged.
Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
(cherry picked from commit bfcfee0)
[port to integration/aurora: the ADT platform (T6030) also admits UAT regions
that lie in System RAM, since this tree's static t6030 GPU node has the
boot loader fill the same reserved-memory nodes and their no-map state
is not fixed in the kernel sources; firmware segments still must be
outside System RAM on both platforms]
Assisted-by: LLM
Signed-off-by: Diljit Singh <hey@djdev.me>
The macOS 14.8 boot volume's stub loads a different J516C GPU firmware build than the 14.7 chain: TEXT 0x64000, DATA 0x140000, GKTS 0x5cf28, SHA-256 1bf2fd3476befe736bc2c070bad45f8be36b68cd11bcff16c9029d6bcda026cf, first measured through g15_accept_text_prefix. The layout is identical and nothing else in the T6031 configuration is keyed on the build, so it is a second entry in the same table. The prefix escape stays. Signed-off-by: Naeem Malik <malik2015naeem@gmail.com> (cherry picked from commit e30d702) [port to integration/aurora: applied unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
check_render() covers the 8 bytes at isp_scissor_base with scissor + 8. The base is user input: 0xffff_ffff_ffff_fff8 passes the alignment check and the addition overflows, which is a panic with RUST_OVERFLOW_CHECKS. Use checked_add, as the other bases of the same check do, so that the value is refused with EINVAL instead. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…failure publish_prefix() grows the compute horizon of a prefix by grouping later compute-only jobs of the same queue, reserving one group entry per job with ?. By then the base job's commands have been encoded and its queue WRITE may have advanced, so publish() treats any error with sent != 0 as an uncertain post-WRITE state and latches fail-stop: a transient ENOMEM from that reserve stopped the whole engine. Nothing of the grouped job has been touched when the reserve runs. End the horizon instead and publish what was prepared; the job stays pending for a later prefix. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
vm::Registry::prune() drops the registry's references to VMs whose client handle is closed, but it only ran from reserve(), the next VM_CREATE. A closed VM's page tables, every object bound in it and its TTBAT slot therefore stayed alive until some client created another VM. Prune when the handle goes: file.rs tells the backend through a new DrmGpu::vm_closed() hook (a no-op for every other generation) from VM_DESTROY, and a G15 queue prunes when it is destroyed, which also covers a file close, where the VM handles drop before the queues. A VM's state still lives until its last queue or job is gone, as before. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…fails early admit() takes the runtime-PM hold of the GFX domain and start() takes the PMP AGX vote before the hardware identity, the core masks, the ASC state, the TTBAT and the UAT self-check are examined. Each of those can refuse the start before anything firmware-visible is written and before the session is retained, and the probe then fails (or defers) with the hold and the vote still taken, so a retry starts from a different state than the first attempt and the GFX domain never powers down. Give both back on those paths: the vote through a guard that releases it unless the session is retained, the hold once Gpu::new() fails while nothing is retained. A failure after the firmware was touched keeps both with the retained session, as before. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
Slots::release() marks every pass slot in the prefix's pass mask Dirty, whatever its state. A slot the prefix claimed but never wrote (a publication that failed before its records went out) is still Clean, and a slot already scrubbed is not dirty either; marking them Dirty sends them through the scrubber again for nothing, and loses a state the scrubber relies on. Guard the transition with the Used state, as the compute and clustering slots of the same release are guarded by their own states. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The G15 generation of the asahi driver drives the J514S GPU. Enable it in j514s-rust.config, merged on top of j514s.config, and note in the latter that userspace loads the GPU driver after the native display is up, as its platform driver has no module alias. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit 79d6375) [port to integration/aurora: one fragment, j514s-gpu.config, merged on top of defconfig and asahi.config; it enables DRM_ASAHI as a module with DRM_ASAHI_G15 and APPLE_PMP, and documents the asahi.m3_backend selection, since the generation is started by the shared platform driver here rather than by a second driver without module alias] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The J514S HDMI audio path needs the T6030 SIO channel configuration. APPLE_SIO_T6030 only changes behaviour for an apple,t6030-sio controller, so enable it with the driver. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The G15 generation (g15/) is the driver of the T6030 (M3 Pro) and T6031 (M3 Max) GPUs. Until now it was one of several choices: a Kconfig symbol (DRM_ASAHI_G15) decided whether it was built, and asahi.m3_backend chose at probe time between it, the serialized M3 runtime, the G15 GpuManager bring-up backend and nothing, with per-board defaults; a T6031 without asahi.m3_backend=g15 went to the M3 runtime's asahi.t6031_start path. Bind the generation directly: apple,agx-t6030 and apple,agx-t6031 get a ProbeConfig::G15 row with their g15::hw configuration, the same way the T8140 gets its G17 row, and probe starts probe_g15() for them. Build the generation whenever DRM_ASAHI is built, as g17/ is, and move what its Kconfig symbol carried onto DRM_ASAHI: the PMP driver dependency (the AGX vote goes through apple-pmp's exported bridge, so asahi cannot be built in while that driver is a module) and the firmware-loader abstractions (the T6031 board images). The cfg gates in the shared files go with the symbol. Drop asahi.m3_backend and its T6030/T6031 selectors. The T8122 keeps its board gate (the M3 runtime starts only on the M3 MacBook Airs), which no longer consults the parameter. The J514S GPU config fragment only set DRM_ASAHI_G15 on top of values asahi.config already carries (DRM_ASAHI=m, APPLE_PMP=m), so it is removed. The M3 runtime's T6030/T6031 tables and the GpuManager bring-up backend are now unreachable; a following change removes them. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
… power-on After every A472 on, the 14.7 external firmware enables the display's timings asynchronously, and drops a swap that arrives before that: the A407 reply carries status 0 with its first byte set, and no D589 ever follows for that swap. The DCPLink client waited the full call timeout for that completion and then stopped the session, so the first present after a mode set or a DPMS wake could cost the display until reboot. Poll the display status (A437 get_block, block 0x6e) after A472 on, bounded at 2 s, until the pipe, link and timings are up, before the mode set returns and the first swap goes out; and end a swap the firmware reports dropped at once, with the old framebuffer kept on screen, the way a refused swap is. A late D589 for such a swap completes nothing. The default stride the firmware asks for (D101) follows the mode once one is set, as the firmware expects, and the runtime levels it publishes (D300: id 19 the panel level in nits, id 18 its correction) are recorded for the debugfs status file. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the PR's dcp_swapped() dropped-swap path, iomfb_v14_7_ext_wait_ready() and D101/D300 handling re-implemented on the DCPLink client (iomfb_v14_7.c, iomfb_v14_7_link.c) instead of the IOMFB template] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
… 1 MiB An HDMI 2.1 (FRL) sink's TimingElements arrive from the external processor as one chunked property transfer of more than 1 MiB (1.38 MB for a 4K120 TV). The 14.7 client refused any property above 1 MiB, so such a sink was described with no timings at all. Let an external processor keep up to 8 MiB per raw property and 24 MiB in all, with the chunked transfer's announced count bounded the same way; the panel's properties keep their limits. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the PR's DCP_PROPERTY_RAW_LIMIT/TOTAL for the external role, applied to the DCPLink client's raw property store] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
Once the T6030 PMP runs it owns the DRAM controller (DCS) and SoC fabric performance states, and nothing asks it for more than their lowest states: an 8-thread CPU copy measures 28 GB/s and the GPU is starved. The PMP's CPU clients (EACC0/PACC0) are the first two entries of the SOC-DEV-DVFS range of its device-state table, PTD indices 288 and 289 on the J514S; a request there with the valid bit (61) set asks for a DCS state (bits 51:48) and a fabric state (bits 35:32), and the DVFS-STATE entries 8 and 10 publish the firmware's response. The PMP applies a CPU-client request on its change notification, and a read of the request entry may consume that notification: a floor written and read back at once stayed latched without effect. So, from a delayed work once the PMP has reported ready and acknowledged its startup requests: read both entries once, clear the floor fields (the floor is always a fresh transition), write DCS4/FAB2 into both back to back through the request-set aperture, and confirm on the DVFS-STATE entries without reading the requests again; retry up to ten times, a second apart, if the firmware did not respond. With it the DVFS-STATE entries go from 0x100 to 0x2104 and the CPU copy bandwidth from 28 to 123 GB/s; a Minecraft Vulkan replay went from 36.5 to 55 FPS. The floor is requested by the report driver that starts the T6030 PMP, through the PTD aperture it already maps, on the apple,t6030-pmp-v2 report only. The entry indices come from the PMP's own apple,tunable-ptd-range (the SOC-DEV-DVFS and DVFS-STATE ranges, looked up by id and name and bounds-checked against the aperture) rather than being hard-coded; without them no floor is requested and the PMP still starts. The T6031 table's CPU-client entries have not been read, so the T6031 report requests no floor. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the memory floor of 6c43ba3 ("soc: apple: pmp: Add the T6030 display hold, AGX vote and memory floor"), moved from pmp-display.c into the PTD report driver that starts the integration kernel's T6030 PMP, scheduled after the PMP is ready instead of after the display's acknowledgement, with the entry indices from apple,tunable-ptd-range and without the j514s_memory_floor module parameter; a KUnit case covers the range lookup] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
apple_pmp_report_wait_ready() starts the PMP on the first call and waits for it to acknowledge a report entry. A display driver that has already asked for the PMP, or that must not start it from the context it is in, has no way to ask whether the acknowledgement is there yet. Add apple_pmp_report_check_ready(): the same lookup, but it never starts the PMP and never waits. It returns 0 once the PMP reports ready and has acknowledged the entry, -EAGAIN while it has not, the reason the PMP was not started once that is known, and the same -EPROBE_DEFER, -ENODEV and -EINVAL cases as the waiting call. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
A domain marked apple,no-auto-pm never gets automatic power management enabled: not when it is found on at probe, not when it is powered on, and not when a failed power-off is undone. Once powered up it stays at its requested state until Linux changes it, which a coprocessor CPU domain whose firmware Linux starts cold needs. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit b968acb12e5e6ea5a8f24cbe0a4e24ce3fc8d6d8) [port to integration/aurora: applied onto the driver's undo_timeout and retained_25g83 paths] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The T6030, T6031 and T8122 device trees mark the internal display power chain (DISP_SYS, DISP_FE, DISP_CPU) with apple,inherited-on, and the display handoff refuses to add the PMP unless the chain carries it; it then sets apple,min-state on the chain, which the power state driver applies, so the PMP cannot power the running display coprocessor down. The binding did not describe the property. Document it as the marker it is: the boot loader left the domain on. It is not apple,firmware-owned; the domain's register is still written. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
… the crossbar's power Each USB-C ATC of the T6030 (M3 Pro) has a display crossbar at its core + 0x4c000. The connection sequence of an output ends in a complete register image, and a crossbar with no connection up shows an exact idle image (the gates at +0x004/+0x014/+0x024 closed with their status bits set, everything else clear), so a transition that did not take can be told from the registers. After every connection up or down of a T6030 output, check the output's own image (its source bit in the write-side clock and enable registers and their status, its bit in the output registers, its fields in the select registers) and, once no connection is left up, the crossbar's idle image; report a mismatch with the complete image. A first connection is also expected to start from the idle image. The crossbar's power (its ATC's USB domain, through power-domains) is held through runtime PM from the first select until the last output has been deselected and the crossbar verified idle; a crossbar that did not reach the idle image keeps its power, as the hardware may have been written. Probe writes nothing. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the register image checks and the runtime PM hold of a0bf9ef ("mux: apple-display-crossbar: Add the T6030 USB-C crossbars"), merged into the existing T6030 handling of the apple,t6020-display-crossbar match, which also drives the USB4 DP IN outputs; the connection sequences were already the same. No new compatible: a mismatch is reported, not failed, and a route stays selected while its connection is down, as the display driver and the resume path of this tree expect] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…e takes one A 14.7 pipe sends the CRTC's colour matrix only on a board whose record names a tested matrix setter (the J613/J615 A421/A420 pair); the T6030 and T6031 panels and every external processor send none. Their CRTCs still offered the CTM property, so a compositor's night light was taken and silently never applied, instead of falling back to its own shader. Enable DRM colour management on a CRTC only where the pipe can apply a matrix. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the PR removes the CTM from every 14.7 CRTC (read-only j514s_ctm restores it); here the board record's matrix setter decides, so the J613/J615 CTM path is unchanged] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The 14.7 panel keeps scanning out through system sleep (soft DPMS blanks it to the background at 0 nits), and its firmware keeps publishing to the AP meanwhile. The mailbox interrupt is not suspended, so each of those messages wakes a CPU out of suspend-to-idle, as the H17P panel's did before dcp_hold_for_sleep(). Once the brightness work is cancelled and no call is in flight (calls and notifications run under the RPC lock), hold the firmware's messages in the mailbox at suspend and let them through again at resume. An external processor is unchanged: sleep is still refused while it holds a display. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the PR gates dcp_hold_for_sleep() on dcp_presents_nits(); here the DCPLink client holds RX itself] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
… idle image only The connection-up image of a T6030 output does not include the clock status bits at +0x800, +0x808/+0x80c and +0x814/+0x818; only the idle image does, where they are clear. Expecting them set after a connection up would report a mismatch on every link up if the hardware does not reflect the enables there. Check them clear after a connection down, as the idle image does, and leave them out of the up image. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…AV service Two wire facts of the DCP 14.7 external role (T6030 DCPEXT), observed with its AV service and DPTX port on the J514S: - Its callback replies carry 8 in byte 35 of the EPIC sub-header. The AFK layer zeroed that field for every firmware. - After a replug it announces its AV service again on the channel the old instance had. That is a new instance: the old one is gone with the sink it served. The AFK layer refused a second announcement on a channel that still had a service, so the host kept the dead instance, never opened the new one, and read no EDID through it. Set the byte on the external role's callback replies, and tear the old AV instance down before the new announcement is taken, on that role only. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: gated on dcp_is_v14_7_external(), the native DCPLink external pipe; integration's handling of the 14.7 kind-0 replies is kept] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
… for While it trains a link, the DCP 14.7 external role asks the host to program the voltage swing and pre-emphasis it chose for every lane (SetDriveSettings: the lane count at +16, one level pair per lane from +32), and reads them back (GetDriveSettings). The port handler kept two words of the request and never touched the PHY, and answered the read-back with lane 0's pre-emphasis as 0, so the link trained at the PHY's default levels whatever the firmware had chosen. On that role, program the levels into a running link through the PHY (the T6030 ATC PHY takes them) and answer with what was programmed; report a request the PHY refuses as failed instead of applied; record a request made while the link is down. The M1/M2 port handler is unchanged. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: dcpext_link_plan/reply's SET/GET drive cases re-implemented in dptxport_call() for the native 14.7 pipe] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
… is back The DCP 14.7 external role reports a sink that is in standby or on another input with DPTX callback 20 (InactiveSinkDetected), keeps its display powered, and brings it back with a link-up once the sink is active again: it retrains only a powered display's link. The port handler only acknowledged the callback, so a TV in standby stayed a connected output whose swaps went nowhere. Keep the inactive state on the port. While a powered display's sink is inactive, report its connector disconnected, hold swaps, and leave the display powered when DRM turns the CRTC off; a link-up, a new catalog or the sink's release ends the state. During link training the same callback is routine and an unpowered display's connector is left alone. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the PR's dcpext_link.inactive, carried on struct dptx_port and consumed by the DCPLink client's hotplug, swap admission and poweroff paths] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The DCP 14.7 external role answers EDID requests through an AV service
instance its client has opened. The host opened it with command 6, which
is SetVirtualEDIDMode: with the instance's interfaces present it removes
and recreates them, a software unplug of the sink, and it opens nothing.
DCPAV Open is command 4 (a zero 32-byte body; the reply's status at +0
and its opened Boolean at +16 say whether it took).
An open client is one the firmware waits for, up to 10 s, before it
removes the instance: it holds the reply to the sink's HPD low until the
instance's device has closed ("timeout while waiting for DCPDPDevice
close"), and with it the sink's release and the next sink. The host
never closed its client, so an unplug could leave the controller stuck.
Open the instance with DCPAV Open and check its reply; close the client
(DCPAV Close, command 5) before every HPD low and before a release, and
from a work item when the firmware terminates the instance (report group
2, command 1), after which the instance gets no new use. Close goes only
to the instance that was opened; a removed instance took its open with
it. The EDID read through this role is checked block by block (header
and checksums) before it is published.
Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja>
[port to integration/aurora: dcp_ext_av_work/dcp_ext_av_close and
dcp_ext_v14_7_av_report re-implemented in dpavservep.c on the
dcpavserv.opened bookkeeping, the Close hooked into dptxport_set_hpd()
and dptxport_release_display(); drm_edid_valid() replaces the PR's
dcpext_edid_object() checks]
Assisted-by: LLM
Signed-off-by: Diljit Singh <hey@djdev.me>
With the G15 generation bound to apple,agx-t6030 and apple,agx-t6031, the M3 runtime's T6030 and T6031 support and the G15 GpuManager bring-up backend cannot be reached. Remove them and keep what the T8122 (M3, J613/J615) runtime still uses. Gone are the T6030 and T6031 SoC rows (m3_soc, hw/t6030, hw/t6031, the T6030 firmware images, layout and IO-mapping tables), the T6031 start (t6031_start, t6031_knobs and its asahi.t6031_* parameters, the Experiment threaded through identification, InitData construction, the device setup and the runtime's verdicts) and the T6030 GpuManager backend: g15_probe and its g15_boot, g15_initdata and g15_selftest modules, the Fender MMU/kick and self-test register helpers, the firmware health report and gfx-data peek diagnostics, and the asahi.g15_debug bits that only drove them. The G15 legacy GpuManager instantiation that the versions macro generates stays, as the T8122 runtime builds its InitData from the same 14.8.3 structures. The T8122 keeps its HwDataB words (now written out instead of derived from the T6030 row), start experiment, HAL200 runtime and parameters; the StopBeforeAsc and M3ResumeAfterFault debug bits stay. The former T6030 image rows, firmware layout and IO maps live on only as fixtures of the identification and IO-map host tests. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
…displays The T6030 external processor's TimingElements went through the common M1/M2 colour selection: no timing colour restrictions, the highest-score RGB colour up to 10 bits (so a 10-bit colour over the 8-bit one the pipe is qualified with), interlaced timings taken as progressive, and a timing with more than 64 colour restriction IDs (an HDMI 2.1 FRL sink lists 68) dropped. Take that catalog through the external SDR path with a fw14 profile: only an 8-bit SDR RGB colour (sRGB or default RGB) is preferred, the highest score and then the lowest ID; interlaced, split, multi-pipe and pixel-repeated timings are refused; the unsafe and DSC-required lists are honoured, up to 128 IDs. A DSC-required 8-bit RGB colour the sink takes compressed (SupportsDSC) is admitted for a timing that has no uncompressed colour, never an unsafe one: the firmware compresses it itself once the host sets the catalog's colour and timing. That is how a 4K TV's 3840x2160 at 100 and 120 Hz, listed with DSC-required colours only, become available. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the ctx flags are unconditional and set by the DCPLink client; a timing without an 8-bit RGB colour keeps integration's common fallback (YCbCr 4:4:4, any SDR, best) instead of being refused, so no sink integration admits today loses its modes] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The firmware publishes a sink's whole catalog; nothing checked that the routed link could carry a timing. A two-lane pin-D route offered 4K60 (14.26 Gb/s over 8.64), which could only fail at the mode set. Keep the timings the routed lanes carry at the port's highest rate: uncompressed at 24 bpp within the lanes' 8b/10b payload, or compressed by the firmware (a DSC timing at 8 bpp within the payload less the 2.4 % FEC): four lanes of HBR2 (pin C) or HBR3 (the HDMI port) carry 4K120 with DSC, two of HBR2 (pin D) do not. When the firmware's preferred timing goes, the largest and then fastest remaining one is preferred. The lanes are what the PHY reported to the firmware for the route (GetMaxLaneCount); the rate is the HBR3 every T6030 route reports. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: dcpext_catalog_filter() as dcp_catalog_budget() in the parser, applied by replace_modes() from the parse context; the PR's 3840x2160 and 24..120 Hz caps are not taken, as integration admits wider and faster sinks today] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The DP-to-HDMI converter behind the T6030 HDMI port raises IRQ_HPD service requests the firmware services only when told (InterruptRequestOccurred, DPTX group 8 command 9). The host forwarded short HPD pulses, which only a non-sleeping HPD GPIO can time (the J514S line is on the AOP and sleeps), and otherwise polled for 10 s after an HBR3 link configuration. Anything later than that, or on an HBR/HBR2 link (a 1080p or 1440p sink), was never serviced: without the service the firmware never learns of the converter's events, sink metadata and FRL readiness among them. Poll every 100 ms from the sink's connection (REQUEST_DISPLAY) until its release, as the firmware needs; a request still goes out at once on an HBR3 link configuration and on each timed pulse, and a firmware that refuses three requests in a row is left alone until the next sink. This is one small RPC every 100 ms while an HDMI sink is attached; the earlier window had the same rate for 10 s. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: dcp_ext_service_arm/disarm as dcp_hdmi_sink_held() in dcp-hdmi.c, armed from the shared DPTX connect/release paths; the pulse fast path is kept] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The T6031 board record admitted the J516C only; on a J514C the DCP was refused with "no board record for this machine" and the boot framebuffer stayed. #363 admits the J514C alongside the J516C. Add a J514C record on the T6031 DCP with the J516C image (the image is the SoC's; its UUID is checked at probe). The J514C board file names the J514S panel values (the same chassis), not yet read from a J514C, so the record takes the panel size from the boot framebuffer like the T6030 record does, and logs every panel timing and the display clock on its first boots. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
A KUnit suite checks the 14.7 panel's A407 request encoding byte for byte: the CRC32 of every representative request of the panel's hardware-qualified profile (a primary frame, the first present at 140 nits, the soft-DPMS blank at 0 nits, a brightness-only re-present, ARGB8888 at the 500-nit maximum, the background swap, a level of 1), the wire landmarks of the surface and swap records, and the binary64 levels with their bounds. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the same reference CRCs against the DCPLink client's encoder (iomfb_v14_7_swap.h), which reproduces every one of them; the template-specific policy and single-surface cases are not taken] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
A KUnit suite builds fw14-shaped TimingElements fixtures (derived from two captured publications, a Philips monitor and a Sony TV: virtual colours without a Score, no pipe counts, nested metadata) and checks the parser's fw14 RGB8 profile (the 8-bit sRGB colour over 10-bit and AdobeRGB, ties to the lower ID, interlaced, split, multi-pipe and pixel-repeated variants refused, a DMT timing without a horizontal precise rate admitted), the DSC admission of the TV's 2160p120 timing and its budget on pin C, pin D and the HDMI port, and the link budget's preferred-mode choice when the firmware's preferred timing goes. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> [port to integration/aurora: the catalog cases of dcpext-t6030-test.c on dcp_catalog_budget() and the parse context flags; the budget expectations follow the ported filter, which has no 3840x2160 or 24..120 Hz caps, and a case covers the kept common fallback] Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
The M3 runtime no longer serves T6031, whose GPU is driven by the G15 generation, and t6031_knobs.rs is gone. Assisted-by: LLM Signed-off-by: Diljit Singh <hey@djdev.me>
|
Thanks for putting this together, Dj. I’m working through the display/audio side and have a couple of SIO fixes worth sharing before the full boot tests finish.
There’s also a loader pairing detail: the new These are source/build checks so far, not an HDMI-audio hardware pass. Happy to send the small fixes separately if that makes them easier to fold in. One more reproducible issue in |
Add the backend policy hooks, adopted UAT constructor, tracked VM status and point-of-coherency page-table publication needed by native G15. Port the public PR148/SiliconForest hooks onto this tree's newer GPUVM, GEM ownership and DRM RegistrationData interfaces instead of restoring the removed M3 runtime architecture. Existing backends keep their user aperture, feature numbering, object preparation, VM_BIND and SUBMIT paths. Their page-table constructors leave clean_poc false. Preserve checked_object_size, current SG-table pinning, G17 residency/context tracking and normal ioctl signatures. The new feature_flags hook preserves the normal feature additions while letting G15 report its private ABI's feature numbering. G15's private wire facade and adapter are separate follow-ups; this commit does not qualify an enabled native backend on hardware. Based-on: Eryk Wieliczko's retained-generation shared hooks Source: omacom/linux-aurora#148 Upstream-commit: 4f2edd6 Source: https://github.com/iconidentify/siliconforest-linux/commit/65cd54ba0da8f93e4530f851382ccb5187ab794c Generated-by: LLM Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com> (cherry picked from commit 0f36607)
Keep G15 in the maintained asahi module with shared GEM, MMU, file and queue infrastructure. Reuse the target RegistrationData API and preserve normal/G17 registration and teardown. No old M3 runtime files or global UAPI header selection are restored. G15 retains its separate no-alias platform adapter and suppresses manual bind attributes. When the default-off DRM_ASAHI_G15 option is enabled, remove only T6030/T6031 from the generic adapter's exported table so module autoload cannot start firmware before native display setup. Adapt native objects to the target's permanently pinned, GEM-owned SG table and VMap interfaces. Retain a GEM owner in HeldPages rather than reintroducing the removed owned-SG wrapper. G15 register mappings are owned by its retained session; normal Resources keeps its target devres lifetime. Use only the maintained PMP link/vote API with the exact T6030 plus J514S/J516S and GPU-compatible checks. The original source imports/carries precede this adaptation, with author and supplied signoffs retained. g15/SOURCES.json records the public pins and carry ledger. Original work is by Eryk Wieliczko, Naeem Malik and DjDeveloperr; this commit adapts their public code to the current APIs. Private native-wire integration and the lazy driver-data initialization fix follow separately; this is not hardware qualification. Source: omacom/linux-aurora#148 Source: https://github.com/iconidentify/siliconforest-linux/commit/65cd54ba0da8f93e4530f851382ccb5187ab794c Generated-by: LLM Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com> (cherry picked from commit 3f80156)
Registering a platform driver may call its probes and still fail later in driver_add_groups. A second driver registration can also fail after the first adapter probed. Starting retained G15 firmware in either registration therefore allowed module-init rollback to detach its power domain, despite retained DMA objects. Keep native probes deferred while MODULE_READY is false. Initialize the cleanup queue and both owned registrations first, then publish readiness in the final infallible unit initializer. Retry the G15 adapter through driver_attach; an attach failure is logged and never returned as a module-init error because an earlier device may already have started. All later ordinary/deferred/built-in probes observe the same ready gate. The reprobe helper borrows driver_find's pointer only while the pinned registration remains owned by DriverModule during initialization. The API supplies no owned driver reference and no put_driver is performed. Normal/G17 initialization, unbind and default-off behavior are unchanged. Extend the actual-pin-init host proof to nine cases, including a late failure after attempted probing in each registration, and attach failure after successful startup. The actual C activation helper passes three cases. Four mutants build and fail at their intended runtime assertions: eager probe, retained error escaping, missing ready gate and activation before the last registration. Allocator/registration/GPU side effects are models; the macro, probe, module initializer, callback dispatch, set_drvdata and C reprobe bodies are production source. No hardware claim. Source: omacom/linux-aurora#148 Generated-by: LLM Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com> (cherry picked from commit cbb678e)
|
J514S / M3 Pro hardware test (2026-10-23) I tested this on a 14-inch MacBook Pro J514S / M3 Pro (T6030). On one successful boot, a Wayland EGL client rendered on At the same time, the built-in display ran at 3024×1964 at 120 Hz, and my LG 38WN95C ran at 3840×1600 at 119.982 Hz. Brightness control was available. This did not test PR #148’s branch. The kernel was This was one successful boot. Another boot had a DCP failure and no external display, so cold-boot reliability and sleep/wake remain unverified. I have the relevant logs and exact build identifiers available if they would help. |
|
Closing: this conflicts with integration/aurora now, which carries the G15 M3 work in another form. The T6030 display and PMP commits that aren't upstream yet can come back as a fresh PR against the current tree if they're still needed. |
M3 Pro (J514S, T6030) and M3 Max (J516C, T6031) support on
integration/auroraas a union of integration's work and aurora-silicon/linux#358 (Eryk Wieliczko) and #363 (Naeem Malik).[port to integration/aurora: …]note.GPU: G15 is the T6030/T6031 driver
drivers/gpu/drm/asahi/g15/: Eryk's driver for the firmware the boot loader leaves loaded, plus Naeem's T6031/G15C row.apple,agx-t6030andapple,agx-t6031probe straight into it, likeg17/.g15_boot/probe/initdata/selftest.rs,t6031_start/knobs.rs,hw/t6030.rs,hw/t6031.rs, the T6030/T6031 rows of the M3 runtime);asahi.m3_backend, theasahi.t6031_*parameters,CONFIG_DRM_ASAHI_G15and the GPU config fragment.g17/is byte-identical.aurora-wip(52ecc30), which runs G15S/G15C on the native AGX3 path (asahi, hk: G15S (M3 Pro) on the native AGX3 path aurora-silicon/mesa#23, G14X compute preemption: qualify merged M2 Max default and broader hardware #25).[0x7000000000, 0x7100000000).drm_gpu::DrmGpu/gpu::Gpu.asahi.rs→asahi_core.rs, sog15/glue.olinks intoasahi.o.gpu@292400000/gpu@40a400000nodes are used.apple_pmp_set_device_power().soc: apple: pmp: let a T6030 consumer vote without a readiness reportmakes that work without anapple,pmp-reportphandle. T6031 needs no vote.Display: integration's stack plus #358/#363
Ported from #358:
APPLE_SIO_T6030enabled inasahi.config;Ported from #363: the J514C (M3 Max 14-inch) board record.
Kept from integration:
Platform: integration's base plus #358
pmp-report.c, the T6030 PTD owner, and is applied after the PMP reports ready.apple,tunable-ptd-range, not constants.apple_pmp_report_check_ready().apple,no-auto-pmis honoured;apple,inherited-onis documented as integration uses it.t6030_dpinhandling, so USB4 DP-IN routes still work. drm/apple: time-stamp T6030 swaps on 14.7 for 120 Hz #358's DPPHY-only T6030 crossbar would have refused them.Not ported:
pmp-ptd, foreign PMGR parents,of_iommu, and the ATC T6030 DP profile (integration's T8122-generation DP path has byte-identical PLL rows and presets);Testing
asahi.config:Image modules dtbspasses (7.1.12-gee4f0f3ee295). The asahi crate has dead-code warnings only: 26 in integration's untouched T8122g16_*runtime and 5 inm3_*/t8122_*, 16 from theg15/PR files, and 11 from the legacyG15V14_8_3instantiation that the versions macro still generates for the T8122 runtime's firmware structs (cleanup follow-up).g17/is byte-identical tointegration/aurora.tools/asahi/m3-runtime-tests.rs) pass 41/41.🤖 Generated with Claude Code