[Intel-gfx] [PATCH] drm/i915: Flush the idle-worker for debugfs/i915_drop_caches

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 17 09:26:50 UTC 2017


After being requested to idle the GPU, flush the idle worker to drop the
residual active state, and any internal object caches.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102655
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 40287e9f00d7..bfcdfb6b7225 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4266,6 +4266,9 @@ i915_drop_caches_set(void *data, u64 val)
 		i915_gem_shrink_all(dev_priv);
 	fs_reclaim_release(GFP_KERNEL);
 
+	if (!READ_ONCE(dev_priv->gt.active_requests))
+		drain_delayed_work(&dev_priv->gt.idle_work);
+
 	if (val & DROP_FREED) {
 		synchronize_rcu();
 		i915_gem_drain_freed_objects(dev_priv);
-- 
2.15.0.rc1



More information about the Intel-gfx mailing list