Repository navigation
drm/apple: support independent dual dock DP streams on J414s - #46
DjDeveloperr wants to merge 29 commits into
Conversation
Retain the last available DCP route and avoid retraining unrelated outputs during the immediate DP-to-USB4 teardown sequence. Keep synthetic DPMS disconnects separate from physical cable removal, while allowing positive hotplug events through after a replug. Let the RTKit crash callback, rather than a power-off clear-swap timeout, establish a fatal firmware crash.
Extend the T6020 ATC tunnel clock gate and dcpext0 preference to J414s. Re-establish the DCP route when a new dock tunnel appears after a controller detach without a prior teardown callback. Tested on J414s m2fix42: dock DP tunnel enabled USB-3 at 1920x1280@60, direct USB-2 at 3840x2160@120 and eDP at 3024x1964@120 with active CRTCs and zero failed units. Controller-detach disconnect reporting remains under investigation.
Route an available direct Type-C DP-alt-mode display to dcpext1 first so dcpext0 remains available for a dock DP tunnel. The tunnel still prefers dcpext0, which is the pipeline that completes link training on T6020. m2fix45 cold-booted with both displays attached: direct 3840x2160@120 on dcpext1 and dock 1920x1280@60 on dcpext0 came up without port resets, alongside eDP. SEP identity, haptic FF ioctl, and AVD H.264 decode remained functional.
Route DPIN1 through the native T602x crossbar fields and source selector, give the two tunnel streams separate DCP connector/route ownership, and keep both ATC pixel clocks alive at independent link rates. Wait for Type-C IOMFB hotplug after a display power-on. The dual-dock path was exercised on J414s/m2fix48 with Dell 3840x2160@120 and JTG 1920x1280@60, per-output DPMS and idle/wake; the user confirmed the displayed image. This commit removes a frame-complete callback that had no register side effect. The cleaned tree builds with the Asahi profile; the cleaned commit itself is not yet deployed.
Apple host USB3 adapters do not acknowledge bandwidth-allocation writes, so their software-only initial allocation should not be treated as consumed USB3 bandwidth when admitting DP tunnels. Read the downstream router USB3 UP adapter consumed-bandwidth counters instead, retaining 900 Mb/s minimum headroom for isochronous traffic. If those counters cannot be read, keep the existing conservative allocation estimate. The change does not cap USB3 bulk traffic or write the unsupported host registers. The m2fix48 dock test reached Dell 4K120 and JTG 60 with USB devices enumerated; a standalone throughput or isochronous stress test has not been performed.
Preserve the underscore-form USB4 controller aliases used by the tested m1n1 handoff, and build the USB4 connection manager and Apple NHI with the Asahi profile. Keep unrelated SEP and host configuration out of this stack.
|
Amazing work! Any chance this will also work on M2 Max? Claude wrote this tiny patch to support it, but I'm not sure it's right that that is all that is needed: https://paste.debian.net/hidden/3273dbee |
Just tried it out and my CalDigit USB Pro (Thunderbolt 3) hub works great with 2 4k@60 32" LCDs. Summary from Claude: Tested on J416c (16" M2 Max): two independent 4K60 dock streams workingWith a 4-line patch that adds Setup
Patch (J416c enablement)--- a/drivers/gpu/drm/apple/apple_drv.c
+++ b/drivers/gpu/drm/apple/apple_drv.c
@@ -438,7 +438,8 @@
for (idx = 0; idx < nr_ports *
- (of_machine_is_compatible("apple,j414s") ? 2 : 1); idx++) {
+ ((of_machine_is_compatible("apple,j414s") ||
+ of_machine_is_compatible("apple,j416c")) ? 2 : 1); idx++) {
--- a/drivers/gpu/drm/apple/dcp.c
+++ b/drivers/gpu/drm/apple/dcp.c
@@ -607,7 +607,8 @@
- if (of_machine_is_compatible("apple,j414s")) {
+ if (of_machine_is_compatible("apple,j414s") ||
+ of_machine_is_compatible("apple,j416c")) {
@@ -781,7 +782,8 @@
- if (of_machine_is_compatible("apple,j414s") &&
+ if ((of_machine_is_compatible("apple,j414s") ||
+ of_machine_is_compatible("apple,j416c")) &&
candidate->dcp->fixed_phy)
--- a/drivers/phy/apple/atc.c
+++ b/drivers/phy/apple/atc.c
@@ -2370,7 +2370,8 @@
(!of_machine_is_compatible("apple,j414s") &&
- !of_machine_is_compatible("apple,j416s")))
+ !of_machine_is_compatible("apple,j416s") &&
+ !of_machine_is_compatible("apple,j416c")))J416c shares the What works
Issues seen1. A tunnel that goes idle is not re-established on the next modeset. The next modeset (fbcon on VT switch, ~63 s) then failed on both pipes, and both connectors were marked disconnected: (identical sequence on 2. Boot race with autologin compositors (probably not specific to this PR, but made worse). Not tested
Happy to run more tests or collect traces. |
|
Nice work. One finding from j416s that overlaps the ATC tunnel-clock part here, so I'd rather coordinate than open a competing PR. Same observation as your "PLL retains lock" comment. On #14/#25, a compositor off/on went through Your DPMS path avoids that by never tearing the PLL down on DPMS, so it covers the off/on case. The full teardown in What powers it down: clearing Proposal: once #14/#46 settle, I send a small follow-up on top of #46 that adds only this power-down to Also a heads-up: #25 carries a newer version of #14's tunnel commit that polls for the lock to clear in (Found and written with Claude's help, per the project's LLM policy.) |
J416c (16" M2 Max, T6021) shares the T602x ATC PHY, display crossbar, USB4 NHI and the dcpext0/dcpext1 layout with J414s; only the board gates differ. Treat J416c like J414s: two connectors per Type-C port, DPIN0 -> dcpext0 and DPIN1 -> dcpext1, direct DP-alt displays prefer dcpext1 so dcpext0 stays free for a dock tunnel, and allow the ATC tunnel clock. Tested on J416c with a CalDigit USB-C Pro Dock (Thunderbolt 3): two 3840x2160@60 displays through the dock plus the internal panel at 120 Hz, on hotplug and with the dock connected at boot. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RJ Skerry-Ryan <[email protected]>
The per-port Type-C connectors carry DisplayPort (DP alt mode or a Thunderbolt/USB4 DP tunnel), but were registered as DRM_MODE_CONNECTOR_USB, which DRM reserves for USB display adapters (gud, appletbdrm). Userspace keys on the type: systemd-logind only counts VGA/DVI/DP/HDMI/TV connectors as external displays, so a docked lid close suspended the machine instead of honoring HandleLidSwitchDocked=ignore. Register them as DisplayPort. The driver's internal "is Type-C" checks use dcp->connector_type / fixed_connector_type and are unaffected. Connectors are now named DP-N instead of USB-N. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RJ Skerry-Ryan <[email protected]>
PCIe-C root ports behind a USB4 router must be cold-initialized before use. Today the kernel only accepts ports the bootloader initialized and reported through "apple,pciec-preinit-status", which no m1n1 does. Add a boolean for PCIe-C nodes that tells the OS to do the cold init itself when the USB4 PCIe tunnel comes up. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RJ Skerry-Ryan <[email protected]>
PCIe-C tunnel support requires m1n1 to cold-initialize the port and report "apple,pciec-preinit-status" = 1, but no m1n1 does so. On J414/J416 the tunnel is therefore always disabled and PCIe devices behind Thunderbolt 3 docks (whose USB is an xHCI behind the tunnel) never appear. m1n1 already copies the PCIe-C tunables into the DT and the driver has the port enable sequence. For ports marked "apple,pciec-kernel-init", let the kernel do the cold init, as #8 does for t8103: - apple_pcie_tunnel_cold_init() follows the enablePortHardware() baseline of apple_pcie_tunnel_start(): debug/fabric tunables, port reset table and tunables, PERST off and APPCLK on, wait for RUN, and only then the root-complex (config space) tunables. Touching config space while APPCLK is still off hard-resets a J416c. - apple_pcie_tunnel_prepare() runs it on transient mappings before the tunnel children are populated, since the DART never completes an invalidation while APPCLK is gated. A port that is already running is left alone. - The Thunderbolt glue and the host bridge accept kernel-init ports in place of the m1n1 handoff. As the sequence is new on T602x, it is gated behind pcie_apple.tunnel_kernel_init (default off), checked before the first PCIe-C MMIO access. pcie_apple.tunnel_kernel_init_trace_ms logs each step and pauses after it, for locating failures with a persistent log. Tested on J416c with a CalDigit USB-C Pro Dock (Thunderbolt 3, Titan Ridge xHCI 8086:15f0): the dock's hubs, keyboard, audio, SD reader, webcam and Ethernet work, including after unplug and replug. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RJ Skerry-Ryan <[email protected]>
No m1n1 performs the PCIe-C preinit handoff on these machines. Mark apciec0-2 "apple,pciec-kernel-init" so the kernel cold-initializes the Thunderbolt PCIe tunnel ports itself. The tunneled DART driver also requires "apple,tunable", but iBoot adds the corresponding "dart-tunables-instance-0" to the ADT only at boot and m1n1 does not copy it for dart-apciec*. Without it the DART fails to probe and devices behind the tunnel time out. Add the values from the live J416c ADT (macOS ioreg), identical for all three ports; the same decoding reproduces entry for entry the apciec tunables m1n1 already copies into the DT. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RJ Skerry-Ryan <[email protected]>
A Type-C port's encoder spans every pipeline that can drive the port, and routing narrows its possible_crtcs to the pipeline actually chosen, relying on userspace to re-read them on the following hotplug. Compositors that read possible_crtcs once when the connector appears (aquamarine, used by Hyprland) never see that. With a USB4 dock carrying two streams, whichever connector connects first takes the lowest free CRTC. When that is the DPIN1 connector, it gets dcpext0's CRTC while the stream is routed to dcpext1, every modeset fails the atomic check with -EINVAL, and both dock displays stay dark until the dock is replugged and happens to connect in the other order. possible_crtcs is meant to be static. On the dual-stream machines (J414s, J416c): - Fix the DPIN1 connector to the lowest-indexed Type-C-only pipeline (dcpext1), where DPIN1 is always routed, and route DPIN1 only within the connector's possible_crtcs. - Leave the primary connector spanning all its pipelines and stop narrowing or restoring possible_crtcs at runtime. - Route direct DP-alt displays to the lowest free CRTC, which is what a compositor picks from the port's fixed possible_crtcs, instead of steering them away from dcpext0. A direct DP-alt display now takes dcpext0 when it is free, so a single-stream dock on another port lands on the next free pipeline. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RJ Skerry-Ryan <[email protected]>
PCIe-C is populated from delayed work queued when the PCIe tunnel is
activated. If the cable bounces, the tunnel can be deactivated before
that work runs; pcie_tunnel_requested stays set, so the work then
cold-initializes and starts PCIe-C against a tunnel that no longer
exists. On J416c the port then never links again ("link didn't come
up") until reboot, even after replugging or power-cycling the dock.
Clear the request and cancel the pending work on tunnel deactivation.
The work already re-checks the request under pcie_tunnel_lock, so a run
that is in progress either completes before the teardown takes the
lock, and is quiesced by it, or does nothing.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: RJ Skerry-Ryan <[email protected]>
When the USB4 router disappears during suspend (e.g. a Thunderbolt 3 dock under s2idle), the NHI's resume tears the PCIe tunnel down and quiesces this host before PCIe-C's own resume_noirq runs. That resume then starts the ports anyway, training against a tunnel that no longer exists; on J416c the port is afterwards unable to link on every later connect until reboot. Skip restarting the ports when the host has been quiesced. They are started again by apple_pcie_tunnel_restore(), or cold-initialized by a fresh populate, once a new tunnel is up. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RJ Skerry-Ryan <[email protected]>
DCP tears its EPIC services down when an external display disconnects and announces them again on fresh channels when it reconnects; it never reuses a channel. On the j416s DPAVSERV endpoint (0x28), every compositor off/on or replug of the display tears down dcpav-service-epic (the service EDID is read through) and dcpdp-service-epic, and announces both again: channels 1/3 at boot, then 5/7, 9/11 and so on. afk_recv_handle_init() handed out slots append-only (ch_idx = num_channels++), and teardown only disables a service, so its slot was never given back. After boot plus seven reconnects all AFK_MAX_CHANNEL (16) slots were used, and the next reconnect failed: AFK[ep:28]: too many enabled services! AFK[ep:28]: expected announce but got 0xc0 on channel 33 The re-announced dcpav-service-epic then had no slot, so dcpavserv stayed disabled and dcp_get_modes() skipped the EDID read without logging anything. The connector's EDID stayed empty for the rest of the boot, and a physical replug did not bring it back, since the endpoint is never restarted. Reuse a slot whose service was torn down, is disabled and has no command pending. Pending commands keep their buffers in the slot until the firmware acks them, so such a slot is left alone. The slot lock is initialised once, when the slot is first used. Add debug messages for teardown and slot reuse, since a normal teardown was not logged at all. Confirmed on hardware: M2 Pro (j416s), BenQ 1440p through a USB4 hub, fresh boot, 10 compositor off/on toggles. Each cycle logs teardown of dcpdp-service-epic and dcpav-service-epic, then "reusing slot 0" and "reusing slot 1" as the two services come back, with channels reaching 43 and no "too many enabled services". The EDID read back as 256 bytes after every toggle and Hyprland kept identifying the display. Co-authored-by: Claude Opus 5.5 <[email protected]> Signed-off-by: Oliver Lukschander <[email protected]> (cherry picked from commit 6fdc8fe) Signed-off-by: RJ Skerry-Ryan <[email protected]>
The send-empty interrupt is requested with IRQF_NO_AUTOEN. apple_mbox_send() enables it when the A2I FIFO is full and it has to wait, and the interrupt handler disables it again when it fires. When the wait times out or is interrupted by a signal, apple_mbox_send() returns with the interrupt still enabled, so the next send that has to wait calls enable_irq() on a line that is already enabled. The IRQ core warns about the unbalanced enable, and from then on the enable state no longer tracks whether a sender is waiting. On T8140 this shows up as "Unbalanced enable for IRQ" warnings from the SEP hwrng thread, whose sends can wait longer than the 500 ms timeout. Track whether the interrupt is unmasked in struct apple_mbox, protected by tx_lock. The sender enables it only while it is masked, the handler disables it only while it is unmasked, and a sender whose wait failed disables it unless a late interrupt already has. Disabling it unconditionally on the error path would not work: the handler may already be waiting for tx_lock and would then disable it a second time. Fixes: 6e1457f ("soc: apple: mailbox: Add ASC/M3 mailbox driver") Assisted-by: LLM checkpatch sparse Co-authored-by: Claude Fable 5.1 <[email protected]> Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit 7a155e3) Signed-off-by: RJ Skerry-Ryan <[email protected]>
apple_rtkit_free() and apple_rtkit_reinit() stopped the mailbox and destroyed or flushed the workqueue, but left the mailbox's rx callback and cookie pointing at the instance the whole time. A message popped by a concurrent apple_rtkit_poll() or a work item queued just before the stop could still reach the consumer's callbacks while its state was being torn down, and apple_rtkit_init() left a dangling receiver behind when the workqueue allocation failed. Make the receiver an explicit ownership: claim the mailbox rx callback under rx_lock once the workqueue exists, detach it (with the interrupt already disabled by apple_mbox_stop()) before draining the queue, drop messages that arrive or were queued once teardown has started, and release the cookie only after all host state is gone. apple_rtkit_reinit() re-arms the receiver under the lock and detaches again if the mailbox fails to start. A mailbox poll with no receiver attached returns without touching the FIFO; the entries are drained once a receiver is attached again. Claiming a mailbox that already has a receiver keeps the previous behaviour of taking it over, now with a warning, so existing consumers that never free their instance can still rebind. Assisted-by: LLM checkpatch sparse Co-authored-by: Claude Fable 5.1 <[email protected]> Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit 692a3c6) Signed-off-by: RJ Skerry-Ryan <[email protected]>
apple_dart_hw_map_locked_ttbr() maps the L1 table of a locked DART stream with devm_memremap() and checks the result for NULL, but devm_memremap() never returns NULL: it returns ERR_PTR(-ENOMEM) or ERR_PTR(-ENXIO) on failure. A failed mapping was therefore stored as the table pointer, and apple_dart_hw_sync_locked() then wrote the page-table entries through it and apple_dart_hw_unmap_locked_ttbr() passed it to memset(). The NULL check was added together with the locked-DART page-table code by commit 0d4ec07 ("iommu/dart: Add iommu_ops for locked DARTs"), and became reachable once locked DARTs were allowed to probe. Check the result with IS_ERR() and return the error, so that no error pointer is ever stored. Fixes: 85322eb ("iommu/dart: Support locked DARTs") Assisted-by: LLM checkpatch sparse Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit 162b646) Signed-off-by: RJ Skerry-Ryan <[email protected]>
commit d87cb88 upstream. apple_soc_cpufreq_init() adds OPP tables from firmware, but some failure paths do not remove them. The driver also uses dev_pm_opp_remove_all_dynamic(), which is not the right cleanup helper for OPP tables loaded from firmware. Use the cpumask OPP helper after the policy CPU mask has been populated. Pair it with the matching cpumask remove helper on failure paths and in apple_soc_cpufreq_exit(). This also removes the separate dev_pm_opp_set_sharing_cpus() call, as the cpumask helper loads the DT OPP tables for all CPUs in the policy. Fixes: 6286bbb ("cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states") Cc: [email protected] Signed-off-by: Haoxiang Li <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit eb346c1) Signed-off-by: RJ Skerry-Ryan <[email protected]>
apple_soc_cpufreq_exit() drops the static OPP tables with dev_pm_opp_of_cpumask_remove_table(policy->cpus), but policy->cpus is always empty by then. __cpufreq_offline() clears the outgoing CPU from the mask first and calls ->exit() only once the last CPU of the policy has gone, and unbinding the driver takes the same path. The call removes nothing, so every time a cluster goes fully offline and comes back, or the driver is rebound, the OPP table of each of its CPUs is left with one more reference and is never freed. Remove the tables of policy->related_cpus instead, which still lists every CPU the policy covered, as qcom-cpufreq-hw does. The error path of apple_soc_cpufreq_init() keeps using policy->cpus, because the core fills in related_cpus only after ->init() has succeeded. Fixes: d87cb88 ("cpufreq: apple-soc: Fix OPP table cleanup") Assisted-by: LLM checkpatch sparse Co-authored-by: Claude Fable 5.1 <[email protected]> Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit 6559da7) Signed-off-by: RJ Skerry-Ryan <[email protected]>
commit f61c934 upstream. apple_nvme_init_queue() initializes queue state and then marks the queue enabled. The interrupt and request paths check enabled before using that queue state. The old wmb() after WRITE_ONCE(enabled, true) does not publish the earlier initialization before enabled becomes visible. Use a release store when enabling the queue and acquire loads when testing it. Although the shutdown-side enabled accesses are not used for publishing queue initialization, use helpers for them as well for consistency. Fixes: 5bd2927 ("nvme-apple: Add initial Apple SoC NVMe driver") Signed-off-by: Gui-Dong Han <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit 8d4657c) Signed-off-by: RJ Skerry-Ryan <[email protected]>
apple_pmp_report_probe() allocates the report with devm_kzalloc() but never initializes rep->lock. The first apple_pmp_report_set_state() from a child entry's probe then takes an uninitialized spinlock; with lockdep this is reported as a non-static key and lockdep turns itself off for the rest of the boot: INFO: trying to register non-static key. ... _raw_spin_lock_irqsave apple_pmp_report_set_state apple_pmp_report_entry_probe Initialize the lock before of_platform_populate() creates the entries. Tested on j416s (M2 Pro) with PROVE_LOCKING: the report is gone and lockdep stays enabled. Fixes: e5f8c27 ("pmdomain: apple: Add PMP reporting interface") Signed-off-by: Oliver Lukschander <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 583b9fa) Signed-off-by: RJ Skerry-Ryan <[email protected]>
Commit c300d1b ("soc: apple: pmgr: Add force-disable/force-reset") changed the transition poll in apple_pmgr_ps_set() to read into cur, but left the timeout message printing reg, which now holds the value that was written. Since then the "now:" field shows what was requested rather than the state the domain is stuck in. Print both the value written and the last value read back. On T8140, audio_leap_mca occasionally misses the 100 us poll window, and the read-back value (0xa4f: BUSY set, ACTUAL clock-gated, TARGET active) is what tells a slow transition from a failed one. Fixes: c300d1b ("soc: apple: pmgr: Add force-disable/force-reset") Assisted-by: LLM checkpatch sparse Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit 2768025) Signed-off-by: RJ Skerry-Ryan <[email protected]>
apple_pmgr_ps_set() builds the words it writes from a read of the power state register. It clears the WAS_CLKGATED and WAS_PWRGATED flags but not BUSY (bit 11), which the hardware reports while a transition is still in progress: on T8140 audio_leap_mca reads back 0xa4f, with BUSY set, after missing the 100 us poll window. A value read in that state was written back with BUSY set. Clear BUSY in the DEV_DISABLE/PS_RESET write that precedes a power-down and in the target state write, which the auto-enable write reuses. This changes the value written on every SoC that uses this driver. No failure attributable to writing BUSY back was observed; the change is precautionary, as the bit is hardware-owned. The error messages in apple_pmgr_ps_set() and in the reset assert and deassert paths are printed from genpd and reset callbacks that consumers retry, so a domain that keeps missing its poll window, as audio_leap_mca does on T8140, repeats the same message on every attempt. Ratelimit them; their text is unchanged. Assisted-by: LLM checkpatch sparse Co-authored-by: Claude Fable 5.1 <[email protected]> Signed-off-by: Ryan Murray <[email protected]> (cherry picked from commit afe19ef) Signed-off-by: RJ Skerry-Ryan <[email protected]>
|
Tested on j416s (16" M2 Pro): two displays behind one dock work. Setup:
There was no Gate change used for the testdiff --git a/drivers/gpu/drm/apple/apple_drv.c b/drivers/gpu/drm/apple/apple_drv.c
index 4fcfac0f695d..3245c089d38c 100644
--- a/drivers/gpu/drm/apple/apple_drv.c
+++ b/drivers/gpu/drm/apple/apple_drv.c
@@ -438,7 +438,8 @@ static int apple_probe_typec_ports(struct drm_device *drm,
* append one more connector per port for a second USB4 DP tunnel.
*/
for (idx = 0; idx < nr_ports *
- (of_machine_is_compatible("apple,j414s") ? 2 : 1); idx++) {
+ ((of_machine_is_compatible("apple,j414s") ||
+ of_machine_is_compatible("apple,j416s")) ? 2 : 1); idx++) {
struct apple_connector *connector;
struct apple_encoder *enc;
unsigned int port_idx = idx % nr_ports;
diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c
index 9578e688b0f1..a35a28376af5 100644
--- a/drivers/gpu/drm/apple/dcp.c
+++ b/drivers/gpu/drm/apple/dcp.c
@@ -607,7 +607,8 @@ int apple_dcp_tb_dp_tunnel(struct device_node *connector_np, unsigned int dpin,
* streams through one dock. Retain J416s' existing preference
* until its second pipeline has been validated separately.
*/
- if (of_machine_is_compatible("apple,j414s")) {
+ if (of_machine_is_compatible("apple,j414s") ||
+ of_machine_is_compatible("apple,j416s")) {
if ((dpin == 0 && !candidate->dcp->fixed_phy) ||
(dpin == 1 && candidate->dcp->fixed_phy))
score += 100;
@@ -781,7 +782,8 @@ static int dcp_typec_route_set(struct typec_mux_dev *mux,
* tunnel when a direct DP-alt-mode display can use
* the Type-C-only dcpext1 pipeline.
*/
- if (of_machine_is_compatible("apple,j414s") &&
+ if ((of_machine_is_compatible("apple,j414s") ||
+ of_machine_is_compatible("apple,j416s")) &&
candidate->dcp->fixed_phy)
score += 100;
if (score < best_score) {Not yet covered with two displays: replug, DPMS and suspend. This test kernel is on #14's base, Also, |
|
Follow-up with the same two displays on j416s:
|
|
@DjDeveloperr I've ported this series onto #8 ( |
On a 16" M2 Pro (j416s) the built-in screen stayed black on 11.17/11.18 while the session ran. apple-drm registered about 30 s into boot, after the desktop had started on the boot framebuffer (simpledrm), and the session was left without its screen; restarting the display manager brought it back (same symptom reported on a j416c in aurora-silicon/linux#46). An sddm drop-in now waits for a DRM card bound to apple-drm before the display manager starts. It only waits on a Mac whose device tree enables an Apple display subsystem, gives up after 30 s and never fails the start, so where apple-drm is already up (3.9 s on an M1 Air) it costs nothing. Signed-off-by: Chris Kearney <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
The shared TIPD core can be built in for the SPMI transport while the I2C transport is a module. Descending with the I2C setting then omits the built-in core from the parent archive, leaving the I2C module with unresolved TIPD references at modpost and omitting the SPMI driver from vmlinux. Use TYPEC_TPS6598X_CORE for directory traversal, as in the current aurora-wip Makefile. The child Makefile already selects the core and both transports independently. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The board property permits experimental kernel cold initialization, but must not reject an existing successful m1n1 handoff. Admit the explicit preinit certificate in both the population gate and preparation helper without touching cold-init registers. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Keep receiver ownership reserved until teardown finishes. A competing initialization must return EBUSY instead of overwriting the callback and cookie, and must not stop the mailbox owned by the existing receiver. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
usb: typec: tipd: descend according to the shared core
[follow-up to #50] PCI: apple: retain preinitialized tunnels when cold init is disabled
drm/apple: support independent dual dock DP streams on J414s Original contributor commits are preserved. Conflict resolutions retain the audited shared driver APIs and their integrated review fixes. Contributor credit; Signed-off-by outstanding: - 2530a2c: Ryan <[email protected]> - 9e93cac: Ryan <[email protected]> - 3075f55: DjDeveloperr <[email protected]> - a9aa605: DjDeveloperr <[email protected]> - 0cd936d: DjDeveloperr <[email protected]> - aff9d4e: DjDeveloperr <[email protected]> - a044eab: DjDeveloperr <[email protected]> - c5653cb: DjDeveloperr <[email protected]> - e9e52e6: Oliver Lukschander <[email protected]> - 0c16b38: Oliver Lukschander <[email protected]> - e83f46d: Oliver Lukschander <[email protected]> - 2b5254a: Oliver Lukschander <[email protected]> - cc895f2: Oliver Lukschander <[email protected]> - f8cec39: Oliver Lukschander <[email protected]> - 81eee7b: Oliver Lukschander <[email protected]> - 45c34d5: Oliver Lukschander <[email protected]> - 6f0468f: Oliver Lukschander <[email protected]> Ryan integrates these contributions under DCO (b); no author signature is forged. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
drm/apple: support independent dual dock DP streams on J414s Original contributor commits are preserved. Conflict resolutions retain the audited shared driver APIs and their integrated review fixes. Contributor credit; Signed-off-by outstanding: - 2530a2c: Ryan <[email protected]> - 9e93cac: Ryan <[email protected]> - 3075f55: DjDeveloperr <[email protected]> - a9aa605: DjDeveloperr <[email protected]> - 0cd936d: DjDeveloperr <[email protected]> - aff9d4e: DjDeveloperr <[email protected]> - a044eab: DjDeveloperr <[email protected]> - c5653cb: DjDeveloperr <[email protected]> - e9e52e6: Oliver Lukschander <[email protected]> - 0c16b38: Oliver Lukschander <[email protected]> - e83f46d: Oliver Lukschander <[email protected]> - 2b5254a: Oliver Lukschander <[email protected]> - cc895f2: Oliver Lukschander <[email protected]> - f8cec39: Oliver Lukschander <[email protected]> - 81eee7b: Oliver Lukschander <[email protected]> - 45c34d5: Oliver Lukschander <[email protected]> - 6f0468f: Oliver Lukschander <[email protected]> Ryan integrates these contributions under DCO (b); no author signature is forged. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Summary
Stacked on #14 (
oliverlukschander:j416s-usb4-dp-tunnel-pr,currently
e9e52e6dc932). Because that head lives in a fork, this PR targetsreview/pr14-base, an unchanged copy of that exact commit in this repository.Retarget to
aurora-wipafter #14 merges; do not merge this base branch as asubstitute for reviewing #14.
This PR contains only the local Thunderbolt/Type-C display follow-up fixes;
it does not include SEP/Neo, AVD, haptics, userspace compositor changes, or
the ongoing bandwidth-allocation experiments.
The main change is to give J414s two independent display streams through
one USB4/Thunderbolt dock instead of sharing one connector, DCP ownership
slot, or pixel-clock state between both DP IN adapters.
Changes
unrelated displays during the immediate DP-to-USB4 detach sequence.
allow a positive hotplug through after a replug. Do not equate a clear-swap
timeout during power-off with an RTKit crash.
teardown. Prefer the Type-C-only DCP for direct displays, leaving the
hybrid DCP available for a dock stream.
Preselect the DCP source before AUX probing; fix the T602x DPIN1 crossbar
fields and preserve the other stream's gates.
PCLK1 prerequisite and the PLL descriptor across DPMS. Wait for IOMFB HPD
readiness on wake before powering the display pipeline.
bandwidth from the downstream USB3 UP adapter rather than treating the
software maximum as permanently occupied. Preserve conservative fallback
on read failure and the 900 Mb/s minimum before PCIe weighting. This is
admission accounting, not a USB bulk-transfer rate cap.
connection manager / Apple NHI modules in the Asahi configuration.
Validation
Hardware evidence comes from these fixes in the combined m2fix48 development
tree on a J414s M2 Pro with a Winstars WL-UTD59 dock. The user visually
confirmed both dock displays working together. Recorded checks also cover
cold boots, individual/all-display DPMS cycles, natural idle/wake, and
controlled dock-controller re-enumeration. Later remote tests reported both
Dell S2725QC and Samsung Odyssey G81SF at 3840x2160@120 after a manual mode
change; that report is not an independent optical validation of those modes.
For this isolated PR branch:
appledrm,thunderbolt,thunderbolt_apple,phy-apple-atc,and
mux-apple-display-crossbaras external modules against the warmm2fix48 build output and its Module.symvers, using Clang on ARM64.
DTC invocation emits warnings, including existing reserved-memory and
bus-node naming warnings; this is not a clean DT-schema validation.
and the DTB (the build guest has an unresolved page-cache issue).
git diff --checkandcheckpatch.pl --no-tree --no-signoffpass.The isolated branch has not been booted as a complete kernel. The test
machine is left unchanged by this PR preparation.
Known limitations / review focus
allocation. Samsung-first attachment can still constrain the second
display's available modes. General dual-4K120 hotplug reliability remains
under investigation.
delay and bandwidth tracing; neither is included here. Do not attribute
all results from that image to this clean patch stack alone.
automatic retraining experiment, raw packet counters, or speculative
firmware-reply modifications are included.
isochronous devices joining after display allocation; no claim of
exhaustive USB3/PCIe contention testing is made.
controller re-enumeration is not equivalent to every physical cable-pull
sequence.
positive replug notifications and the IOMFB readiness wait. Userspace
route-mask refresh and layer-position fixes used on the test system are
outside this kernel PR.
Please review/merge after #14, or retarget once #14 lands. The six commits
are intentionally separate from the combined development branch.