Skip to content

drm/apple: forward HDMI converter requests on every native HDMI port; admit PQ by the IOMFB template - #2389

Draft
RyanTheTide wants to merge 3 commits into
integration/aurorafrom
sweep/display-hdmi
Draft

RyanTheTide wants to merge 3 commits into
integration/aurorafrom
sweep/display-hdmi

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

Two drm/apple features were admitted by a list of chips or firmware where they were first tried, not by what they need.

  • dcp_hdmi_init() (dcp-hdmi.c:215, from 0960c7e) forwarded the DP-to-HDMI converter's IRQ_HPD service requests only on apple,t6030-dcpext. These requests are short HPD pulses, plus a poll after an HBR3 link configuration while the converter trains an HDMI FRL link. Every Mac with a native HDMI port has the same converter behind a DPTX port.
  • dcp_hdr_output_supported() (iomfb.c:3184, from 2c3a662, 99df696, d5367c8) admitted a PQ commit only on the desktop 26.x firmware, the H17P external method profile, and firmware 27 without a panel. Everything a PQ output needs is in the IOMFB template, which all template firmwares run.

Change

  • HDMI: the forwarding now depends on what the board has: a fixed HDMI-A connector and an hdmi-hpd GPIO in the DCP's DT node. These boards have one: M1/M2/M3/M4 Pro/Max MacBook Pros, the Mac minis (M2 Pro, M4) and the Mac Studios in the tree (t600x-j314-j316, t602x-j414-j416, t603x-j514s-j516s-hdmi, t6040-j614s/j616s, t6041-j575c/j616c, t6020-j474s, t6021-j475c, t6022-j180d, t6050-j775d, t8112-j473). If a firmware does not take the sink IRQ call, it returns an error. That already stops the polling and is logged at a rate limit.
  • HDR: a PQ commit is admitted on every IOMFB template firmware (12.3, 13.5, generic 14.7, H17P, desktop 26.x, 27) for an output without a panel. The desktop 26.x panel behaves as before. The template mode set picks the timing's PQ colour element, and its swaps tag RGB surfaces BT.2020 PQ. The atomic check still refuses a mode whose timing has no PQ element in the firmware catalogue. The native 14.7 DCPLink session, the J613 26.6 session and the M4 path set modes outside the template, so they are still refused.

Open PR #2230 changes the same dcp_hdmi_init() condition (it adds apple,t6041-dcpext). Whichever PR merges second has a one-line conflict there. After this PR, the compatible list is no longer needed.

Testing

  • Build: pending (a W=1 build of drivers/gpu/drm/apple/dcp-hdmi.o and iomfb.o follows).

Still to run

  • M1 Pro (J316s, HDMI port) and J616s (HDMI): plug in an HDMI display, then run dmesg | grep 'HDMI:'. Expected: either "forwarding converter service requests" or no HDMI line, and the display lights at its preferred mode. A 4K120 or higher HDMI 2.1 display on the J616s should train (FRL).
  • M2 (J413, no HDMI port, no hdmi-hpd): no change and no HDMI lines.
  • HDR, with an HDR DP or USB-C display on the M1 Pro and M2 (template 13.5/12.3 or generic 14.7): drm_info lists the Colorspace and HDR_OUTPUT_METADATA properties. A 10-bit PQ BT.2020 commit (kwin/gnome HDR toggle, or modetest -w <conn>:Colorspace:9) is accepted and the display reports HDR. An SDR commit returns to SDR.
  • Neo (H17P external) and J616s: HDR on an external display behaves as before.
Code credit

Chris Kearney wrote the HDMI converter forwarding. Ryan Murray and Diljit Singh wrote the HDR output path.

Assisted-by: LLM (Claude:Opus 5.5)

…MI port

dcp_hdmi_init() set up the forwarding of the DP-to-HDMI converter's
IRQ_HPD service requests (short HPD pulses, and a poll after an HBR3
link configuration while the converter trains an FRL link) only on
apple,t6030-dcpext. The request is DisplayPort protocol, and every board
with a native HDMI port has the same arrangement: an external display
coprocessor whose DPTX port drives an on-board DP-to-HDMI converter,
with the hdmi-hpd GPIO in its DT node.

Key it on what the hardware has: a fixed HDMI-A connector and an HDMI
HPD GPIO. A firmware that does not take the sink IRQ call answers it
with an error, which already stops the polling and is logged rate
limited.

Fixes: 0960c7e ("drm/apple: forward HDMI converter service requests on t6030")
Suggested-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…rmwares

dcp_hdr_output_supported() let a PQ commit through on the desktop 26.x
firmware, the H17P external method profile and firmware 27 without a
panel. What a PQ output needs is in the IOMFB template, which every
template firmware runs: the mode set picks the timing's PQ colour element
when one is asked for, and the swaps tag RGB surfaces BT.2020 with the
PQ transfer function. Whether a timing has a usable PQ element is the
firmware's own timing catalogue, which the atomic check already reads
per mode.

Admit PQ on every template firmware (12.3, 13.5, generic 14.7, H17P,
26.x desktop, 27) for an output without a panel, and keep the desktop
26.x panel as it was. The native 14.7 DCPLink session, the J613 26.6
session and the M4 path set modes outside the template and stay
refused. A timing whose catalogue has no PQ element is still refused.

Fixes: 2c3a662 ("drm/apple: Drive HDR output on desktop 26.x external displays")
Suggested-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…ed()

Commit 455b2e6 ("drm/apple: iomfb: admit PQ output by the IOMFB
template, not three firmwares") added a new comment above
dcp_hdr_output_supported() but left the old one in place directly
above it. The old comment still lists three firmwares and says "the
other processors ... keep SDR", which the function no longer does. Drop
it. No functional change.

Fixes: 455b2e6 ("drm/apple: iomfb: admit PQ output by the IOMFB template, not three firmwares")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Early note on this draft (no full review yet):

  1. drivers/gpu/drm/apple/iomfb.c:3192-3203: dcp_hdr_output_supported() still decides by a list of firmware versions (dcp->fw_compat), and keeps a panel exception for one of them. The comment above it says what the check stands for: the session sets modes through the IOMFB template. Test that directly (for example a flag the template session sets when it is chosen, or the session's ops), so that a firmware added to the template later gets PQ without editing this list. The desktop 26.x panel case should depend on what the panel reports (as dcp_panel_edr_supported() does), not on the firmware version.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Closing: the HDMI forwarding landed with #2230, and the HDR half still picks by firmware version; a replacement should key it on the template's capability.

@RyanTheTide RyanTheTide reopened this Nov 22, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Reopened and kept as a draft; the comment above lists what it still needs before review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant