Repository navigation
drm/apple: add native HDMI-CEC and 2 ms IRQ_HPD pulse tracking - #2230
Conversation
|
Thanks for the CEC work and the thorough KUnit coverage. One thing we would like changed: in this tree we select behaviour by a hardware property, not by the list of SoCs where it has been tried. Could you drop the compatible list and rely on those two properties, so every DCP with a described HDMI port gets the IRQ_HPD pulse tracking and |
|
Review of 1266e4a (read against integration 0abc2f3). No hardware row yet: the J616s here has nothing on its HDMI port, so I'm still building this commit for a registration/PA/TX-without-sink row. Blocking
Should fix
Structure
These check out: Kconfig is |
|
Thanks for this, it fills the CEC gap on the HDMI machines. Review of 1266e4a against integration/aurora 0abc2f3 (it applies on the tip as is):
The adapter is selected by a hardware property (fixed HDMI-A connector from the DT, plus the RTKit endpoint being present), so every HDMI machine whose DCP publishes the interface gets it without a board list. |
|
J616s (M4 Pro 16", T6040, DCP 26.x desktop external path), this commit on a fleet kernel based on 48cac48. Nothing is plugged into the HDMI port.
|
1266e4a to
85639ff
Compare
|
Thanks for the thorough review and the We also tested
Force-pushed
|
|
Hardware-verified
|
|
Also ran the Linux V4L2/CEC adapter compliance suite ( ( |
|
Thanks for 85639ff and the J616c results with a real CEC sink, including the compliance run. Selecting by the HDMI-A connector and HPD GPIO, and the fixes for the TX sequence, the 0x29 interface, the retire channel, the teardown order and the workqueue, cover what we raised. It still needs to land after #1954. |
85639ff to
b821247
Compare
|
Thanks again for the CEC work; #1954 has landed, so this is close. One small request before it goes in: a few comments describe the firmware's internal classes, methods and dispatch tables rather than the interface on the wire, at |
Register a CEC adapter for fixed HDMI-A connectors served by the compact EPIC CEC endpoint (0x2b). Accept both bare and descriptor-wrapped service-call reports. Use group 0 calls to open and close the service, set logical addresses, read the physical address and transmit frames. Handle group 2 reports for received frames, HPD, EDID attributes and service termination. HPD status can still read low on plug. Query the physical address on open and refresh it on an EDID attributes report or after the hotplug EDID read. Close the client before forwarding HPD low and drain pending work before unregistering the adapter. Track each transmit by sequence so a late reply cannot complete a later frame. Classify short HPD pulses in hard IRQ context with a 2 ms timer. Wake the threaded handler for a sustained low. Add parser, adapter and HPD test coverage. Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
b821247 to
7577337
Compare
|
Thanks for 7577337. The comments in |
|
Cross-board review of 7577337 against integration/aurora e0ee46a. It merges cleanly. Integration has moved under
On our side, this goes in after a J700 boot/panel/deep-sleep row on a kit with the series. |
|
On the HDMI side of the cross-board review: we will run the post-merge rows on our M1 Pro, M2 and M4 Pro with HDMI attached: hotplug five times, s2idle with the sink connected, and an HBR3 mode where the sink offers one. We will post them here. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-review of 7577337. Integration had moved 332 commits since this PR's CI run, including dcp.c, iomfb.c, dcp-internal.h and the drm/apple Makefile, so I refreshed the branch with gh pr update-branch. That added merge commit 27c69b4 on integration/aurora 024cec8 and left your commit unchanged. CI is green on 27c69b4: host-tests, source, kunit, rust-build and DWC3/ATC.
Since then integration has taken 31 more commits. One of them touches a file in this PR: af33408 (#2602) reworks dcp_v27_sleep_settle() in dcp-v27-sleep.inc. That's a different function from your two hunks there (the CEC check in dcp_v27_ext_busy() and DCP_CEC_COMPACT_SERVICE_OPS in dcp_v27_ext_av_services[]), and the two share no symbols. The merge is clean, and a CEC report that arrives during the settle is now taken and the checks rerun, which is what we want.
Nothing has changed in the series since the 06:42 cross-board review, and nothing there needs a change from you:
- J700, J714s, J773g: no DCP on these has an HDMI-A connector with
hdmi-hpd-gpios, so the CEC and IRQ_HPD paths all return early. - Framing: with the bare service-call framing in
afk.c,av_report_terminate()now actually runs on the compact AV roles, as it was written to. - Combination build: together with #1951 and #2492 it built and passed CI in #2532.
- Nit:
afk_compact_av_capable()andav_desktop_audio_role()(av.c) have the same condition, so a shared helper would keep them in step. That can be a follow-up.
Merging. Post-merge verification:
- @RyanTheTide's HDMI rows on the M1 Pro, M2 and M4 Pro: hotplug five times, s2idle with the sink connected, and an HBR3 mode where the sink offers one.
- Our rows:
- J700 boot, panel and deep sleep with CEC core built in;
- M5 external displays (hotplug, DP audio, deep sleep with displays attached), for the Terminate path on the compact AV roles.
A revert is ready if any of these turns something up.
Thanks for the CEC work and the J616c sink and compliance runs.
9f93c19
into
aurora-silicon:integration/aurora
This branch starts from
integration/auroraand merges cleanly on top of#1954,#2216, and#2389with zero conflicts.Summary
This change adds HDMI-CEC adapter support (
CONFIG_DRM_APPLE_CEC) for built-in HDMI ports behind the compact EPIC CEC service (dcpav-cec-interface-epicon RTKit endpoint0x2b):CONFIG_DRM_APPLE_CEC: SelectCEC_COREwhen enabled and register a standard Linux/dev/cecXadapter per fixedHDMI-Aconnector when endpoint0x2bis active (CEC_CAP_DEFAULTS | CEC_CAP_CONNECTOR_INFO | CEC_CAP_NEEDS_HPD,9500 mstransfer timeout). Endpoint0x29on 14.x firmware remains unsupported pending a capture of its report layout.struct epic_service_callheader when the compact subheader is followed directly by a service-call header. Continue to skip the eight-byte descriptor on wrapped reports. Addafk_service_retire_channel()so retiring a terminated service does not disable a singleton slot reused in place for a later announcement.0x2b. Group 0 calls open (4), close (5), set the logical address mask (6), read EDID attributes (7), and transmit a frame (9, 7500 ms timeout). The mask includes the broadcast address while enabled and clears on disable. Group 2 reports carry termination (1), a received frame (2), HPD state (3), or EDID attributes (4).system_dfl_wqbeforecec_unregister_adapter()outsidedcp_typec_fabric_lock, keepcec->srvpinned across DRM component unbind/rebind, and guard TX completions with a per-transfer sequence and8500 mscompletion window.<= 2 msHDMIIRQ_HPDpulses without 500 ms masking: Enabledcp_hdmi_init()for every DCP with anhdmi-hpdGPIO and a fixedHDMI-Aconnector, suppressing further requests if firmware refusesDPTX_CMD_SINK_IRQ. Classify<= 2 msHPD low pulses in hard IRQ context with a2 mshrtimerso theIRQF_ONESHOTthreaded handler does not mask converterIRQ_HPDpulses, and wake the threaded HPD handler viairq_wake_thread()when HPD stays low past2 ms.afk-parser-test,apple-dcp-cec,apple-dcp-cec-adap,desktop.py, andextract-hpd.py.Testing
./scripts/checkpatch.pl --strict -g HEAD:0 errors, 0 warnings, 0 checks.tools/testing/selftests/drivers/gpu/apple-dcp/run.py:88/88passed.tools/testing/selftests/drivers/gpu/apple-afkv2/run-afkv2-tests.sh: all checks passed.tools/asahi/run-host-tests.py --only dcp:27/27passed.arm64QEMU KUnit (CONFIG_PROVE_LOCKING=y,CONFIG_DRM_APPLE_KUNIT_TEST=y):380passed (10/10inapple-dcp-cecandapple-dcp-cec-adap,9/9inapple-epic-parser),0failed,0lockdep or kernel warnings.J616c(T6041, MacBook Pro 16" M4 Max, firmware 27.2) with an HDMI-CEC sink (BenQ PJ) diagnosed and verified the two initial PA issues fixed here (bare compactepic_service_callreport framing on endpoint0x2band HPD status reading low on plug).