Skip to content

drm/apple: qualify serialized external display teardown - #279

Closed
RyanTheTide wants to merge 5 commits into
test/t8140-external-output-qualificationfrom
test/t8140-external-stop-qualification
Closed

RyanTheTide wants to merge 5 commits into
test/t8140-external-output-qualificationfrom
test/t8140-external-stop-qualification

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

External display teardown bypasses a qualified pipe stop. Add reversible presentation admission, strict queue settling, serialized link/power transitions, generation-aware recovery and exact external-power response bounds.

This draft stacks on #280's working R34 output/identity/profile branch. Initial external association now fences metadata before service discovery; duplicate connect notifications preserve the physical ticket. Cable loss invalidates metadata and preserves a pending EDID-cache cleanup across rapid reconnects. Connector property cleanup stays deferred outside commit-context locks. The public output and stop branches were combined with a normal merge; no history rewritten.

A473(0) records its complete eight-byte reply but deliberately returns -EOPNOTSUPP. It does not release HPD, the display session, crossbar ownership, framebuffers or DMA based on an unqualified reply. The external ON path preserves device/parameter setup and accepts only the existing eight-byte value 1. A not-yet-published initial DPTX service remains retryable; closure and errors after firmware commands remain terminal. Notifications run outside lifecycle locks.

Validation:

  • Extracted production lifecycle, admission, drain, power callback and CRTC helpers pass host ASan/UBSan tests. A qualified-OFF adapter exists only in the test harness; production OFF remains blocked.
  • Tests cover initial metadata association before service readiness, duplicate HPD ticket preservation, physical-loss invalidation, rapid reconnect cleanup, stale CRTC tokens, retained resources and late replies.
  • Combined metadata/parser/lifetime, readiness and AFK admission suites pass. Timing restriction and metadata framing checks from drm/apple: qualify external SDR color and monitor EDID on J700 #280 are preserved.
  • Earlier Astra review found no source blocker for the narrow sequence: initialized activation, one DPMS-OFF response capture, then reboot. Integration lock ordering was reviewed directly; full build passed without compiler warnings/errors and Apple KUnit passed 37/37 on public 9f742dd.

Merge gates: exact OFF reply observation, retained-link restart qualification, safe resource teardown, repeated physical hotplug, DPMS/sleep/wake, timeout ownership and final adverse review. The next hardware trial is only one OFF capture followed by reboot. No release-ready or successful shutdown claim.

R35 hardware result: boot passed, but activation failed with DP-1 disconnected. DPTX link and 13 firmware modes were present, metadata valid; the paused lifecycle path withheld initial HPD publication, preventing the CRTC activation needed to unpause. The frame gate failed, so no OFF was sent. Neo returned to R34 with both outputs enabled. Public 17be954 fixes initial discovery by allowing cable-backed HPD publication before the first power attempt while presentation remains paused. The regression test fails on the prior production function and passes with the fix, including assertions that discovery does not power or unpause the pipe. ASan/UBSan lifecycle, metadata and delayed-service suites passed; the exact source full R36 build passed. ARM64/QEMU Apple KUnit passed 37/37 on 17be954 (log SHA256 be03bc0b29073676064cfa66304c10288e072285fbf883b5f23e9dd444a2dfe9). The specific initial-discovery regression is covered by the extracted production host test; KUnit covers the five existing Apple suites. R36 hardware activation remains untested. OFF capture is conditional on a successful activation gate; no OFF has been sent.

R36 preparation: exact public package installed and fully manifest-verified on Neo using an atomic module move; initramfs generated in bounded temporary RAM storage. Existing boot/EFI hashes and the running R34 were preserved. R36 has no boot entry, was not selected and has not booted. Hardware activation and OFF gates remain pending.

Pause new presentation work while callbacks and control RPCs remain available; settle the active queue, serialize external lifecycle operations and retain resources on failure. Preserve first-start preparation and generation-aware CRTC recovery. OFF replies are captured but deliberately return EOPNOTSUPP until their contract is qualified; no successful production teardown or DMA retirement is claimed.

Host tests exercise admission, drain, exact response bounds, timeout ownership and lifecycle ordering. A hypothetical qualified-OFF adapter exists only inside the host test. Astra reviewed this revision for one initialized DPMS-OFF capture followed by reboot, excluding unplug/suspend/restart qualification.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Distinguish a service not yet published from terminal session closure before issuing firmware commands. Keep initial publication retryable, preserve sticky failures after real connection commands, and schedule asynchronous reconnect when the service arrives late.

The R28 hardware trial exposed the startup ordering regression. Extracted production tests cover initial and partial publication, closure, late arrival, and retained firmware failures.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Choose advertised full-range 8/10-bit SDR RGB modes for the experimental external H17P profile. Prefer sRGB or BT.709 over default RGB, then use firmware scores. Reject timings that only offer incompatible color modes instead of selecting BT.2020 for native SDR scanout. Leave internal and legacy policy unchanged.

The working J700 selected BT.2020 RGB while displaying an SDR desktop. Production-parser tests cover 65 valid, malformed, legacy and high-refresh cases. Hardware color appearance still requires qualification.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Combine the public R34 output branch with the existing stop-capture and
initial service-discovery fixes. Keep timing restrictions, firmware-derived
monitor identity and bounded property framing intact.

Fence metadata in the external path before service discovery. Duplicate
connect notifications retain the physical connection ticket; physical
removal invalidates it. Preserve pending EDID cache invalidation across a
rapid reconnect and defer connector property cleanup to the worker.

Host ASan/UBSan tests cover these interleavings. OFF replies remain
unqualified and retain resources; no shutdown/reconnect qualification or
production readiness is claimed by this merge.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide changed the base branch from test/t8140-external-public45 to test/t8140-external-output-qualification October 12, 2026 10:16
…aused

The lifecycle gate cached the first connected HPD while waiting for DRM
activation to unpause presentation. DRM could not activate a connector
that had never been published, leaving the R35 external output absent even
with a connected DPTX link and valid mode metadata.

Publish cable-backed initial discovery before the first power attempt,
while retaining the presentation pause. Sticky failures, absent cables and
OFF/restart callbacks remain withheld. Receive callbacks still acquire no
lifecycle mutex or issue firmware control requests.

The regression test fails on the prior production function and passes with
this change; it verifies that discovery does not power or unpause the pipe.
ASan/UBSan lifecycle, metadata and delayed-service tests pass. Hardware
activation and OFF-response qualification remain pending.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

All commits are already ancestors of aurora-wip ea2e6a1. Closing the integrated historical qualification PR. Further automatic PIPE/PM and repeated-hotplug qualification remains tracked in #293.

@RyanTheTide
RyanTheTide deleted the test/t8140-external-stop-qualification 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