提交 80741e99 编写于 作者: I Imre Deak

drm/i915: Move load time shrinker registration later

According to the new init phases scheme we should register the driver
with frameworks/userspace only one the device is setup fully. So move
the shrinker registration later accordingly.

Also fix the shrinker unregistration order wrt. the acpi unregistration
to fix the corresponding init order.
Signed-off-by: NImre Deak <imre.deak@intel.com>
Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1458128348-15730-10-git-send-email-imre.deak@intel.com
上级 802cbbc0
...@@ -1117,8 +1117,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1117,8 +1117,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
i915_gem_load_init_fences(dev_priv); i915_gem_load_init_fences(dev_priv);
i915_gem_shrinker_init(dev_priv);
/* On the 945G/GM, the chipset reports the MSI capability on the /* On the 945G/GM, the chipset reports the MSI capability on the
* integrated graphics even though the support isn't actually there * integrated graphics even though the support isn't actually there
* according to the published specs. It doesn't appear to function * according to the published specs. It doesn't appear to function
...@@ -1138,7 +1136,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1138,7 +1136,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
if (INTEL_INFO(dev)->num_pipes) { if (INTEL_INFO(dev)->num_pipes) {
ret = drm_vblank_init(dev, INTEL_INFO(dev)->num_pipes); ret = drm_vblank_init(dev, INTEL_INFO(dev)->num_pipes);
if (ret) if (ret)
goto out_cleanup_shrinker; goto out_disable_msi;
} }
ret = i915_load_modeset_init(dev); ret = i915_load_modeset_init(dev);
...@@ -1147,6 +1145,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1147,6 +1145,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
goto out_power_well; goto out_power_well;
} }
i915_gem_shrinker_init(dev_priv);
/* /*
* Notify a valid surface after modesetting, * Notify a valid surface after modesetting,
* when running inside a VM. * when running inside a VM.
...@@ -1176,9 +1175,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1176,9 +1175,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
out_power_well: out_power_well:
intel_power_domains_fini(dev_priv); intel_power_domains_fini(dev_priv);
drm_vblank_cleanup(dev); drm_vblank_cleanup(dev);
out_cleanup_shrinker: out_disable_msi:
i915_gem_shrinker_cleanup(dev_priv);
if (dev->pdev->msi_enabled) if (dev->pdev->msi_enabled)
pci_disable_msi(dev->pdev); pci_disable_msi(dev->pdev);
...@@ -1223,12 +1220,11 @@ int i915_driver_unload(struct drm_device *dev) ...@@ -1223,12 +1220,11 @@ int i915_driver_unload(struct drm_device *dev)
i915_teardown_sysfs(dev); i915_teardown_sysfs(dev);
i915_gem_shrinker_cleanup(dev_priv);
io_mapping_free(dev_priv->gtt.mappable); io_mapping_free(dev_priv->gtt.mappable);
arch_phys_wc_del(dev_priv->gtt.mtrr); arch_phys_wc_del(dev_priv->gtt.mtrr);
acpi_video_unregister(); acpi_video_unregister();
i915_gem_shrinker_cleanup(dev_priv);
drm_vblank_cleanup(dev); drm_vblank_cleanup(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册