Skip to content

nvidia-drm: trigger connector detect on hotplug events#1127

Open
kekiefer wants to merge 1 commit intoNVIDIA:mainfrom
kekiefer:ogkm-hotplug-fix
Open

nvidia-drm: trigger connector detect on hotplug events#1127
kekiefer wants to merge 1 commit intoNVIDIA:mainfrom
kekiefer:ogkm-hotplug-fix

Conversation

@kekiefer
Copy link
Copy Markdown

Note that this fix was developed and validated against a Jetson Orin AGX 64GB running the r36.5 fork of these kernel modules (https://gitlab.com/nvidia/nv-tegra/tegra/kernel-src/nv-kernel-display-driver/-/tree/l4t/l4t-r36.5) where there is no meaningful commit history, so submission there did not seem appropriate.

As such, this change was rebased to upstream here, but could not be revalidated.

Also, if this repository is not the appropriate upstream target, please let me know and I can redirect this patch.


When a DisplayPort sink is hotplugged after boot, the connector status reported in /sys/class/drm/card0-DP-1/status remains "disconnected" even though the kernel observes the HPD edge and emits a HOTPLUG=1 uevent. Userspace must run echo detect > status to refresh the connector before a modeset succeeds.

The hotplug work handler nv_drm_handle_hotplug_event() was calling drm_kms_helper_hotplug_event(), which only sends a uevent and invokes the output_poll_changed callback. It never calls connector->detect(). Because the connector status is therefore never refreshed, DRM core keeps reporting the cached "disconnected" state.

Call drm_helper_hpd_irq_event() instead. That helper iterates all DRM_CONNECTOR_POLL_HPD-flagged connectors, runs connector->detect() on each, updates the recorded status, and only sends the uevent if the status actually changed. This is the correct entry point for an HPD-edge notification and produces a fresh status read for userspace without requiring a manual detect.

When a DisplayPort sink is hotplugged after boot, the connector status
reported in /sys/class/drm/card0-DP-1/status remains "disconnected"
even though the kernel observes the HPD edge and emits a HOTPLUG=1
uevent. Userspace must run `echo detect > status` to refresh the
connector before a modeset succeeds.

The hotplug work handler nv_drm_handle_hotplug_event() was calling
drm_kms_helper_hotplug_event(), which only sends a uevent and invokes
the output_poll_changed callback. It never calls connector->detect().
Because the connector status is therefore never refreshed, DRM core
keeps reporting the cached "disconnected" state.

Call drm_helper_hpd_irq_event() instead. That helper iterates all
DRM_CONNECTOR_POLL_HPD-flagged connectors, runs connector->detect() on
each, updates the recorded status, and only sends the uevent if the
status actually changed. This is the correct entry point for an
HPD-edge notification and produces a fresh status read for userspace
without requiring a manual detect.

Signed-off-by: Kurt Kiefer <kekiefer@gmail.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 28, 2026

CLA assistant check
All committers have signed the CLA.

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.

2 participants