open-gpu-kernel-modules icon indicating copy to clipboard operation
open-gpu-kernel-modules copied to clipboard

nvidia-drm: force-enabled HDMI connector does not set link-status to Bad when sink stops responding

Open msedek opened this issue 8 months ago • 5 comments

NVIDIA Open GPU Kernel Modules Version

595.58.03

Does this happen with the proprietary driver?

Not tested (RTX 5070 Ti / Blackwell only supports open kernel modules)

Operating System and Version

CachyOS (Arch-based) rolling release

Kernel Release

Linux msedek-pc 6.19.10-1-cachyos #1 SMP PREEMPT_DYNAMIC x86_64

Hardware

GPU 0: NVIDIA GeForce RTX 5070 Ti (UUID: GPU-ce08f902-c260-a75d-c651-9713c298c7ea)

Describe the bug

When an HDMI connector is force-enabled via the kernel parameter video=HDMI-A-1:e, the NVIDIA DRM driver's detect() callback in nvidia-drm-connector.c reads connector->force and passes forceConnected = NV_TRUE to NvKMS. This correctly keeps the connector status as "connected" regardless of physical state.

However, when the HDMI sink (a Samsung 75" 4K TV in this case) switches to its built-in apps (Netflix, etc.) and stops listening on its HDMI receiver, the TMDS link goes down. The driver never sets the DRM link-status property to DRM_MODE_LINK_STATUS_BAD. This means userspace compositors (KWin, Mutter, etc.) are never notified that the link degraded, and they never trigger a modeset to re-train it.

When the TV returns to the HDMI input, the display remains blank because no component in the stack knows the link needs re-negotiation.

Per the DRM/KMS specification, DRM_MODE_LINK_STATUS_BAD should be set by the driver when link training fails or when the sink disappears, so userspace can force a re-probe. The KWin compositor already has handling for this (forces a modeset when linkStatus == Bad), but it never triggers because the driver never sets it.

The relevant code path in nvidia-drm-connector.c:

static bool __nv_drm_detect_encoder(...)
{
    switch (connector->force) {
        case DRM_FORCE_ON:
        case DRM_FORCE_ON_DIGITAL:
            pDetectParams->forceConnected = NV_TRUE;
            break;
        ...
    }
    // NvKMS returns connected, link-status is never updated
}

To Reproduce

  1. Connect a TV via HDMI to an NVIDIA GPU
  2. Add video=HDMI-A-1:e to kernel command line (force-enable the connector)
  3. Boot, verify TV displays correctly
  4. Switch the TV to a built-in app (Netflix, or any internal input)
  5. Switch the TV back to the HDMI input
  6. Display remains blank - the HDMI link is not re-trained
  7. Check link-status property: it still shows "Good" despite the link being dead

Expected behavior

When the HDMI sink stops responding on a force-enabled connector:

  1. The driver should detect the TMDS link failure
  2. Set link-status to DRM_MODE_LINK_STATUS_BAD via drm_connector_set_link_status_property()
  3. Send a uevent so the compositor can trigger a modeset to re-train the link

Bug Incidence

Always

nvidia-bug-report.log.gz

(will attach separately - generated with nvidia-bug-report.sh)

More Info

  • Display: Samsung 75" 4K TV (SAM, HDMI-A-1)
  • Second display: Samsung monitor via DisplayPort (DP-2), unaffected
  • Kernel parameters: video=HDMI-A-1:e drm.edid_firmware=HDMI-A-1:edid/samsung-4k.edid
  • Compositor: KWin 6.6.3 (Wayland)
  • KWin already handles linkStatus == Bad with m_forceModeset = true (drm_gpu.cpp:332-335), but this path never fires because the NVIDIA driver never sets the property
  • Related kernel DRM patch submitted to dri-devel: signals hotplug uevent for force-enabled connectors (https://lore.kernel.org/dri-devel/[email protected]/)
  • Related KDE KWin MR: https://invent.kde.org/plasma/kwin/-/merge_requests/9034
  • Related issue: #1055 (similar class of "DRM state diverges from physical reality")
  • Workaround: userspace I2C polling daemon that detects TV state via EDID reads and triggers kscreen-doctor disable/enable cycle

msedek avatar Mar 28 '26 16:03 msedek

nvidia-bug-report.log.gz attached below (generated with nvidia-bug-report.sh, driver 595.58.03)

msedek avatar Mar 28 '26 16:03 msedek

nvidia-bug-report.log.gz

msedek avatar Mar 28 '26 16:03 msedek

nvidia-bug-report.log.gz (base64-encoded due to GitHub API limitation): https://gist.github.com/msedek/7535e5efc4c3629215cf0af98fc406a7

Decode with: base64 -d nvidia-bug-report.log.gz.b64 > nvidia-bug-report.log.gz

msedek avatar Mar 28 '26 16:03 msedek

Closing - root cause was a userspace script (SimulateUserActivity loop) preventing DPMS from ever turning off screens. With DPMS cycling normally, the HDMI link re-negotiates on wake without any driver changes needed. Apologies for the false report.

msedek avatar Mar 29 '26 12:03 msedek

@msedek out of curiosity, for both the kwin change and this change, have you been using AI to assist you with the authorship?

Binary-Eater avatar Mar 29 '26 15:03 Binary-Eater