summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_debugfs.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-03-08 14:46:22 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-03-10 13:02:34 +0000
commit8eadc19b380d5650e9d9c58e8ecc28e9f2b4a371 (patch)
tree84fffa45d432bac47b8b947864fffc5d4195aff8 /drivers/gpu/drm/i915/i915_debugfs.c
parent504ae4024131c5a01c3ce8382d49b801375e039c (diff)
downloadop-kernel-dev-8eadc19b380d5650e9d9c58e8ecc28e9f2b4a371.zip
op-kernel-dev-8eadc19b380d5650e9d9c58e8ecc28e9f2b4a371.tar.gz
drm/i915: Extend debugfs/i915_drop_caches to call i915_gem_shrink_all()
Sometimes we want to explicitly page out all available objects from igt, i.e. call i915_gem_shrink_all() and check that subsequent operations succeed. This adds DROP_SHRINK_ALL [0x8] to the set of flags for debugfs/i915_drop_caches for that purpose. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/20170308144622.23194-1-chris@chris-wilson.co.uk Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 115433d..56674df 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4231,11 +4231,13 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_ring_test_irq_fops,
#define DROP_RETIRE 0x4
#define DROP_ACTIVE 0x8
#define DROP_FREED 0x10
+#define DROP_SHRINK_ALL 0x20
#define DROP_ALL (DROP_UNBOUND | \
DROP_BOUND | \
DROP_RETIRE | \
DROP_ACTIVE | \
- DROP_FREED)
+ DROP_FREED | \
+ DROP_SHRINK_ALL)
static int
i915_drop_caches_get(void *data, u64 *val)
{
@@ -4276,6 +4278,9 @@ i915_drop_caches_set(void *data, u64 val)
if (val & DROP_UNBOUND)
i915_gem_shrink(dev_priv, LONG_MAX, I915_SHRINK_UNBOUND);
+ if (val & DROP_SHRINK_ALL)
+ i915_gem_shrink_all(dev_priv);
+
unlock:
mutex_unlock(&dev->struct_mutex);
OpenPOWER on IntegriCloud