Skip to content

J516S HDMI: link-setup retry reports the display as disconnected to userspace, so compositors drop and re-add the output #87

Closed

Description

@aronvandepol

Mac and installed build

MacBook Pro 16" M3 Pro (apple,j516s, apple,t6030). Aurora 2026.10.11.14: linux-aurora 7.1.12.aurora2-20261011.14 (running 7.1.12-2-20261011.14-sep-ARCH), m1n1-aurora 1.6.1.aurora17-5. Asahi Alarm v0.9.2 base with omarchy-mac (Hyprland 0.56.2, Aquamarine 0.15.1).

Local changes: our appledrm build with the t6030 120 Hz/early-flip/backlight patches from #31 and #32. Those touch the internal panel path only (iomfb_v14_7.c swap timing and brightness), not the external DCP or the DP2HDMI code.

Both firmware versions and provisioning

asahi,os-fw-version 14.7, asahi,system-fw-version 26.6.2.

Reproduction, expected result, and actual result

Display: iiyama ProLite PL2492H (1920x1080, 60 and 75 Hz) on the laptop's own HDMI port (2d2c00000.dcp, DP2HDMI), plain HDMI cable, no dock.

Steps: plug the monitor into HDMI, or let the compositor do a modeset on it (login, mode change). It happens on every connect and modeset I looked at today: 7, 1 and 4 drops across three boots.

Expected: the connector stays connected while the driver retries its own link setup.

Actual: the first link setup fails with -67. While the driver retries, it reports the connector as disconnected to userspace for about half a second, and then connected again:

11:46:56.410 DP2HDMI HPD irq, 500ms debounce: connected:1
11:46:57.118 HDMI display link not set up (-67): retry 1 of 3 in 1000 ms
11:46:57.307 dcp_hotplug() connected:1 valid_mode:0 nr_modes:24
11:46:57.316 display ColorElements withdrawn, 0 bytes
11:46:57.316 display TimingElements withdrawn, 0 bytes
11:46:57.318 display DisplayAttributes withdrawn, 0 bytes
11:46:57.322 dcp_hotplug() connected:0 valid_mode:0 nr_modes:24
11:46:57.529 display description incomplete (0x2); waiting before the mode is set
11:46:57.593 display description complete again
11:46:57.847 dcp_hotplug() connected:1 valid_mode:0 nr_modes:24
11:46:58.138 display retry: the display is back and set

The kernel ends up fine (the mode is set, modetest lists all 24 modes), but userspace sees a real unplug and replug. Two consequences here, both in Hyprland/Aquamarine:

  1. Aquamarine reconnected the output inside the gap, read count_modes = 0, and kept a 0x0 output with no modes. The screen stayed black until I patched Aquamarine to reconnect a mode-less output once modes appear.
  2. Later, the same flap (15:13:48 DP2HDMI HPD irq, connected:0, then connected:1 a second later, then another display link not set up (-67) at 15:13:51) made Hyprland remove and re-add the wl_output global while Xwayland was binding it. Xwayland exited (global wl_output (170) is unavailable), and from then on every X client hung, which eventually froze Hyprland. That part is a Hyprland race (it destroys an unbound removed global immediately), and I patched it locally, but the flap is what triggers it, and it happens on every HDMI connect on this Mac.

Graphics or session details (if relevant)

Hyprland 0.56.2 (omarchy-mac), Aquamarine 0.15.1, Xwayland 24.1.14, mesa-m3 from the .14 release.

Relevant error lines

See the sequence above. The flap always has the same shape: display link not set up (-67): retry, the firmware withdraws ColorElements/TimingElements/DisplayAttributes/Transport, dcp_hotplug() connected:0, then description complete again, dcp_hotplug() connected:1, display retry: the display is back and set.

Related issues, pull requests, or code examples

  • Display routing: complete remaining board/port retests of the shipped CRTC fix #41 (display routing retests) and Software-rendered desktop: make late USB-C hotplug obtain a usable display route #39 (late USB-C hotplug) are about the external display paths, but neither covers HDMI link-retry hotplug events.
  • Workarounds on our side, both in userspace: an Aquamarine change that re-reads modes for a connector that was connected without any (with aquamarine#426), and a Hyprland change that keeps removed wl_output globals for 5 s before destroying them, the way wlroots does. They make the desktop survive the flap but do not stop it.
  • Suggestion: while the driver's own display link not set up retry is pending, keep the connector connected (or don't send the hotplug event for the intermediate state), so userspace only sees the final result.

What was not tested

  • Other HDMI monitors, cables or resolutions. Only this iiyama.
  • Whether earlier Aurora builds behave the same.
  • HDMI through a USB-C dock or adapter, as opposed to the built-in port.
  • Whether the 75 Hz mode the driver picks on retry, against the 60 Hz the compositor asked for, plays a part.

Activity

  1. chriskearney commented on Oct 13, 2026

    @chriskearney

    Thanks for the detailed report. The cause is in the kernel, and a fix is in draft #115 (branch fix/j516s-hdmi-hold).

    • The flip: when the firmware withdraws the HDMI display's description during link setup or a mode set, the driver reported a disconnect. The hold that keeps a connector connected through that only covered Type-C. Now the HDMI connector stays connected, with its modes and EDID, while HPD is high, and the description coming back sends at most one event.
    • The -67: every T6030 HDMI connect returned -ENOLINK after the link was already up, because it checked the Type-C cable flag. That queued the 1 s retry on every attach. It now checks the HDMI port's HPD.

    Our lab M3 Pro has no HDMI display attached, so could you run your sequence on this branch with stock aquamarine and Hyprland?

    • plug in, then log in;
    • 60 and 75 Hz;
    • DPMS;
    • s2idle;
    • unplug and a quick replug.

    The kernel log, udevadm monitor and the Hyprland log from that would settle it. You should see no -67, the status should never read disconnected while plugged in, and there should be no 0x0 output. Your appledrm panel patches touch other code, so they can stay.

  2. aronvandepol commented on Oct 14, 2026

    @aronvandepol
    Author

    Results from the J516S on aurora-2026.10.13.18, with appledrm built from the .18 tag plus gh pr diff 115, stock aquamarine 0.15.1-1.1 and Hyprland 0.56.2-5. HDMI display: iiyama 1920x1080 on the built-in port.

    Step Result
    Plugged in, then log in Pass. display withdrawn on the HDMI port with HPD: kept connected until it is described again, no -67, no 0x0 output
    60 -> 75 (74.973) -> 60 Hz Pass, the connector never read disconnected
    DPMS off/on Pass
    s2idle Refused by the driver as built (below). With that check bypassed: pass, HDMI back after the lid woke it, no replug
    Unplug and quick replug Pass. Disconnected only while HPD was low, back with 24 modes, one kept connected during the re-describe, Hyprland output back about 1 s after the replug

    No -67, no modeless output and no GPU faults in the whole session.

    s2idle. dcp_external_sleep_vetoed() refuses every suspend while an external display is attached:

    apple-dcp 2d2c00000.dcp: refusing system sleep: a display link is up
    apple-dcp 2d6c00000.dcp: refusing system sleep: a USB-C display is attached
    apple-dcp 2d6c00000.dcp: refusing system sleep: a display link is up
    

    The first line is HDMI only. The USB-C refusal also came with DPMS off on every output. Our module without #115 refuses the same way, so it is not from the PR.

    The comment above the check says resume does not bring an attached display back. We tested that with a module parameter that skips only the "link is up" and "attached" reasons. The start and failed-session cases still refuse:

    sleep_with_display patch (dcp.c)
    --- a/drivers/gpu/drm/apple/dcp.c
    +++ b/drivers/gpu/drm/apple/dcp.c
    @@ -69,6 +69,13 @@
     module_param(hdmi_audio, bool, 0644);
     MODULE_PARM_DESC(hdmi_audio, "Enable unstable HDMI audio support");
     
    +/* aurora-m3-testing 2026-10-14 experiment: let s2idle proceed with an
    + * external display attached or its link up, relying on the existing
    + * suspend teardown and resume reinit. Off by default. */
    +static bool sleep_with_display;
    +module_param(sleep_with_display, bool, 0644);
    +MODULE_PARM_DESC(sleep_with_display,
    +		 "Experimental: do not refuse system sleep for an attached external display or its link");
     static bool unstable_edid = true;
     module_param(unstable_edid, bool, 0644);
     MODULE_PARM_DESC(unstable_edid, "Enable unstable EDID retrival support");
    @@ -2633,6 +2640,11 @@
     			dcpext_scanout_requested(dcp)) ?
     		       "external firmware/scanout attempted" : NULL;
     	why = iomfb_v14_7_external_busy(dcp);
    +	if (why && READ_ONCE(sleep_with_display) &&
    +	    !strcmp(why, "a display link is up")) {
    +		dev_info(dcp->dev, "sleeping with an attached display: %s (sleep_with_display)\n", why);
    +		why = NULL;
    +	}
     	if (why)
     		return why;
     	if (iomfb_v14_7_external_failed(dcp)) {
    @@ -2641,10 +2653,14 @@
     		return NULL;
     	}
     	if (READ_ONCE(dcp->active_typec_route) || READ_ONCE(dcp->typec_cable_connected))
    -		return "a USB-C display is attached";
    -	if (dcp->hdmi_hpd && gpiod_get_value_cansleep(dcp->hdmi_hpd) > 0)
    -		return "an HDMI display is attached";
    -	return NULL;
    +		why = "a USB-C display is attached";
    +	else if (dcp->hdmi_hpd && gpiod_get_value_cansleep(dcp->hdmi_hpd) > 0)
    +		why = "an HDMI display is attached";
    +	if (why && READ_ONCE(sleep_with_display)) {
    +		dev_info(dcp->dev, "sleeping with an attached display: %s (sleep_with_display)\n", why);
    +		return NULL;
    +	}
    +	return why;
     }
     
     /* dpm_prepare completes for every device before any dpm_suspend callback.

    DPMS off, then systemctl suspend, lid as the wake source:

    • drm/apple: t6030: keep an HDMI display connected while it is described again #115 build, HDMI: slept 13 s. On resume HDMI: setting up the output again (after system sleep), one kept connected, output back at 1920x1080 without a replug.
    • Our .18 module, HDMI: slept 41 s, same result.
    • Our .18 module, USB-C (Philips): slept 2 min 22 s. The tunnel session reconnected, one display withdrawn on a Type-C route with HPD: kept connected, output back at 1920x1080. One sn201202x 2-08: cd321x_interrupt: failed to read events at resume.

    No GPU or firmware faults in any of them.

    Questions:

    1. Is there a case where resume loses the display that we did not hit? If not, would a parameter like this, or a narrower check, be acceptable for J516S?
    2. A key on an external keyboard does not wake the Mac from s2idle. Only the lid does, although the keyboard, its root hub and xhci-hcd.3.auto all have power/wakeup enabled. In the .18 sources the AIC irq_chips have no irq_set_wake and no IRQCHIP_SKIP_SET_WAKE, xhci-plat never calls enable_irq_wake, and xhci_suspend() halts the controller. Is USB wake planned, or is there a known wake path for dwc3-apple?
  3. chriskearney commented on Oct 15, 2026

    @chriskearney

    Thanks @aronvandepol, your test settled it. #115 is merged into integration/aurora as fa2a2a70 and goes out in the next release. The merged tree is the one we built and KUnit-tested locally. The review notes, with a few narrow follow-ups, are on #115.

    #115 doesn't cover your two sleep questions:

    • the external-display sleep veto on J516S, which your bypassed runs suggest is stricter than it needs to be;
    • USB keyboard wake from s2idle.

    I've passed both on to the team to pick up separately.

  4. chriskearney commented on Oct 15, 2026

    @chriskearney

    @aronvandepol your two sleep questions are now tracked in #121, with your runs and logs: the J516S external-display sleep veto, and USB keyboard wake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions