Skip to content

Commit a811c2e

Browse files
emersionjnikula
authored andcommitted
i915/display/hotplug: 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. v2: don't rely on the changed HPD pin bitmask to count changed connectors (Jani) Signed-off-by: Simon Ser <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Gustavo Sousa <[email protected]> Cc: Imre Deak <[email protected]> Cc: Lucas De Marchi <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8290bce commit a811c2e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/gpu/drm/i915/display/intel_hotplug.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ static void i915_hotplug_work_func(struct work_struct *work)
376376
u32 changed = 0, retry = 0;
377377
u32 hpd_event_bits;
378378
u32 hpd_retry_bits;
379+
struct drm_connector *first_changed_connector = NULL;
380+
int changed_connectors = 0;
379381

380382
mutex_lock(&dev_priv->drm.mode_config.mutex);
381383
drm_dbg_kms(&dev_priv->drm, "running encoder hotplug functions\n");
@@ -428,6 +430,11 @@ static void i915_hotplug_work_func(struct work_struct *work)
428430
break;
429431
case INTEL_HOTPLUG_CHANGED:
430432
changed |= hpd_bit;
433+
changed_connectors++;
434+
if (!first_changed_connector) {
435+
drm_connector_get(&connector->base);
436+
first_changed_connector = &connector->base;
437+
}
431438
break;
432439
case INTEL_HOTPLUG_RETRY:
433440
retry |= hpd_bit;
@@ -438,9 +445,14 @@ static void i915_hotplug_work_func(struct work_struct *work)
438445
drm_connector_list_iter_end(&conn_iter);
439446
mutex_unlock(&dev_priv->drm.mode_config.mutex);
440447

441-
if (changed)
448+
if (changed_connectors == 1)
449+
drm_kms_helper_connector_hotplug_event(first_changed_connector);
450+
else if (changed_connectors > 0)
442451
drm_kms_helper_hotplug_event(&dev_priv->drm);
443452

453+
if (first_changed_connector)
454+
drm_connector_put(first_changed_connector);
455+
444456
/* Remove shared HPD pins that have changed */
445457
retry &= ~changed;
446458
if (retry) {

0 commit comments

Comments
 (0)