summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_gtt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-10-26 21:20:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-10-26 22:25:34 +0100
commit3fc794f27fec8f020907090fb866602a1c64a73c (patch)
tree456b59bcb611e937f7ff887ea876949fbcd15e25 /drivers/gpu/drm/i915/i915_gem_gtt.c
parent9fb94522ddf2d3dca0d723e53db5f3f5ffb5487b (diff)
downloadlinux-3fc794f27fec8f020907090fb866602a1c64a73c.tar.bz2
drm/i915: Split memory_region initialisation into its own file
Pull the memory region bookkeeping into its file. Let's start clean and see how long it lasts! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191026202032.4371-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 3d3a8db18a07..eebc7fee81e2 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2744,59 +2744,6 @@ int i915_init_ggtt(struct drm_i915_private *i915)
return 0;
}
-void i915_gem_cleanup_memory_regions(struct drm_i915_private *i915)
-{
- int i;
-
- for (i = 0; i < INTEL_REGION_UNKNOWN; i++) {
- struct intel_memory_region *region = i915->mm.regions[i];
-
- if (region)
- intel_memory_region_put(region);
- }
-}
-
-int i915_gem_init_memory_regions(struct drm_i915_private *i915)
-{
- int err, i;
-
- for (i = 0; i < INTEL_REGION_UNKNOWN; i++) {
- struct intel_memory_region *mem = ERR_PTR(-ENODEV);
- u32 type;
-
- if (!HAS_REGION(i915, BIT(i)))
- continue;
-
- type = MEMORY_TYPE_FROM_REGION(intel_region_map[i]);
- switch (type) {
- case INTEL_MEMORY_SYSTEM:
- mem = i915_gem_shmem_setup(i915);
- break;
- case INTEL_MEMORY_STOLEN:
- mem = i915_gem_stolen_setup(i915);
- break;
- }
-
- if (IS_ERR(mem)) {
- err = PTR_ERR(mem);
- DRM_ERROR("Failed to setup region(%d) type=%d\n", err, type);
- goto out_cleanup;
- }
-
- mem->id = intel_region_map[i];
- mem->type = type;
- mem->instance = MEMORY_INSTANCE_FROM_REGION(intel_region_map[i]);
-
- i915->mm.regions[i] = mem;
- }
-
- return 0;
-
-out_cleanup:
- i915_gem_cleanup_memory_regions(i915);
- return err;
-}
-
static void ggtt_cleanup_hw(struct i915_ggtt *ggtt)
{
struct i915_vma *vma, *vn;
@@ -2834,8 +2781,6 @@ void i915_ggtt_driver_release(struct drm_i915_private *i915)
{
struct pagevec *pvec;
- i915_gem_cleanup_memory_regions(i915);
-
fini_aliasing_ppgtt(&i915->ggtt);
ggtt_cleanup_hw(&i915->ggtt);
@@ -3311,15 +3256,7 @@ int i915_ggtt_init_hw(struct drm_i915_private *dev_priv)
if (ret)
return ret;
- ret = i915_gem_init_memory_regions(dev_priv);
- if (ret)
- goto out_gtt_cleanup;
-
return 0;
-
-out_gtt_cleanup:
- dev_priv->ggtt.vm.cleanup(&dev_priv->ggtt.vm);
- return ret;
}
int i915_ggtt_enable_hw(struct drm_i915_private *dev_priv)