Skip to content

drm/apple: Send HDR10 static metadata to desktop 26.x external displays - #764

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
j616s/hdr-metadata
Nov 1, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
j616s/hdr-metadata

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

External displays on the J616s external processors got no HDR10 mastering data. HDR_OUTPUT_METADATA only picked the PQ colour mode, so the display saw the PQ EOTF but no mastering primaries, luminance, MaxCLL or MaxFALL. Every metadata change (a new video, for example) also cost a full mode set and a link teardown.

Fix. The firmware builds the Dynamic Range and Mastering InfoFrame itself from DCPAV selector 0x15 (setHDRStaticMetadata). That's an AFK standard service command to dcpav-service-epic on endpoint 0x2a carrying a serialized dictionary: Type "CEA-861:Type1" plus Data, the 24-byte Type 1 body in the order of struct hdr_metadata_infoframe. The EOTF comes from the colour mode the link runs.

The change brings up endpoint 0x2a on the external processors and keeps that service pinned. It sends the connector's Type 1 block once the link carries PQ: after the mode set, and whenever the block changes. It never sends per frame, never on an SDR link, and never to the panel. It checks the transport, the AFK return code and the DCP status in the reply. A metadata change with the same EOTF and colorspace is no longer a mode set on the external processors. Going back to SDR is still a mode set, and the reselect tears the link down, so the InfoFrame goes with it.

This replaces the closed #735. That PR sent selector 0x15 to dcpav-device-epic, the video-interface family. The service binding and the key types used here come from the clean-room DCP HDR notes.

How tested. J616s (T6041, DCP 26.6.2), tt3 kernel, this change as a test appledrm on one-shot boots, docked with an MSI MPG 325CQRXF and an Acer QG270 S3.

  • Endpoint 0x2a comes up on both external processors (started mask 0x2634). dcpav-service-epic and dcpdp-service-epic are announced. All three displays come up and hotplug is unchanged.
  • PQ test pattern on the MSI with MaxCLL 1000, MaxFALL 400 and mastering 1000/0.005: selector 0x15 is accepted (transport ok, return code 0, DCP status 0), and the MSI's OSD shows HDR. Switching to MaxCLL 600 sends a new block with no mode set and no link teardown.
  • New host selftest hdr-static-metadata: it checks the 176-byte message byte for byte against an independent encoding, rejects non-Type-1 metadata, and covers the reply checks. Host selftests (tools/testing/selftests/drivers/gpu/apple-dcp/run.py) pass 84/84.
  • arm64 LLVM W=1 build of drivers/gpu/drm/apple: no warnings.

🤖 Generated with Claude Code

A PQ link on the J616s external processors carried no mastering data:
HDR_OUTPUT_METADATA only picked the PQ colour mode, so displays got the
PQ EOTF but no mastering primaries, luminance, MaxCLL or MaxFALL, and
every change of the metadata (a new video) cost a full mode set.

The firmware builds the Dynamic Range and Mastering InfoFrame itself from
DCPAV selector 0x15 (setHDRStaticMetadata), an AFK standard service
command to dcpav-service-epic on endpoint 0x2a. Its payload is a
serialized dictionary, Type "CEA-861:Type1" and Data, the 24-byte Type 1
body in the order of struct hdr_metadata_infoframe; the EOTF comes from
the colour mode the link runs. Bring up endpoint 0x2a on the external
processors and keep the service pinned. Send the connector's Type 1 block
once the link carries PQ, after the mode set and whenever it changes,
never per frame and never on an SDR link; check the transport, the AFK
return code and the DCP status in the reply. A metadata change with the
same EOTF and colorspace is no longer a mode set there. Going back to SDR
is a mode set, and the link set up again carries no InfoFrame.

A host selftest checks the 176-byte message against an independent
encoding and the reply checks.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
… blocks per frame

A commit that only changed HDR_OUTPUT_METADATA on a desktop 26.x external
no longer pulled in its CRTC, so the new block waited for the next
commit that touched the CRTC; on a static screen that could be never.
Add the CRTC to the commit, just without a mode set.

A block the firmware refused was sent again with every frame, and the
command waits up to a second for its reply. Remember a refused block
like a taken one, so only a new block, mode set or service retries it,
and skip the send on a crashed DCP.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit 437edfa into aurora-wip Nov 1, 2026
@RyanTheTide
RyanTheTide deleted the j616s/hdr-metadata branch November 1, 2026 03:29
notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
Bring integration/aurora up to aurora-wip 437edfa, the source of the
7.3.0-aurora-fleet14b kernel that was promoted on the M1 Pro, M2, Neo
and J616s on 2026-11-01. This takes the aurora-wip work since the
two branches diverged, including the 2026-11-01 sync of
integration/aurora into aurora-wip (aurora-silicon#761), up to and including aurora-silicon#764.

integration/aurora had two changes aurora-wip lacked at this point:
the tipd late USB4 router fix (aurora-silicon#855) and SEP keybag creation in the
shared xART window (aurora-silicon#856). aurora-wip carries the same patches as aurora-silicon#858
and aurora-silicon#860, which come in with a later batch. Two conflicts, both where
the two sides added lines next to each other: the KUnit prototype list
in tps6598x.h (both kept, in aurora-silicon#858's order) and the aurora-sep PKGBUILD
checksums (recomputed from the merged files; they match aurora-silicon#860's). The
merged tree is identical to aurora-wip 437edfa with the aurora-silicon#858 and aurora-silicon#860
patches applied.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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