From 17ae3010c330aa2952bb955a400ec7c107ef97e5 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 16:12:02 -0500 Subject: [PATCH 1/7] drm/apple: m4: answer the firmware clock-frequency request from the DT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 26.6.2 firmware asks the AP for its display clock frequencies via D408 (index 0 and index 1). The M4 backend currently answers 48 and 24 MHz—the values the J713 panel handoff was qualified with—for every DCP. On the Mac mini, macOS answers from the display's ADT clock-ids looked up in /arm-io clock-frequencies (id - 0x100): 533333328 Hz for dcpext0/dcpext1 (clock-ids 369 and 372), matching how aura's J616c 27.2 handoff and the J813 device tree publish theirs. Answering 48 MHz on the J773g causes the firmware to reject the pixel clock on every modeset. Take the index-0 rate from the DCP node's own clock in the device tree (a fixed clock at its first clock-id's rate) and answer 0 for index 1, whose ADT rate is 0 on the M4. A DCP without a clock keeps 48 and 24 MHz. Signed-off-by: Diljit Singh --- drivers/gpu/drm/apple/dcp-m4-callback.h | 12 +++++++- drivers/gpu/drm/apple/iomfb_m4.c | 37 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/apple/dcp-m4-callback.h b/drivers/gpu/drm/apple/dcp-m4-callback.h index 7a6fb73856e1a..81fb52af62cad 100644 --- a/drivers/gpu/drm/apple/dcp-m4-callback.h +++ b/drivers/gpu/drm/apple/dcp-m4-callback.h @@ -26,6 +26,12 @@ struct dcp_m4_callback_ops { * Absent: the optional service is declined (status 1). */ int (*bandwidth)(void *cookie, void *output); + /* + * D408 clock-frequency request (@index): the DCP's own firmware clock rate, 0 + * if the device tree gives it. Absent or failing: the answers the J713 + * handoff was qualified with. + */ + int (*clock_rate)(void *cookie, u32 index, u64 *rate); }; struct dcp_m4_callback_shape { @@ -120,6 +126,7 @@ static inline int dcp_m4_callback_dispatch(const struct dcp_m4_callback_ops *ops u8 *out = output; int method, ret; u32 value; + u64 rate; method = dcp_m4_callback_shape(tag, input_size, output_size); if (method < 0) @@ -186,7 +193,10 @@ static inline int dcp_m4_callback_dispatch(const struct dcp_m4_callback_ops *ops value = get_unaligned_le32(in + 4); if (memcmp(in, "VORP", 4) || value > 1) return -EINVAL; - put_unaligned_le64(value ? 24000000 : 48000000, out); + if (ops->clock_rate && !ops->clock_rate(cookie, value, &rate)) + put_unaligned_le64(rate, out); + else + put_unaligned_le64(value ? 24000000 : 48000000, out); return 0; case 590: value = get_unaligned_le32(in); diff --git a/drivers/gpu/drm/apple/iomfb_m4.c b/drivers/gpu/drm/apple/iomfb_m4.c index e2ddcfae78139..d52b3a10554ed 100644 --- a/drivers/gpu/drm/apple/iomfb_m4.c +++ b/drivers/gpu/drm/apple/iomfb_m4.c @@ -8,6 +8,7 @@ * completion; an uncertain transaction stays pinned until reboot. */ #include +#include #include #include #include @@ -163,6 +164,9 @@ struct iomfb_m4 { size_t coproc_size; /* The realtime bandwidth mailbox from the DT (0: none), see dcp_m4_bw_mailbox() */ u64 bw_mailbox; + /* D408: the firmware clock rate from the DT, see dcp_m4_fw_clock() */ + bool fw_clock; + u64 fw_clock_hz; struct work_struct backlight_work; void __iomem *coproc; struct apple_rtkit *rtkit; @@ -1424,8 +1428,19 @@ static int dcp_m4_runtime_bandwidth(void *cookie, void *output) return 0; } +static int dcp_m4_runtime_clock_rate(void *cookie, u32 index, u64 *rate) +{ + struct dcp_m4_runtime *r = cookie; + + if (!r->dcp->fw_clock) + return -ENOENT; + *rate = index ? 0 : r->dcp->fw_clock_hz; + return 0; +} + static const struct dcp_m4_callback_ops dcp_m4_runtime_ops = { .call = dcp_m4_runtime_call, + .clock_rate = dcp_m4_runtime_clock_rate, .property = dcp_m4_runtime_property, .memory = dcp_m4_runtime_memory, .event = dcp_m4_runtime_event, @@ -2567,6 +2582,27 @@ static bool iomfb_m4_firmware_property(struct device_node *np, const char *name) version[0] == 26 && version[1] == 6 && version[2] == 2; } +/* + * The rate the firmware asks for with D408 clock-frequency request (index 0): the DCP's + * own clock in the device tree (a fixed clock at the rate of the display's + * first ADT clock-id, as macOS answers), index 1 then returns 0, the + * rate of its second. Without one, the qualified J713 answers stand. + */ +static void dcp_m4_fw_clock(struct iomfb_m4 *dcp) +{ + struct clk *clk = of_clk_get(dcp->dev->of_node, 0); + + if (IS_ERR(clk)) { + if (PTR_ERR(clk) != -ENOENT) + dev_warn(dcp->dev, "firmware clock: %pe: the default rates stand\n", clk); + return; + } + dcp->fw_clock_hz = clk_get_rate(clk); + dcp->fw_clock = true; + clk_put(clk); + dev_dbg(dcp->dev, "firmware clock %llu Hz\n", dcp->fw_clock_hz); +} + /* * The realtime bandwidth mailbox the DT gives @dev, or 0: apple,bw-scratch * names the provider's reg range, the firmware's display register index and @@ -2677,6 +2713,7 @@ int iomfb_m4_init(struct apple_dcp *owner) dcp->owner = owner; dcp->dev = dev; dcp->bw_mailbox = dcp_m4_bw_mailbox(dev); + dcp_m4_fw_clock(dcp); mutex_init(&dcp->lock); mutex_init(&dcp->ext_modes_lock); spin_lock_init(&dcp->state_lock); From 00074371e0ff502596a32f985e311633e817572b Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 16:12:03 -0500 Subject: [PATCH 2/7] arm64: dts: apple: t8132-j773g: give the HDMI DCP its realtime bandwidth slot Without apple,bw-scratch the J773g's main DCP firmware runs with realtime bandwidth disabled on every modeset, so the pipe never asks the bandwidth controller for memory bandwidth. macOS gives the same DCP its bandwidth request slot at 0x382820000 (0x20000 into disp-4). Describe the scratch register node and wire apple,bw-scratch on &dcp. Signed-off-by: Diljit Singh --- arch/arm64/boot/dts/apple/t8132-j773g.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8132-j773g.dts b/arch/arm64/boot/dts/apple/t8132-j773g.dts index 68df9410d3363..957680592ad0f 100644 --- a/arch/arm64/boot/dts/apple/t8132-j773g.dts +++ b/arch/arm64/boot/dts/apple/t8132-j773g.dts @@ -77,9 +77,24 @@ phy-names = "dp-phy"; hdmi-pwren-gpios = <&smc_gpio 15 GPIO_ACTIVE_HIGH>; dp2hdmi-pwren-gpios = <&smc_gpio 26 GPIO_ACTIVE_HIGH>; + /* + * The main pipe's realtime bandwidth request slot (D003), as macOS + * provides it on this Mac; without it the firmware runs with realtime + * bandwidth disabled. + */ + apple,bw-scratch = <&pmgr_dcp_bw 0 4 0>; status = "okay"; }; +&soc { + /* 0x20000 into the window the main DCP has as disp-4. */ + pmgr_dcp_bw: power-management@382820000 { + reg = <0x3 0x82820000 0x0 0x8>; + reg-names = "dcp-bw-scratch"; + #apple,bw-scratch-cells = <3>; + }; +}; + &disp0_piodma { status = "okay"; }; From 8cd396e1ef724ea9744a1d248104f9ee0906f8cf Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 16:12:05 -0500 Subject: [PATCH 3/7] arm64: dts: apple: t8132-j773g: the display pipes' firmware clocks The firmware asks for its display clock rate via the D408 clock-frequency request (index 0); describe the fixed-clock nodes from the ADT's /arm-io clock-frequencies for disp0 (clock-id 364, 300 MHz) and dispext0 (clock-id 369, 533333328 Hz), and wire disp0's clock on &dcp. Signed-off-by: Diljit Singh --- arch/arm64/boot/dts/apple/t8132-j773g.dts | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8132-j773g.dts b/arch/arm64/boot/dts/apple/t8132-j773g.dts index 957680592ad0f..060c187428a06 100644 --- a/arch/arm64/boot/dts/apple/t8132-j773g.dts +++ b/arch/arm64/boot/dts/apple/t8132-j773g.dts @@ -83,9 +83,33 @@ * bandwidth disabled. */ apple,bw-scratch = <&pmgr_dcp_bw 0 4 0>; + /* D408 clock-frequency request (index 0): /arm-io/disp0 clock-id 364's ADT rate. */ + clocks = <&dcp_fw_clk364>; status = "okay"; }; +/ { + /* + * The display pipes' firmware clocks, from the ADT's /arm-io + * clock-frequencies at their first clock-id (disp0 364, dispext0 369), + * the same in the 26.6.2 and 27.2 trees. Their second clock-ids (431, + * 432) have no rate. + */ + dcp_fw_clk364: clock-dcp-firmware-364 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <300000000>; + clock-output-names = "dcp_firmware_364"; + }; + + dcp_fw_clk369: clock-dcp-firmware-369 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <533333328>; + clock-output-names = "dcp_firmware_369"; + }; +}; + &soc { /* 0x20000 into the window the main DCP has as disp-4. */ pmgr_dcp_bw: power-management@382820000 { From 864fb36ae09e7be00d698b1badd5377b5c191c63 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 16:12:06 -0500 Subject: [PATCH 4/7] drm/apple: t8132: drive the fixed HDMI port from a handed-over dcpext The Mac mini's HDMI port is reached through a T8122-style DPTX PHY and a DP-to-HDMI converter, from whichever DCP the PHY's source select names. Linux drives it from the main DCP. macOS 27.2 drives it from dcpext0: 4K60 and 4K120 (with DSC) on that pipe alone, the main DCP booted and idle. The main DCP's pipe tops out where dcpext0's does not (300 vs 533.33 MHz firmware clock). Let a T8132 dcpext the boot loader handed over serve the fixed HDMI port when its node says so (apple,connector-type = "HDMI-A"), as the main DCP does: the PHY and converter rails are prepared, the DPTX port connects after the adoption, and no Type-C routes are registered. The PHY's source select is the DCP's index (apple,dcp-index = <1> on dcpext0), which the DPTX activation already passes. The DRM device then has no component DCP, as with the main DCP's HDMI port, and the connector is HDMI-A. Signed-off-by: Diljit Singh --- drivers/gpu/drm/apple/apple_drv.c | 8 ++++++++ drivers/gpu/drm/apple/dcp.c | 20 +++++++++++++++++--- drivers/gpu/drm/apple/dcp.h | 1 + drivers/gpu/drm/apple/t8132_ext_drm.c | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/apple/apple_drv.c b/drivers/gpu/drm/apple/apple_drv.c index 945a9c6df7692..99859a6ce6b4e 100644 --- a/drivers/gpu/drm/apple/apple_drv.c +++ b/drivers/gpu/drm/apple/apple_drv.c @@ -1456,6 +1456,10 @@ static const struct of_device_id apple_dcp_id_tbl[] = { {}, }; +/* + * Whether this DRM device has no DCP components, only T8132 external outputs: + * a main DCP or a dcpext serves the fixed HDMI port (the Mac mini). + */ static bool apple_t8132_main_external_present(void) { struct device_node *np = of_find_compatible_node(NULL, NULL, @@ -1463,6 +1467,10 @@ static bool apple_t8132_main_external_present(void) bool present = dcp_t8132_main_external(np) && of_device_is_available(np); of_node_put(np); + for_each_compatible_node(np, NULL, "apple,t8132-dcpext") { + if (!present && dcp_t8132_fixed_hdmi(np) && of_device_is_available(np)) + present = true; + } return present; } diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c index 8f1b7bef35bf7..c58b31a75a3c4 100644 --- a/drivers/gpu/drm/apple/dcp.c +++ b/drivers/gpu/drm/apple/dcp.c @@ -5975,6 +5975,19 @@ bool dcp_t8132_main_external(struct device_node *np) dcp_connector_type_from_dt(np) == DRM_MODE_CONNECTOR_HDMIA; } +/* + * A T8132 DCP that drives the fixed HDMI port: the main DCP above, or an + * external DCP the board routes to it (the Mac mini's dispext0, the pipe + * macOS drives its HDMI port from), through the same DPTX PHY and HDMI + * converter rails, the PHY's source select being the DCP's index. + */ +bool dcp_t8132_fixed_hdmi(struct device_node *np) +{ + return np && (of_device_is_compatible(np, "apple,t8132-dcp") || + of_device_is_compatible(np, "apple,t8132-dcpext")) && + dcp_connector_type_from_dt(np) == DRM_MODE_CONNECTOR_HDMIA; +} + /* * The fixed route's crossbar selection and Type-C mux are taken at probe and * must be released with the device: a crossbar left selected blocks the next @@ -7238,8 +7251,9 @@ static int dcp_platform_probe_pipe(struct platform_device *pdev) if (iomfb_is_m4(dcp)) { bool main_external = dcp_t8132_main_external(dev->of_node); + bool fixed_hdmi = dcp_t8132_fixed_hdmi(dev->of_node); - if (main_external) { + if (fixed_hdmi) { dcp->fixed_connector_type = DRM_MODE_CONNECTOR_HDMIA; dcp->connector_type = DRM_MODE_CONNECTOR_HDMIA; ret = dcp_m4_hdmi_prepare(dcp); @@ -7263,7 +7277,7 @@ static int dcp_platform_probe_pipe(struct platform_device *pdev) ret = dcp_pin_live_session(dcp); if (!ret) ret = iomfb_m4_adopt_external(dcp); - if (!ret && main_external) { + if (!ret && fixed_hdmi) { ret = dcp_desktop_dptx_connect(dcp, 0); if (ret) { dev_warn(dev, "initial HDMI DPTX connect failed: %d\n", @@ -7271,7 +7285,7 @@ static int dcp_platform_probe_pipe(struct platform_device *pdev) ret = 0; } } - if (!ret && !main_external) + if (!ret && !fixed_hdmi) dcp_t8132_ext_routes(dcp); return ret; } diff --git a/drivers/gpu/drm/apple/dcp.h b/drivers/gpu/drm/apple/dcp.h index 5f04178061351..e3bbf67a12119 100644 --- a/drivers/gpu/drm/apple/dcp.h +++ b/drivers/gpu/drm/apple/dcp.h @@ -16,6 +16,7 @@ bool dcp_h17p_external_supported(struct device_node *np); bool dcp_h17p_external_ready(struct device_node *np); bool dcp_t8132_main_external(struct device_node *np); +bool dcp_t8132_fixed_hdmi(struct device_node *np); struct apple_atomic_state { struct drm_atomic_commit base; diff --git a/drivers/gpu/drm/apple/t8132_ext_drm.c b/drivers/gpu/drm/apple/t8132_ext_drm.c index 0c219f775ef81..d8e8c2c13f65e 100644 --- a/drivers/gpu/drm/apple/t8132_ext_drm.c +++ b/drivers/gpu/drm/apple/t8132_ext_drm.c @@ -1045,7 +1045,7 @@ static int t8132_ext_out_init(struct drm_device *drm, struct platform_device *pd goto err_crtc; out->encoder.possible_crtcs = drm_crtc_mask(&out->crtc); ret = drm_connector_init(drm, &out->connector, &t8132_ext_connector_funcs, - dcp_t8132_main_external(pdev->dev.of_node) ? + dcp_t8132_fixed_hdmi(pdev->dev.of_node) ? DRM_MODE_CONNECTOR_HDMIA : DRM_MODE_CONNECTOR_DisplayPort); if (ret) goto err_encoder; From 7d3e0195e31c7dc8db8597d75203c5883ad63402 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 16:12:08 -0500 Subject: [PATCH 5/7] iommu: apple-dart: the main display DARTs serve the display device when HDMI is on dispext0 On the Mac mini the main DCP's display DARTs (disp0 at 0x30a300000 and its firmware DART at 0x30a340000) are probed in the "main external" mode only while the main DCP itself drives the fixed HDMI port: their tables are the ones the boot loader handed over for that port, and the display device imports framebuffers through disp0's SID0. Otherwise they need an explicit guarded probe, which nothing performs on this Mac. When the port is driven from dispext0 instead (as macOS 27.2 does; see "drm/apple: t8132: drive the fixed HDMI port from a handed-over dcpext"), the main DCP stays booted and idle, its tables are those of the same handoff, and the display device still needs disp0's DART for its imports. Without it, the display device waits for the deferred probe timeout (~15 s, and the GPU, which waits for the display, with it), then has no IOMMU, and KWin's buffers cannot be imported ("drmPrimeFDToHandle failed: Invalid argument"). Probe them in the same mode when an available T8132 dcpext says it drives the HDMI port. Measured on the Mac mini (J773g, 26.6.2 firmware): the DARTs probe ("Inherited SID0/SID16 frontend admitted"), the display device registers at 0.70 s, the GPU is ready at 3.1 s and KWin drives the HDMI port from dispext0. The J713 apple_dart.j713_display/j713_dcp parameters do not do it: they take the internal-panel ADT instance, which refuses this handoff ("cannot validate existing ADT table handoff"). Require apple,t8132-dcpext-firmware-ready == 1 as well, matching dcp_t8132_hdmi_dcpext_ready() in drivers/gpu/drm/apple/dcp.c. Signed-off-by: Diljit Singh --- drivers/iommu/apple-dart.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index a7366b7f1efe7..99e38e7ff5565 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -910,6 +910,22 @@ static bool apple_dart_t8132_main_external(void) !of_property_read_string(dcp, "apple,connector-type", &connector) && !strcmp(connector, "HDMI-A"); of_node_put(dcp); + /* + * The fixed HDMI port on dispext0 instead (as macOS drives it): the main + * DCP stays booted and idle, its tables as the boot loader handed them + * over for the port, and its display DART still serves the display + * device's imports, as when the main DCP drives the port. + */ + for_each_compatible_node(dcp, NULL, "apple,t8132-dcpext") { + u32 ready = 0; + + if (!qualified && of_device_is_available(dcp) && + !of_property_read_string(dcp, "apple,connector-type", &connector) && + !strcmp(connector, "HDMI-A") && + !of_property_read_u32(dcp, "apple,t8132-dcpext-firmware-ready", &ready) && + ready == 1) + qualified = true; + } return qualified; } From 534892b9605de3331c4571c62b3793188be2e528 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 16:12:09 -0500 Subject: [PATCH 6/7] drm/apple: t8132: the HDMI port goes to dispext0 when it was handed over, else to the main DCP A board can describe its fixed HDMI port on both the main DCP and a dcpext (the Mac mini: macOS drives it from dispext0; Linux has driven it from the main DCP). Decide from what the boot loader handed over, which the device tree already says when the drivers probe: - a dcpext with apple,connector-type = "HDMI-A" and the firmware-ready marker drives the port (dcp_t8132_fixed_hdmi()), and the main DCP is left as the boot loader left it, booted and idle, as macOS leaves it: its probe returns -ENODEV before it touches anything, and it is no component of the DRM device; - otherwise the main DCP drives the port as before, and the dcpext, not handed over, is refused by the existing gate. So a boot loader that does not hand dispext0 over (no chosen.asahi,j713-dcpext=1) keeps today's behaviour with the same device tree. The main DCP's display DARTs are probed as they are today (the DART driver keys on the main DCP's node, which keeps its HDMI connector type), so the display device keeps its IOMMU for imports either way. Signed-off-by: Diljit Singh --- drivers/gpu/drm/apple/apple_drv.c | 18 +++++----- drivers/gpu/drm/apple/dcp.c | 60 ++++++++++++++++++++++++++----- drivers/gpu/drm/apple/dcp.h | 1 + 3 files changed, 61 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/apple/apple_drv.c b/drivers/gpu/drm/apple/apple_drv.c index 99859a6ce6b4e..e70e7cbab14c9 100644 --- a/drivers/gpu/drm/apple/apple_drv.c +++ b/drivers/gpu/drm/apple/apple_drv.c @@ -1458,19 +1458,18 @@ static const struct of_device_id apple_dcp_id_tbl[] = { /* * Whether this DRM device has no DCP components, only T8132 external outputs: - * a main DCP or a dcpext serves the fixed HDMI port (the Mac mini). + * the fixed HDMI port, driven by the main DCP or by a handed-over dcpext (the + * Mac mini). */ static bool apple_t8132_main_external_present(void) { - struct device_node *np = of_find_compatible_node(NULL, NULL, - "apple,t8132-dcp"); - bool present = dcp_t8132_main_external(np) && of_device_is_available(np); + struct device_node *np; + bool present = false; - of_node_put(np); - for_each_compatible_node(np, NULL, "apple,t8132-dcpext") { - if (!present && dcp_t8132_fixed_hdmi(np) && of_device_is_available(np)) - present = true; - } + for_each_compatible_node(np, NULL, "apple,t8132-dcp") + present = present || (dcp_t8132_main_external(np) && of_device_is_available(np)); + for_each_compatible_node(np, NULL, "apple,t8132-dcpext") + present = present || dcp_t8132_fixed_hdmi(np); return present; } @@ -1483,6 +1482,7 @@ static bool apple_t8132_main_external_present(void) static bool apple_dcp_usable(struct device_node *np) { return of_device_is_available(np) && !dcp_t8132_main_external(np) && + !dcp_t8132_main_hdmi_idle(np) && (!of_device_is_compatible(np, "apple,t6030-dcpext") || dcp_t6030_ext_native(np)) && (!of_device_is_compatible(np, "apple,t8140-dcpext") || diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c index c58b31a75a3c4..c43e27178f6b7 100644 --- a/drivers/gpu/drm/apple/dcp.c +++ b/drivers/gpu/drm/apple/dcp.c @@ -5968,24 +5968,62 @@ static int dcp_connector_type_from_dt(struct device_node *np) return DRM_MODE_CONNECTOR_Unknown; } -/* A T8132 main DCP can serve a fixed external output instead of a panel. */ +/* + * A T8132 external DCP the board routes to the fixed HDMI port (the Mac + * mini's dispext0, the pipe macOS drives its HDMI port from), through the + * same DPTX PHY and HDMI converter rails as the main DCP, the PHY's source + * select being the DCP's index, and that the boot loader handed over. + */ +static bool dcp_t8132_hdmi_dcpext_ready(struct device_node *np) +{ + u32 ready = 0; + + return np && of_device_is_compatible(np, "apple,t8132-dcpext") && + of_device_is_available(np) && + dcp_connector_type_from_dt(np) == DRM_MODE_CONNECTOR_HDMIA && + !of_property_read_u32(np, "apple,t8132-dcpext-firmware-ready", &ready) && + ready == 1; +} + +/* Whether a handed-over dcpext drives the fixed HDMI port. */ +static bool dcp_t8132_hdmi_on_dcpext(void) +{ + struct device_node *np; + bool on = false; + + for_each_compatible_node(np, NULL, "apple,t8132-dcpext") + on = on || dcp_t8132_hdmi_dcpext_ready(np); + return on; +} + +/* + * A T8132 main DCP can serve a fixed external output instead of a panel, + * unless a handed-over dcpext serves that port instead. + */ bool dcp_t8132_main_external(struct device_node *np) { return np && of_device_is_compatible(np, "apple,t8132-dcp") && - dcp_connector_type_from_dt(np) == DRM_MODE_CONNECTOR_HDMIA; + dcp_connector_type_from_dt(np) == DRM_MODE_CONNECTOR_HDMIA && + !dcp_t8132_hdmi_on_dcpext(); } /* - * A T8132 DCP that drives the fixed HDMI port: the main DCP above, or an - * external DCP the board routes to it (the Mac mini's dispext0, the pipe - * macOS drives its HDMI port from), through the same DPTX PHY and HDMI - * converter rails, the PHY's source select being the DCP's index. + * A main DCP whose HDMI port a handed-over dcpext drives: it is left as the + * boot loader left it, booted and idle, as macOS leaves it on the Mac mini. + * Without that handoff (a boot loader that keeps dispext0), the main DCP + * drives the port as before. */ +bool dcp_t8132_main_hdmi_idle(struct device_node *np) +{ + return np && of_device_is_compatible(np, "apple,t8132-dcp") && + dcp_connector_type_from_dt(np) == DRM_MODE_CONNECTOR_HDMIA && + dcp_t8132_hdmi_on_dcpext(); +} + +/* The T8132 DCP that drives the fixed HDMI port: the main DCP or a dcpext. */ bool dcp_t8132_fixed_hdmi(struct device_node *np) { - return np && (of_device_is_compatible(np, "apple,t8132-dcp") || - of_device_is_compatible(np, "apple,t8132-dcpext")) && - dcp_connector_type_from_dt(np) == DRM_MODE_CONNECTOR_HDMIA; + return dcp_t8132_main_external(np) || dcp_t8132_hdmi_dcpext_ready(np); } /* @@ -7699,6 +7737,10 @@ static int dcp_platform_probe(struct platform_device *pdev) return -ENODEV; } + if (dcp_t8132_main_hdmi_idle(dev->of_node)) { + dev_info(dev, "HDMI port on a handed-over external DCP: main DCP left booted and idle\n"); + return -ENODEV; + } if (of_device_is_compatible(dev->of_node, "apple,t8132-dcpext")) return dcp_platform_probe_t8132_ext(pdev); if (!dcp_ext_is_failsafe(dev->of_node)) diff --git a/drivers/gpu/drm/apple/dcp.h b/drivers/gpu/drm/apple/dcp.h index e3bbf67a12119..dc3f8af72d78a 100644 --- a/drivers/gpu/drm/apple/dcp.h +++ b/drivers/gpu/drm/apple/dcp.h @@ -17,6 +17,7 @@ bool dcp_h17p_external_supported(struct device_node *np); bool dcp_h17p_external_ready(struct device_node *np); bool dcp_t8132_main_external(struct device_node *np); bool dcp_t8132_fixed_hdmi(struct device_node *np); +bool dcp_t8132_main_hdmi_idle(struct device_node *np); struct apple_atomic_state { struct drm_atomic_commit base; From cf635d93e76a70a78ec9fba1424695e5a9bac896 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 16:12:11 -0500 Subject: [PATCH 7/7] arm64: dts: apple: t8132-j773g: describe the HDMI port on dispext0 as well macOS drives the Mac mini's HDMI port from dispext0: 4K60, and 4K120 with DSC, on that pipe alone, with the main DCP booted and idle. Describe the port on dcpext0 too (connector type, the DPTX PHY, whose source select is the pipe's dcp-index 1, the converter rails and its firmware clock), with its mailbox and DARTs enabled. iBoot leaves DISPEXT0 running, so its power domains are not given to Linux, as for the main DCP. Linux drives the port from dcpext0 only when the boot loader hands it over (aura: chosen.asahi,j713-dcpext=1), and from the main DCP otherwise, so the main DCP's description stays. Measured on the Mac mini with dispext0 handed over: direct scanout instead of a copied frame (4K30 frame intervals p95 40 ms instead of 96 ms), the firmware clock and realtime bandwidth as macOS has them, the GPU up. Signed-off-by: Diljit Singh --- arch/arm64/boot/dts/apple/t8132-j773g.dts | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8132-j773g.dts b/arch/arm64/boot/dts/apple/t8132-j773g.dts index 060c187428a06..426689d2ae038 100644 --- a/arch/arm64/boot/dts/apple/t8132-j773g.dts +++ b/arch/arm64/boot/dts/apple/t8132-j773g.dts @@ -88,6 +88,42 @@ status = "okay"; }; +/* + * The HDMI port as macOS drives it, from dispext0 (4K60, and 4K120 with DSC, + * on that pipe alone; the main DCP booted and idle), through the same PHY + * (source select = its dcp-index 1) and converter rails as the main DCP. It is + * used when the boot loader hands dispext0 over (aura: boot.bin line + * chosen.asahi,j713-dcpext=1); otherwise the main DCP above drives the port. + * iBoot leaves DISPEXT0 running: Linux must not switch its domains, as for the + * main DCP. + */ +&dcpext0_mbox { + /delete-property/ power-domains; + status = "okay"; +}; + +&dcpext0_dart { + /delete-property/ power-domains; + status = "okay"; +}; + +&dispext0_dart { + /delete-property/ power-domains; + status = "okay"; +}; + +&dcpext0 { + /delete-property/ power-domains; + apple,connector-type = "HDMI-A"; + apple,dptx-phy = <4>; + phys = <&dptx_phy>; + phy-names = "dp-phy"; + hdmi-pwren-gpios = <&smc_gpio 15 GPIO_ACTIVE_HIGH>; + dp2hdmi-pwren-gpios = <&smc_gpio 26 GPIO_ACTIVE_HIGH>; + clocks = <&dcp_fw_clk369>; + status = "okay"; +}; + / { /* * The display pipes' firmware clocks, from the ADT's /arm-io