diff --git a/drivers/gpu/drm/apple/dcp-hdmi.c b/drivers/gpu/drm/apple/dcp-hdmi.c index 0603de2a0e229..d2b214da00ef2 100644 --- a/drivers/gpu/drm/apple/dcp-hdmi.c +++ b/drivers/gpu/drm/apple/dcp-hdmi.c @@ -1,11 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only OR MIT /* - * HDMI port of the T6030 (M3 Pro) MacBook Pros. - * - * The port hangs off the first external display coprocessor: it drives - * ATC3 as a four-lane DisplayPort PHY into an on-board DP-to-HDMI - * converter. Power, hotplug and the fixed route work as for the M1/M2 Pro - * MacBook Pro HDMI port (hdmi-hpd, hdmi-pwren and dp2hdmi-pwren GPIOs, see + * Native HDMI ports: an external display coprocessor driving a DisplayPort + * PHY into an on-board DP-to-HDMI converter, as on the M1 and later Pro/Max + * MacBook Pros, the Mac minis and the Mac Studios. Power, hotplug and the + * fixed route use the hdmi-hpd, hdmi-pwren and dp2hdmi-pwren GPIOs (see * dcp.c and dcp-fabric.c). * * Like any DisplayPort sink, the converter asks the source for service by @@ -19,7 +17,10 @@ * the rate those modes use, because not every request of the converter * shows up as a pulse on the GPIO. * - * Only the T6030 external coprocessor with a fixed HDMI route uses this. + * Every coprocessor with a fixed HDMI-A connector and an HDMI HPD GPIO in + * its DT node uses this: IRQ_HPD is DisplayPort protocol, and the converter + * sits behind the same DPTX port on every such board. A firmware that does + * not take the request answers it with an error; that stops the polling. */ #include @@ -211,8 +212,7 @@ int dcp_hdmi_init(struct apple_dcp *dcp) int ret; if (!dcp->hdmi_hpd || - dcp->fixed_connector_type != DRM_MODE_CONNECTOR_HDMIA || - !of_device_is_compatible(dcp->dev->of_node, "apple,t6030-dcpext")) + dcp->fixed_connector_type != DRM_MODE_CONNECTOR_HDMIA) return 0; hdmi = devm_kzalloc(dcp->dev, sizeof(*hdmi), GFP_KERNEL); diff --git a/drivers/gpu/drm/apple/iomfb.c b/drivers/gpu/drm/apple/iomfb.c index 1f3e97e6c5e9f..509870f416dfe 100644 --- a/drivers/gpu/drm/apple/iomfb.c +++ b/drivers/gpu/drm/apple/iomfb.c @@ -3176,18 +3176,31 @@ int dcp_takeover_trial(struct platform_device *pdev, const char **reason) } /* - * PQ output goes through the IOMFB template's mode set, which picks the - * timing's PQ element (see dcp_display_mode.pq): the desktop 26.x firmware, - * the external H17P processor and the firmware 27 external processors. The - * other processors, and the firmware 27 panel, keep SDR. + * A PQ output needs a mode set that selects the timing's PQ colour element + * and swaps that tag the surfaces BT.2020 PQ. The IOMFB template + * (iomfb_template.c) does both for every firmware it is built for; the + * native 14.7 DCPLink session, the J613 26.6 session and the M4 path set + * modes elsewhere and do not. Whether a timing has a usable PQ element is + * the firmware's own catalogue, checked per mode by the caller. A panel + * keeps its SDR link (dcp_panel_edr_supported()), except on the desktop + * 26.x firmware, which has driven PQ through the template since its start. */ static bool dcp_hdr_output_supported(struct apple_dcp *dcp) { if (iomfb_is_m4(dcp)) return false; - return dcp->fw_compat == DCP_FIRMWARE_V_26_6_DESKTOP || - dcp->hw.iomfb_method_profile == DCP_IOMFB_METHODS_H17P_EXTERNAL || - (dcp->fw_compat == DCP_FIRMWARE_V_27_0 && !dcp_has_panel(dcp)); + switch (dcp->fw_compat) { + case DCP_FIRMWARE_V_26_6_DESKTOP: + return true; + case DCP_FIRMWARE_V_12_3: + case DCP_FIRMWARE_V_13_5: + case DCP_FIRMWARE_V_14_7_TEMPLATE: + case DCP_FIRMWARE_H17P: + case DCP_FIRMWARE_V_27_0: + return !dcp_has_panel(dcp); + default: + return false; + } } /*