@@ -376,6 +376,8 @@ static void i915_hotplug_work_func(struct work_struct *work)
376
376
u32 changed = 0 , retry = 0 ;
377
377
u32 hpd_event_bits ;
378
378
u32 hpd_retry_bits ;
379
+ struct drm_connector * first_changed_connector = NULL ;
380
+ int changed_connectors = 0 ;
379
381
380
382
mutex_lock (& dev_priv -> drm .mode_config .mutex );
381
383
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)
428
430
break ;
429
431
case INTEL_HOTPLUG_CHANGED :
430
432
changed |= hpd_bit ;
433
+ changed_connectors ++ ;
434
+ if (!first_changed_connector ) {
435
+ drm_connector_get (& connector -> base );
436
+ first_changed_connector = & connector -> base ;
437
+ }
431
438
break ;
432
439
case INTEL_HOTPLUG_RETRY :
433
440
retry |= hpd_bit ;
@@ -438,9 +445,14 @@ static void i915_hotplug_work_func(struct work_struct *work)
438
445
drm_connector_list_iter_end (& conn_iter );
439
446
mutex_unlock (& dev_priv -> drm .mode_config .mutex );
440
447
441
- if (changed )
448
+ if (changed_connectors == 1 )
449
+ drm_kms_helper_connector_hotplug_event (first_changed_connector );
450
+ else if (changed_connectors > 0 )
442
451
drm_kms_helper_hotplug_event (& dev_priv -> drm );
443
452
453
+ if (first_changed_connector )
454
+ drm_connector_put (first_changed_connector );
455
+
444
456
/* Remove shared HPD pins that have changed */
445
457
retry &= ~changed ;
446
458
if (retry ) {
0 commit comments