[Intel-gfx] [PATCH 58/70] drm/i915: Before shrink_all we only need to idle the GPU

Chris Wilson chris at chris-wilson.co.uk
Tue Apr 7 08:21:22 PDT 2015


We can forgo an evict-everything here in favour of the simpler
i915_gpu_idle() as the shrinker operation itself will unbind any vma as
required. The simplicity allows us to ignore any errors whilst idling
and still force the request retirement to run.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_shrinker.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index 87bfced67998..3b44ed54cf46 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -158,7 +158,13 @@ i915_gem_shrink(struct drm_i915_private *dev_priv,
  */
 unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv)
 {
-	i915_gem_evict_everything(dev_priv->dev);
+	int ignore;
+
+	ignore = i915_gpu_idle(dev_priv->dev);
+	(void)ignore;
+
+	i915_gem_retire_requests(dev_priv->dev);
+
 	return i915_gem_shrink(dev_priv, LONG_MAX,
 			       I915_SHRINK_BOUND | I915_SHRINK_UNBOUND);
 }
-- 
2.1.4



More information about the Intel-gfx mailing list