drm/i915: Remove dead i915_gem_evict_everything()
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 1 Oct 2015 11:18:28 +0000 (12:18 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 7 Oct 2015 14:05:40 +0000 (16:05 +0200)
With UMS gone, we no longer use it during suspend. And with the last
user removed from the shrinker, we can remove the dead code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem_evict.c

index 1626f3d79a6f881dcbca158e9df0849d2e468264..803105224e0d9c7b2174702c755c673238532d11 100644 (file)
@@ -3177,7 +3177,6 @@ int __must_check i915_gem_evict_something(struct drm_device *dev,
                                          unsigned long end,
                                          unsigned flags);
 int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle);
-int i915_gem_evict_everything(struct drm_device *dev);
 
 /* belongs in i915_gem_gtt.h */
 static inline void i915_gem_chipset_flush(struct drm_device *dev)
index d09e35ed9c9aa5f80e784397b0b799c5833ab64c..d71a133ceff5a25e87aa2888b45609577ce34939 100644 (file)
@@ -237,48 +237,3 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle)
 
        return 0;
 }
-
-/**
- * i915_gem_evict_everything - Try to evict all objects
- * @dev: Device to evict objects for
- *
- * This functions tries to evict all gem objects from all address spaces. Used
- * by the shrinker as a last-ditch effort and for suspend, before releasing the
- * backing storage of all unbound objects.
- */
-int
-i915_gem_evict_everything(struct drm_device *dev)
-{
-       struct drm_i915_private *dev_priv = dev->dev_private;
-       struct i915_address_space *vm, *v;
-       bool lists_empty = true;
-       int ret;
-
-       list_for_each_entry(vm, &dev_priv->vm_list, global_link) {
-               lists_empty = (list_empty(&vm->inactive_list) &&
-                              list_empty(&vm->active_list));
-               if (!lists_empty)
-                       lists_empty = false;
-       }
-
-       if (lists_empty)
-               return -ENOSPC;
-
-       trace_i915_gem_evict_everything(dev);
-
-       /* The gpu_idle will flush everything in the write domain to the
-        * active list. Then we must move everything off the active list
-        * with retire requests.
-        */
-       ret = i915_gpu_idle(dev);
-       if (ret)
-               return ret;
-
-       i915_gem_retire_requests(dev);
-
-       /* Having flushed everything, unbind() should never raise an error */
-       list_for_each_entry_safe(vm, v, &dev_priv->vm_list, global_link)
-               WARN_ON(i915_gem_evict_vm(vm, false));
-
-       return 0;
-}