Skip to content

drm/apple: forward HDR10 static metadata through DCPAV - #735

Closed
RyanTheTide wants to merge 7 commits into
aurora-wipfrom
work/t4152-hdr-static
Closed

RyanTheTide wants to merge 7 commits into
aurora-wipfrom
work/t4152-hdr-static

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

External HDR selects a PQ colour mode, but compositor mastering metadata is not forwarded to the display. Send the HDR10 Type 1 dictionary through the AV video service after a successful atomic modeset: Apple 0xd3 serialization, selector 0x15 over AFK command 0xc0, with the 24-byte CTA body in primary order and explicit little-endian fields. Check transport, AFK return code, reply length and the status at message offset 0x40 before caching success.

Cache the last successful block per connector and service generation. Frame swaps never send metadata. Link teardown, route changes and service replacement invalidate the cache; a generation captured before the modeset rejects stale hotplug work. Keep video service handling available with audio disabled, and prevent compact service slots from changing identity while a synchronous caller holds a pin.

Both metadata type fields must be zero. Forwarding is restricted to DCP_FIRMWARE_V_26_6_DESKTOP external outputs. The Neo external profile currently uses DCP_FIRMWARE_H17P and remains excluded by this explicit ABI gate; extending that profile needs separate admission. Internal panel EDR keeps its existing path.

Removing HDR_OUTPUT_METADATA while the link stays up deliberately retains the last metadata until link teardown. No empty dictionary or zero block is sent. Live-link clearing is pending the separate research task.

Validation is in progress: arm64 LLVM W=1 Apple DRM builds with audio enabled and disabled, the existing apple-dcp host selftests with TMPDIR on Linux tmpfs, and the new encoder/envelope KUnit suite. The standalone branch and an integration with the draft desktop audio change will be checked separately. Hardware has not been tested.

Hardware qualification steps for the J616s MSI monitor:

  1. Boot a controller-approved candidate with the normal fallback. Use kmshdr or mpv with DRM HDR passthrough and an HDR10 sample with known mastering primaries, luminance, MaxCLL and MaxFALL.
  2. Check the monitor OSD reports HDR metadata and, where exposed, the expected values. An HDR indicator alone only confirms PQ reception. Change metadata without changing timing and check the new values.
  3. Trace repeated frame updates and confirm selector 0x15 is not sent per frame. Remove the property while the link remains up and confirm no empty or zero block is sent.
  4. Disconnect and reconnect, then confirm metadata is sent after the next successful modeset. Repeat with audio disabled.

Send the Type 1 mastering metadata dictionary after a successful desktop
26.x external modeset. Cache successful connector link state and retain
the last metadata when the live property is removed. Keep AV video
service handling available when audio is disabled.

Validate transport status, reply length and the DCP status word. Preserve
compact service identities while a synchronous caller holds a pin. Fence
the metadata cache against link, route and service replacement.

Add KUnit coverage for the serializer, envelope, reply errors and compact
slot ownership, and document the pending live-link clear operation.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Add the documentation license, expand the standalone KUnit option help,
describe the video publication lock and align continuation lines.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The byte-layout KUnit test caught a truncated Type value. CEA-861:Type1
is 13 bytes, so derive its length from the literal and pad it to the next
32-bit object tag. Move Data to object offset 48 and use the resulting
72-byte dictionary throughout the message and connector cache.

Correct the independent golden vector to include the full type string
and its three padding bytes, and update the envelope extent to 168 bytes.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Keep the metadata cache comparisons and copies within the driver line
length convention after introducing the aligned payload offset constant.
There is no change to the C tokens or runtime behavior.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The video-only AV endpoint accepts the desktop compact service name.
Register that name in the audio-enabled AV table as well, so opting in
to audio does not leave the metadata service unpublished. Keep the same
video owner and teardown callbacks used by the legacy video interface.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Preserve run.py's existing regular file mode while retaining the HDR
cache invalidation mocks. No source content changes in this commit.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Resolve the desktop audio startup overlap after its upstream merge.
Keep metadata solely on the always-serviced AV endpoint 0x29 and leave
the separate audio endpoint lifecycle unchanged. Drop the superseded
legacy audio-initializer hooks from the HDR delta.

Retain the connector cache and the aligned Type 1 dictionary. The host
baseline now includes the audio test and has 83 cases.

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