Skip to content

drm/apple: read H17P monitor EDID through owned AFKV2 buffers - #292

Merged
RyanTheTide merged 5 commits into
aurora-wipfrom
fix/h17p-edid-service-20261013
Oct 13, 2026
Merged

RyanTheTide merged 5 commits into
aurora-wipfrom
fix/h17p-edid-service-20261013

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

External H17P connectors lose monitor identity because the legacy endpoint and inline request do not match their DPAV firmware service. After physical reconnect, firmware allocates a new service interface, so a fixed interface also loses EDID.

Read actual EDID using the existing host-owned AFKV2 OOB transport at endpoint 0x2a. Admit the exact observed DPAV compartment/class with the dynamically announced interface; retire the old service on physical disconnect and fence commands, cached data and publication by physical generation and service epoch. Validate reply ownership, returned length, complete EDID blocks and checksums. Start external AFKV2 announcements asynchronously to avoid a false boot timeout, and defer DRM dimension updates out of the ordered receive path. Preserve internal-panel and legacy endpoint behavior.

Validation:

  • Independent actual-function ASan/UBSan transport, binding, lifecycle, late-ACK, metadata and threaded RX-progress tests passed, including 917 AFKV2 codec assertions and legacy controls.
  • ARM64 LLVM W=1 module compile, modpost and link passed without warnings.
  • On Neo R54, automatic boot probing and physical unplug/replug returned valid 256-byte Acer QG270 S3 EDID, byte-for-byte matching native macOS. GNOME displayed the Acer name. Owner confirmed moving picture/cursor and normal colours; a separate diagnostic rate policy was active at 180 Hz.

Reversed USB-C orientation remains a separate PHY/link failure: the DPAV service successfully rebinds, but PHY status and PIPE locking fail before link setup. This PR does not claim to fix that failure or complete DP Alt Mode qualification. No 180 Hz admission policy, diagnostic EDID gate, raw captures or machine identifiers are included. Source provenance is recorded in the individual commits.

The external H17P DPAV service is on endpoint 0x2a with the
identity dcpav-service-epic / AppleDCPDP2HDMI / unit 1. Select
that endpoint only for the external profile and route AFK receives
by the instantiated DPAV and DPTX endpoints, preserving legacy
0x28 DPAV and 0x2a DPTX routing and native H17P DPTX at 0x2c.

Admit the exact service before the existing AFKV2 OPEN. Keep the
bounded read-only group 1 command 7 EDID request and its response
validation. Reject in-flight EDID and cached/publication results
when the physical Type-C generation changes. Invalidate that
generation before waiting for firmware disconnect teardown.
Release hpd_mutex during EDID requests and hold it for publication
under the existing mode_config.mutex ordering. Keep the conservative
firmware metadata epoch guard and service owner/reader pins.

Host tests exercise actual production routing, admission, reader
ownership and publication with synthetic disconnected/delayed
responses. Firmware wire behavior still requires owner qualification.
Complete existing kernel-doc parameter descriptions for a clean W=1
compile without warning suppression.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
A service CLOSE/replacement can leave a raw EDID cache valid even when the
physical Type-C generation does not change. Replacement after the reader's
last pointer check can also publish data from the retired service.

Give DPAV an epoch that advances on service publication and retirement.
Carry it from the pinned reader into the raw connector cache and validate
it again while serializing publication against teardown. Use a process
context mutex for the DPAV owner state, nesting below the DRM and HPD
mutexes and releasing it during firmware waits. Defer CLOSE cache/property
cleanup through the existing hotplug worker. Preserve the physical
connection checks, owner/reader pins and firmware metadata epoch guard.

DisplayAttributes is handled synchronously on RTKit's ordered RX worker.
Taking mode_config.mutex there can block dispatch of the AFK reply that a
mode probe is waiting for while it holds that mutex. Defer connector
physical-dimension updates to the existing hotplug worker instead.

Add a threaded host regression through the actual RTKit, IOMFB receive,
dimensions and AFK enqueue functions. It fails on the parent with RX
blocked before the AFK reply, and passes with the deferred update. Extend
service and publication tests for same-slot CLOSE/re-OPEN, unchanged
physical generations and replacement after the reader's last check.
No command ABI or activation-readiness assumption is changed.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Additional hardware qualification: a separate, public diagnostic branch suppresses H17P EDID reads during boot and permits exactly one root-armed read after the external display is active. Its default-off, failure-consumption, profile-isolation and bounded trace tests passed, and the ARM64 module built with W=1 without warnings.

The post-activation group 1 / command 7 request on the observed service at endpoint 0x2a, channel 1 timed out after 1000 ms. The connector retained its 128-byte firmware-derived fallback; this is not fresh monitor EDID. The AFK receive trace was enabled with recording on and no filter, but captured no incoming response for this attempt.

This rules out treating delayed invocation alone as the fix. The inline versus owned-buffer transport remains under investigation. Response validation and service/generation safeguards remain intact. PR stays draft; diagnostic-only changes are not proposed for production merge.

The tested external SDR colour correction remains functional, and 1920x1080 at 180 Hz was restored and confirmed through the compositor after the diagnostic.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware breakthrough: the separately reviewed diagnostic branch diagnostic/h17p-edid-owned-oob-20261013 successfully reads the Acer monitor's actual EDID using the existing AFKV2 host-owned OOB descriptor path.

One post-activation group 1 / command 7 read returned 256 bytes with both block checksums valid. Its SHA256 exactly matches the independently captured native macOS EDID. The received AFKV2 OOB reply is 56 bytes, with the EDID in the validated owned RX buffer. The prior 128-byte firmware-derived fallback was replaced by the actual 256-byte blob.

The full AFKV2 sanitizer suite and independent extracted sender/service/late-ACK tests passed before this attempt. Default-off one-shot gating and extended tracing belong only to the diagnostic; they will not be production-merged.

A minimal production transport fix is now being prepared atop this PR's service-epoch and physical-generation safeguards. Boot, reconnect, monitor replacement and mode/colour qualification remain required before merge. The actual Acer EDID advertises its 1080p180 detailed timing and HDMI Forum 600 MHz maximum character rate; these facts do not justify a global unsafe-mode bypass.

Use the existing host-owned AFKV2 OOB command transport for the observed
external H17P DPAV service. Select service admission, notification and the
strict length-aware EDID reader by AFKV2 framing rather than inline payload
placement. Keep legacy profiles on their existing endpoint and reader.

Length-aware AFKV2 callers must copy only the validated actual reply length
for both inline and owned OOB replies. Keep strict callers' full-length
contract and non-AFKV2 behavior unchanged. Preserve exact original DMA
address/bounds matching, command slots, timeout retention and late-ACK
release, without following peer-provided pointers.

Apply the public owned transport correction from
821e796 on the service-lifetime/RX-progress
base. Retain physical generation and service epoch checks, strict EDID
header/length/block/checksum validation, and the conservative firmware
metadata guard. No one-shot diagnostic permission, enlarged trace capture,
timeout snapshot or refresh-rate admission is included.

Extend actual sender/service extraction fixtures for short owned OOB
responses, strict and legacy contracts, and the real late-ACK completer.
A mismatched or duplicate reply cannot release retained DMA; the matching
late reply retires the pending slot even after service retirement.
Adapt lifetime/notification fixtures to the framing guard.

Validation: full AFKV2 suite with ASan/UBSan (917 codec assertions), EDID
lifetime, threaded RX-progress and metadata regressions pass. Targeted
ARM64 W=1 module compile/modpost/link passes without warnings. Initial
boot-time reads and physical hotplug remain owner qualification work.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide RyanTheTide changed the title drm/apple: use the H17P monitor-data service and reject stale EDID drm/apple: read H17P monitor EDID through owned AFKV2 buffers Oct 13, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Production hardware qualification update: automatic boot-time EDID retrieval passes with no diagnostic permission or expanded tracing. The connector obtains the same valid 256-byte native EDID and GNOME reports the monitor model.

Physical unplug/replug passes picture, cursor, SDR colour and 180 Hz, but monitor identity recovery fails. The connector EDID becomes empty; the existing owned-buffer read receives firmware status 0xe00002d7 after reconnect. A later normal DRM reprobe receives the same status, so a delayed retry alone is not sufficient. Apple’s public IOReturn definitions identify this value as Offline.

The monitor-data service lifecycle across reconnect is under investigation. Keep this PR draft; boot success does not qualify hotplug identity. Do not retain a previous connection's identity or weaken EDID/generation validation to hide the failure.

External H17P service announcements can arrive after the AFK endpoint starts.
Waiting synchronously for the EDID service can time out just before exact
admission completes, leaving a misleading startup failure despite a usable
service and delaying other endpoint initialization.

After a successful afk_start, return for the external AFKV2 profile and let
the existing guarded admission and late connector notification publish the
service. Do not claim a missing service is enabled. Retain the legacy
completion wait, timeout behavior and AFK-start failure cleanup unchanged.

Add host tests executing actual endpoint startup, admission, notification
and retirement for early, late, permanently missing and wrong-identity
announcements, plus legacy waits and endpoint-start failure. No protocol
command, service identity, EDID validation, generation or lifetime fence is
changed. Persistent Offline replies after physical reconnect remain separate
session/attachment qualification work.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
H17P parse_epic_service_init maps interface-id into the variable named unit.
That value is a dynamic AFKV2 interface identity, not a physical-port number.
Requiring unit 1 rejects fresh AV announcements after reconnect while retaining
the old offline interface.

Require the exact DPAV endpoint/compartment/class and a nonzero bounded
interface-id equal to the validated service channel. Preserve legacy EPICUnit
0 admission. Retire the current AV registry binding on physical disconnect,
current-generation deferred disconnect, route withdrawal and cable-release
teardown, outside hpd_mutex. Ordinary DPMS poweroff does not withdraw it.

Carry physical-generation and registry-epoch tickets from prepare through
OPEN/init so a disconnect or retirement during admission cannot publish stale
work. Local retirement disables the service and marks its slot torn down;
reader pins and outstanding commands still prevent reuse, and timed-out DMA
remains owned until a matching late ACK. Old CLOSE/ACK handling cannot revoke
a fresh binding.

Recognize the observed DPAV CLOSED report (0x14, zero token, low flags byte 1,
one zero payload byte) only on the instantiated DPAV endpoint. Keep the
existing 0x13 report handling and other endpoints unchanged. No new host
opcode or reopen of an offline interface is introduced.

Host regressions execute the production parser, ownership helpers, prepare/
init, retirement, receive dispatch and late-ACK completer for dynamic
interfaces 1/5/9/13, forged identities, independent generation/epoch changes,
old pins/CLOSED/replies and legacy unit 0. Full AFKV2 ASan/UBSan suite, startup,
EDID lifetime, external lifecycle, metadata and RX-progress tests pass.
Targeted ARM64 W=1 module compile/modpost/link passes without warnings.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

R54 hardware qualification of head d2635e4, combined with the separate diagnostic Acer 180 Hz policy:

  • Boot and ordinary-orientation physical unplug/replug passed. The actual 256-byte EDID matches the previously captured native macOS EDID byte for byte, both checksums pass, GNOME identifies Acer QG270 S3, and the owner confirms moving picture, correct colours and monitor name. Current 180 Hz was independently verified. Reconnected service used a new interface, confirming dynamic rebinding.
  • Repeating with the USB-C plug reversed produced no picture. The monitor-data service still rebinds successfully, but ATC PHY status times out and PIPE locking fails before link preparation; DRM consequently disconnects and has no live EDID. This is a separate PHY/link failure, under investigation in the PHY workstream.

This is scoped evidence for the EDID transport fix, not complete DP Alt Mode qualification. Draft remains pending the remaining review and compatibility checks. No stale EDID is presented as current sink identity.

@RyanTheTide
RyanTheTide marked this pull request as ready for review October 13, 2026 05:01
@RyanTheTide
RyanTheTide merged commit bb41967 into aurora-wip Oct 13, 2026
@RyanTheTide
RyanTheTide deleted the fix/h17p-edid-service-20261013 branch October 13, 2026 14:32
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