Repository navigation
drm: apple: HDCP 2.2 with the standard Content Protection properties - #3302
Conversation
An AFKv2 endpoint could send only payload-less open and close reports. The HDCP auth session takes the transmitter's progress as a standard service report with data (category report, subtype 0xc0, no flags). Allow that one form; everything else stays refused. Signed-off-by: Ryan Murray <[email protected]>
The display coprocessor carries HDCP 2.2 to an external receiver and the SEP holds the transmitter's keys and does its cryptography. Add the transmitter that joins the two, without any runtime caller yet: - dcp-hdcp-wire.h: the DCP services' message layouts. The DP device service reads and writes the receiver's HDCP 2.2 registers (the DisplayPort HDCP 2.2 register map, also used behind an on-board DP to HDMI converter); an authentication session service per attempt calls the AP with the receiver's events and takes the transmitter's progress reports. - dcp-hdcp-tx.c: the HDCP 2.2 transmitter procedure on the apple-sep-hdcp.h service: AKE with stored km or first pairing, locality check with retries, SKE, repeater authentication (topology limits, seq_num_V, V), stream management with the content type and one M' retry, the 200 ms wait, then encryption. Receiver IDs go through drm_hdcp_check_ksvs_revoked(); a revoked ID or an unreadable SRM fails closed. Type 1 is refused when RxInfo reports an HDCP 1.x device or an HDCP 2.0 repeater downstream. The certificate is read after the 100 ms AKE_Send_Cert time and a Receiver ID without twenty ones fails the attempt. DCP turns RxStatus into session events; RxStatus is read only when an event is overdue, since a DisplayPort read clears those bits. - dcp-hdcp.h: the Content Protection policy (off, desired, authenticating, enabled), with back-off between failed attempts. Only fields the protocol sends in the clear pass between the transmitter and the SEP; km, ks and the device keys never leave the SEP. KUnit: apple-dcp-hdcp-wire, apple-dcp-hdcp-tx, apple-dcp-hdcp. Signed-off-by: Ryan Murray <[email protected]>
Expose the standard "Content Protection" and "HDCP Content Type" connector properties on external DisplayPort, HDMI and USB-C connectors (never on a built-in panel) and run the HDCP 2.2 transmitter over the DCP services: - Bind the DP device service and the HDCP interface and auth-session services by EPIC name, on the classic and the compact announcement paths alike (their provider classes are shared with other services). Start the DP device and HDCP interface endpoints when nothing else drives them. - Each auth session DCP announces gets a handler: DCP announces one per protocol version and closes each before it powers down. Sessions announced for HDCP 1.x are declined. - Take a session DCP opens only while protection is desired; answer every session call; report the transmitter's progress; pair the device service's session query with its end call when the session closes. - ENABLED only after the SEP's encryption enable and the final progress report. A failure, a session close, unplug, DPMS off, suspend or unbind turns encryption off, closes the SEP session and drops back to DESIRED; the picture is not touched. Re-authentication backs off from 1 s to 60 s. Link integrity stays with DCP, which closes the session on a re-authentication request or a link failure. - The SEP channel comes from the display node's "apple,hdcp-channels". DCP offers a session only when the link comes up, so a request made while no session is offered is served at the next link-up (DPMS, mode set, hotplug or resume). Off by default: appledrm.hdcp=1 enables it. KUnit: apple-dcp-hdcp-glue. Signed-off-by: Ryan Murray <[email protected]>
The Secure Enclave HDCP interface channels assigned to a display coprocessor; the first is its external output's HDCP 2.2 transmitter. Signed-off-by: Ryan Murray <[email protected]>
Fill in "apple,hdcp-channels" from the Apple Device Tree for t8112 (dcp 5/6, dcpext 7/8) and t604x (dcp 5/6, dcpext0 7/8, dcpext1 9/10). The t604x values come from a t6041 device tree; t6040 shares the layout. Signed-off-by: Ryan Murray <[email protected]>
|
Non-author adversarial review at Blockers
Non-blocking
Checked OK
|
…d safely
Address the review of the HDCP series:
- No module parameter: a display processor takes part when its node has
"apple,hdcp-channels" (and the SEP HDCP service is built in); while
userspace does not ask for protection, DCP's sessions are declined.
- Unbind: the state is device-managed and goes with the component bind.
dcp_hdcp_fini() now disables every work synchronously, ends what is open,
shuts down the endpoints this file started and clears dcp->hdcp, so
nothing routes to or requeues on freed state.
- A teardown that was asked for before DCP opened a newer session no longer
ends that session: teardowns record the accepted-open count and skip when
it moved; a new run aborts whatever an earlier session left open first.
- Suspend and DPMS off: the work queue is not freezable any more, and both
paths wait for the teardown (encryption off, SEP session closed, the
device service's end call) before DCP sleeps or the pipe goes down.
- The capability call goes out once per HDCP interface when it opens; the
periodic re-send ("kick") is gone. A close of an earlier session after a
newer open is ignored, and a close's action is applied.
- Comments justify the two non-spec margins (event slack, register call
timeout).
KUnit: apple-dcp-hdcp-glue gains a stale-teardown and an unbind case.
Signed-off-by: Ryan Murray <[email protected]>
|
Thanks for the review. All four blockers are fixed in c2acdf7, which is pushed. Hardware rows at that head on the default cmdline (J473 and J616s) follow as soon as a Mac is free. Blockers
Non-blocking
KUnit: 241 run, 238 pass, 3 pre-existing skips. |
|
Retargeted to J473 hardware row at head
The J616s row at this head comes as soon as that Mac is free (another lane has it reserved). I also tried re-running on DCP's still-open session after a local disable. That served a re-request without waiting for a link-up, but after s2idle DCP offered no session at all, so I left it out of this PR and listed the limit under 'Not yet'. |
|
J616s (T6040) row at head
The J616s ENABLED proof (Type 0 after DPMS, Type 1 on a new request) is from head |
|
Merge-train re-review at
Rows: J473 at this head on the default cmdline (r13-hdcp15), and J616s as the regression row at this head. #3256 is on main. The non-blocking notes from the first review (the kick timeouts not being spec values, no CP_IRQ handling once encrypted, and so on) can be follow-ups. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Reverted in #3374. This merge turned main's host tests red: the harness stubs for the new HDCP calls were missing, and this PR's host-tests job never ran after the retarget, which I missed. The code review and rows stand. To reland, open this as a new PR with the harness updates and a green |
Picks up the revert of #3302 (fca33ed), whose host-test breakage came in with the previous main merge. Signed-off-by: Ryan Murray <[email protected]>
Picks up the revert of #3302 (fca33ed), whose host-test breakage came in with the previous main merge. Signed-off-by: Ryan Murray <[email protected]>
…perties" This reverts merge deb2df2 (aurora-silicon#3302). The merge turned main's host tests red (Host tests run 45964990093; last green fcb1242): the host harnesses that compile dcp.c excerpts have no stubs for the new HDCP calls (dcpext26-startup-tests, backlight-coldboot-tests), the shared asahi.config lacks the new CONFIG_DRM_APPLE_HDCP request (hardware-defaults-tests), and four apple-dcp selftests fail (service-rebind, provider-admission, ordered-rx, stale-crtc-poweroff). The PR's host-tests job never ran after it was retargeted to main. Reland it with the harness updates once run-host-tests.py is green. Signed-off-by: Ryan Murray <[email protected]>
What:
HDCP 2.2 on external displays for drm/apple, requested the standard way. Builds on #3256 (SEP HDCP client, merged).
The standard
Content Protection(Undesired/Desired/Enabled) andHDCP Content Type(Type 0/1) connector properties on external DP, HDMI and USB-C connectors (never on a built-in panel). A compositor or player asks for protection as on any Linux GPU. ENABLED means the link is authenticated and encrypted.How the hardware splits the work:
include/linux/apple-sep-hdcp.h(soc: apple: sep: add HDCP 2.2 transmitter client (ep 0x0e) #3256).Commits:
apple,hdcp-channels.Services bind by EPIC name. Per-SoC values come from the DT. No chip gates.
No module parameter: a display processor takes part when its DT node has
apple,hdcp-channels(t8112, t604x here). While userspace does not ask for protection, DCP's sessions are declined and nothing changes on screen.Spec behaviour (compliance)
kfree_sensitive, and no message bytes are logged.drm_hdcp_check_ksvs_revoked()(the SRM userspace installs, as on i915). A revoked ID or an unreadable SRM fails closed.Tested:
traces/display/20261127-hdcp/r10-hdcp12,r11-hdcp13.j616s-r4-hdcp13.c2acdf7a(review fixes), J473, default cmdline (kit7.3.0-aurora-hdcp15,r13-hdcp15):c2acdf7a: row pending (Mac reserved by another lane).ccd3793b(kit7.3.0-aurora-hdcp14):r12-hdcp14: DP-2 Enabled Type 0 (7.4 s after DPMS); after s2idle, Enabled Type 1 (repeater). No device-close timeout. Restored, 0 failed, Enforcing.j616s-r6-hdcp14: DP-3 Enabled Type 0 (3.8 s after DPMS); after a disable, a new Type 1 request reached Enabled in 6.4 s. s2idle 1/1. Restored, 0 failed, Enforcing.Risk:
two-way · Macs whose DT has
apple,hdcp-channels(t8112, t604x). The driver starts the DCP DP device and HDCP interface endpoints where nothing started them before (T8112 classic path) and answers DCP's HDCP sessions, declining them unless userspace asks. It never touches the picture.Not yet:
c2acdf7awill show whether that fixes it.Content Protection=Desired (+type) on the output showing protected content.