Skip to content

fix(asahi): add experimental HDMI reconnect recovery - #406

Open
avillagran wants to merge 1 commit into
omacom:quattrofrom
avillagran:fix/asahi-hdmi-reconnect
Open

fix(asahi): add experimental HDMI reconnect recovery#406
avillagran wants to merge 1 commit into
omacom:quattrofrom
avillagran:fix/asahi-hdmi-reconnect

Conversation

@avillagran

@avillagran avillagran commented Sep 11, 2026

Copy link
Copy Markdown

Summary

  • Add an experimental, opt-in downstream Asahi HDMI reconnect kernel patch, pinned to AsahiLinux/linux commit ce9f2eba72c061a50b2d790450e90af3439d8c24.
  • Track HDMI disconnect generations, request a real DRM modeset, and recover firmware power before programming the mode even when DRM's active state is unchanged. Preserve a newer disconnect and withhold swaps while recovery remains pending.
  • Include an isolated build-only wrapper/package recipe, package validation, pinned-source RED/GREEN regression tests, extracted-C seam tests, and a dedicated CI job.
  • Document curated hardware evidence, limitations, safe side-by-side installation and rollback procedures in docs/asahi-hdmi-reconnect.md.

Ready for maintainer review as an experimental, opt-in patch; not proposed for automatic deployment. No installer/update integration, package installation, GRUB changes, or reboots are performed by this PR. No raw journals, personal configuration, or prebuilt kernel package are included.

Validation

  • Focused offline build/package-contract test: bash test/shell.d/asahi-hdmi-reconnect-test.sh.
  • python3 test/asahi/reconnect.py: pinned baseline SHA-256 checks and patch applicability; baseline C seam produces exactly 11 expected assertion failures; patched seam reports zero failures; both source regression tests pass. The expected baseline RED is a regression check, not a full-suite pass.
  • Separate Bash syntax checks for the build wrapper and PKGBUILD; bin/omarchy commands --check passes (465 commands).
  • Repository-level git diff --check exits 2 on the embedded .patch file's required context-line prefixes (space before kernel tabs and space-only context lines). The patch is deliberately preserved byte-for-byte; the applied kernel-source diff passes its whitespace check in the focused regression runner.
  • Included patch SHA-256 is dbf332ead80ad84d5fb681fe83fc92c89cb88e0d4e416142acbb80565aacedcf, identical to the hardware-tested functional patch.
  • Prior hardware campaign: Apple MacBook Pro (16-inch, M2 Pro, 2023), candidate release 7.1.13-1-1-ARCH-hdmi-recover, 2560×1440 at 75 Hz. User confirmed initial image and three complete unplug/replug cycles, without compositor/session restart. Retained captures through the third reconnect had no flip_done timed out, commit wait timed out, Oops, BUG, or panic matches. An initial-boot swallowed-swap message also existed in baseline; this is not a claim of a completely clean boot log.
  • Prior machine-specific build compiled the five affected translation units and completed Image/modules/DTBs and package validation. This is historical evidence for the exact functional patch, not a completed build with the newly generalized wrapper.
  • Earlier local full-suite run failed; GitHub full-suite CI now passes: the prior ./test/all run exited 1. Its local log contains locale-sensitive benchmark arithmetic, jq parsing, and awk syntax diagnostics. Baseline comparison was interrupted, so these failures have not been established as pre-existing or unrelated. The local failure is retained for transparency; both GitHub suite jobs subsequently passed.
  • All five GitHub checks passed: Syntax + shellcheck, test/all, tests/all, Asahi HDMI source + C seam, and install.sh on Arch Linux ARM.

Remaining validation and maintainer review items

  • Complete a fresh native aarch64 build/package with this PR's generalized wrapper. Current wrapper coverage is syntax/contract validation, not end-to-end native build validation.
  • Reboot back to stock, verify the graphical session and persistent stock boot default. Stock and candidate remain installed, but post-fix stock rollback bootability has not been exercised.
  • Review/stress the gap between flush generation check and asynchronous firmware submission; the check does not serialize hotplug against submission.
  • Exercise synthetic-vblank work coalescing, real event ownership/callback ordering and framebuffer lifetime under rapid hotplug. Synchronous seam mocks cannot establish these properties.
  • Verify compositor liveness if disconnect after atomic check withholds a swap; recovery depends on a subsequent modeset-permitted commit.
  • Expand monitor/mode, suspend/resume, session and HDMI hardware/firmware coverage. Compilation of both firmware translation units is not hardware coverage of both versions.

Review scope

The staged patch, build/package path, tests and documentation received a separate publication review. No new functional kernel edits were made after the hardware campaign. Concurrency/liveness and packaging end-to-end validation remain explicit limitations for maintainer review rather than being represented as solved by the unit seam. This candidate does not implement USB-C DisplayPort or M3 enablement.

Extended runtime follow-up

The user reported another reconnection hours later. A read-only check found the same recovery kernel running after approximately 11 hours 46 minutes of uptime, with zero flip_done timed out, commit wait timed out, DCP has crashed, or set_digital_out_mode timed out matches in the retained current-boot journal. The journal includes a later reconnect with power-on and successful mode completion at monotonic time 15244 seconds. HDMI was disconnected when inspected, so this is not an independent confirmation of a currently visible image. Additional swallowed-swap messages exist in the extended journal; no claim of an entirely error-free log is made. The post-fix stock rollback reboot and broader race/stress coverage remain untested.

@avillagran
avillagran marked this pull request as ready for review September 11, 2026 19:17
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