From: Daniel Vetter Date: Mon, 27 Feb 2017 08:30:11 +0000 (+0100) Subject: Merge airlied/drm-next into drm-misc-next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c771633daf951439ef1875b0da52b56e5696d19f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge airlied/drm-next into drm-misc-next 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 --- c771633daf951439ef1875b0da52b56e5696d19f diff --cc drivers/gpu/drm/i915/i915_drv.c index 51241dec3f83,f6017f2cfb86..9be9b9b7f9cb --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@@ -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); @@@ -874,12 -850,8 +870,10 @@@ 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);