[PATCH 2/2] drm/i915: Enable hotplug polling after registering the outputs

Chris Wilson chris at chris-wilson.co.uk
Mon Nov 27 00:11:33 UTC 2017


Previously we would enable hotplug polling on the outputs immediately
upon construction. This would allow a very early hotplug event to
trigger before we had finishing setting up the driver to handle it.
Instead, move the output polling to the last step of registration, after
we have set up all handlers, including the fbdev configuration.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Ville Syrjala <ville.syrjala at linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 2f509bd4c721..73f2d5eb78a9 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -691,10 +691,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
 		goto cleanup_gem;
 
 	/* Only enable hotplug handling once the fbdev is fully set up. */
-	intel_hpd_init(dev_priv);
-
 	drm_kms_helper_poll_init(dev);
-	drm_kms_helper_poll_enable(dev);
+	intel_hpd_init(dev_priv);
 
 	return 0;
 
@@ -1255,7 +1253,10 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
 	 * irqs are fully enabled. We do it last so that the async config
 	 * cannot run before the connectors are registered.
 	 */
-	intel_fbdev_initial_config_async(dev);
+	if (INTEL_INFO(dev_priv)->num_pipes) {
+		intel_fbdev_initial_config_async(dev);
+		drm_kms_helper_poll_enable(dev);
+	}
 }
 
 /**
-- 
2.15.0



More information about the Intel-gfx-trybot mailing list