Merge airlied/drm-next into drm-misc-next
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 27 Feb 2017 08:30:11 +0000 (09:30 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 27 Feb 2017 08:30:11 +0000 (09:30 +0100)
Backmerge the main pull request to sync up with all the newly landed
drivers. Otherwise we'll have chaos even before 4.12 started in
earnest.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
1  2 
drivers/gpu/drm/i915/gvt/cmd_parser.c
drivers/gpu/drm/i915/i915_drv.c

Simple merge
index 51241dec3f839356d2d65f097797d1ebf27a9149,f6017f2cfb864d4d1e7573e472838516074bbe62..9be9b9b7f9cbb5f36bc56c43c241d4cbc70e4e23
@@@ -835,20 -818,13 +835,16 @@@ static int i915_driver_init_early(struc
        mutex_init(&dev_priv->pps_mutex);
  
        intel_uc_init_early(dev_priv);
 -
        i915_memcpy_init_early(dev_priv);
  
 +      ret = intel_engines_init_early(dev_priv);
 +      if (ret)
 +              return ret;
 +
        ret = i915_workqueues_init(dev_priv);
        if (ret < 0)
 -              return ret;
 +              goto err_engines;
  
-       ret = intel_gvt_init(dev_priv);
-       if (ret < 0)
-               goto err_workqueues;
        /* This must be called before any calls to HAS_PCH_* */
        intel_detect_pch(dev_priv);
  
  
        return 0;
  
- err_gvt:
-       intel_gvt_cleanup(dev_priv);
  err_workqueues:
        i915_workqueues_cleanup(dev_priv);
 +err_engines:
 +      i915_engines_cleanup(dev_priv);
        return ret;
  }
  
@@@ -1322,24 -1289,8 +1320,26 @@@ void i915_driver_unload(struct drm_devi
  
        intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
  
 +      drm_modeset_acquire_init(&ctx, 0);
 +      while (1) {
 +              ret = drm_modeset_lock_all_ctx(dev, &ctx);
 +              if (!ret)
 +                      ret = drm_atomic_helper_disable_all(dev, &ctx);
 +
 +              if (ret != -EDEADLK)
 +                      break;
 +
 +              drm_modeset_backoff(&ctx);
 +      }
 +
 +      if (ret)
 +              DRM_ERROR("Disabling all crtc's during unload failed with %i\n", ret);
 +
 +      drm_modeset_drop_locks(&ctx);
 +      drm_modeset_acquire_fini(&ctx);
 +
+       intel_gvt_cleanup(dev_priv);
        i915_driver_unregister(dev_priv);
  
        drm_vblank_cleanup(dev);