aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index e1787022d6c8..296fbd66f0e1 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1943,7 +1943,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1943 if (!dev_priv->mm.gtt) { 1943 if (!dev_priv->mm.gtt) {
1944 DRM_ERROR("Failed to initialize GTT\n"); 1944 DRM_ERROR("Failed to initialize GTT\n");
1945 ret = -ENODEV; 1945 ret = -ENODEV;
1946 goto out_iomapfree; 1946 goto out_rmmap;
1947 } 1947 }
1948 1948
1949 agp_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; 1949 agp_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
@@ -1987,7 +1987,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1987 if (dev_priv->wq == NULL) { 1987 if (dev_priv->wq == NULL) {
1988 DRM_ERROR("Failed to create our workqueue.\n"); 1988 DRM_ERROR("Failed to create our workqueue.\n");
1989 ret = -ENOMEM; 1989 ret = -ENOMEM;
1990 goto out_iomapfree; 1990 goto out_mtrrfree;
1991 } 1991 }
1992 1992
1993 /* enable GEM by default */ 1993 /* enable GEM by default */
@@ -2074,13 +2074,21 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
2074 return 0; 2074 return 0;
2075 2075
2076out_gem_unload: 2076out_gem_unload:
2077 if (dev_priv->mm.inactive_shrinker.shrink)
2078 unregister_shrinker(&dev_priv->mm.inactive_shrinker);
2079
2077 if (dev->pdev->msi_enabled) 2080 if (dev->pdev->msi_enabled)
2078 pci_disable_msi(dev->pdev); 2081 pci_disable_msi(dev->pdev);
2079 2082
2080 intel_teardown_gmbus(dev); 2083 intel_teardown_gmbus(dev);
2081 intel_teardown_mchbar(dev); 2084 intel_teardown_mchbar(dev);
2082 destroy_workqueue(dev_priv->wq); 2085 destroy_workqueue(dev_priv->wq);
2083out_iomapfree: 2086out_mtrrfree:
2087 if (dev_priv->mm.gtt_mtrr >= 0) {
2088 mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base,
2089 dev->agp->agp_info.aper_size * 1024 * 1024);
2090 dev_priv->mm.gtt_mtrr = -1;
2091 }
2084 io_mapping_free(dev_priv->mm.gtt_mapping); 2092 io_mapping_free(dev_priv->mm.gtt_mapping);
2085out_rmmap: 2093out_rmmap:
2086 pci_iounmap(dev->pdev, dev_priv->regs); 2094 pci_iounmap(dev->pdev, dev_priv->regs);