|
@@ -1294,19 +1294,21 @@ static int i915_load_modeset_init(struct drm_device *dev)
|
|
|
if (ret)
|
|
|
goto cleanup_vga_switcheroo;
|
|
|
|
|
|
+ ret = drm_irq_install(dev);
|
|
|
+ if (ret)
|
|
|
+ goto cleanup_gem_stolen;
|
|
|
+
|
|
|
+ /* Important: The output setup functions called by modeset_init need
|
|
|
+ * working irqs for e.g. gmbus and dp aux transfers. */
|
|
|
intel_modeset_init(dev);
|
|
|
|
|
|
ret = i915_gem_init(dev);
|
|
|
if (ret)
|
|
|
- goto cleanup_gem_stolen;
|
|
|
-
|
|
|
- intel_modeset_gem_init(dev);
|
|
|
+ goto cleanup_irq;
|
|
|
|
|
|
INIT_WORK(&dev_priv->console_resume_work, intel_console_resume);
|
|
|
|
|
|
- ret = drm_irq_install(dev);
|
|
|
- if (ret)
|
|
|
- goto cleanup_gem;
|
|
|
+ intel_modeset_gem_init(dev);
|
|
|
|
|
|
/* Always safe in the mode setting case. */
|
|
|
/* FIXME: do pre/post-mode set stuff in core KMS code */
|
|
@@ -1314,7 +1316,10 @@ static int i915_load_modeset_init(struct drm_device *dev)
|
|
|
|
|
|
ret = intel_fbdev_init(dev);
|
|
|
if (ret)
|
|
|
- goto cleanup_irq;
|
|
|
+ goto cleanup_gem;
|
|
|
+
|
|
|
+ /* Only enable hotplug handling once the fbdev is fully set up. */
|
|
|
+ dev_priv->enable_hotplug_processing = true;
|
|
|
|
|
|
drm_kms_helper_poll_init(dev);
|
|
|
|
|
@@ -1323,13 +1328,13 @@ static int i915_load_modeset_init(struct drm_device *dev)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
-cleanup_irq:
|
|
|
- drm_irq_uninstall(dev);
|
|
|
cleanup_gem:
|
|
|
mutex_lock(&dev->struct_mutex);
|
|
|
i915_gem_cleanup_ringbuffer(dev);
|
|
|
mutex_unlock(&dev->struct_mutex);
|
|
|
i915_gem_cleanup_aliasing_ppgtt(dev);
|
|
|
+cleanup_irq:
|
|
|
+ drm_irq_uninstall(dev);
|
|
|
cleanup_gem_stolen:
|
|
|
i915_gem_cleanup_stolen(dev);
|
|
|
cleanup_vga_switcheroo:
|