Skip to content

Commit 3b85641

Browse files
committed
drm/nouveau/disp: use drm_kms_helper_connector_hotplug_event()
This adds more information to the hotplug uevent and lets user-space know that it's about a particular connector only. Signed-off-by: Simon Ser <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Lyude Paul <[email protected]> Cc: David Airlie <[email protected]> Cc: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 815d091 commit 3b85641

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

drivers/gpu/drm/nouveau/nouveau_display.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,8 @@ nouveau_display_hpd_work(struct work_struct *work)
465465
struct drm_connector *connector;
466466
struct drm_connector_list_iter conn_iter;
467467
u32 pending;
468-
bool changed = false;
468+
int changed = 0;
469+
struct drm_connector *first_changed_connector = NULL;
469470

470471
pm_runtime_get_sync(dev->dev);
471472

@@ -509,7 +510,12 @@ nouveau_display_hpd_work(struct work_struct *work)
509510
if (old_epoch_counter == connector->epoch_counter)
510511
continue;
511512

512-
changed = true;
513+
changed++;
514+
if (!first_changed_connector) {
515+
drm_connector_get(connector);
516+
first_changed_connector = connector;
517+
}
518+
513519
drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s (epoch counter %llu->%llu)\n",
514520
connector->base.id, connector->name,
515521
drm_get_connector_status_name(old_status),
@@ -520,9 +526,14 @@ nouveau_display_hpd_work(struct work_struct *work)
520526
drm_connector_list_iter_end(&conn_iter);
521527
mutex_unlock(&dev->mode_config.mutex);
522528

523-
if (changed)
529+
if (changed == 1)
530+
drm_kms_helper_connector_hotplug_event(first_changed_connector);
531+
else if (changed > 0)
524532
drm_kms_helper_hotplug_event(dev);
525533

534+
if (first_changed_connector)
535+
drm_connector_put(first_changed_connector);
536+
526537
pm_runtime_mark_last_busy(drm->dev->dev);
527538
noop:
528539
pm_runtime_put_autosuspend(dev->dev);

0 commit comments

Comments
 (0)