[PATCH 33/74] drm/i915: Expose a wakeref debugfs to disable (i915) runtime pm

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 14 17:34:07 UTC 2017


Some igt do nothing more active than peek at buffers through a gtt mmap.
The pagefault into the GTT wakes the device up, but it will promptly
autosuspend and zap the GTT mmap, forcing the cycle to repeat
continuously. This makes those tests much, much slower than expected as
every GTT access becomes a page-fault (and that is magnified by the
slow devices also being unable to use WC updates of the GTT).

Whilst real userspace may fall into the same trap, we hold wakerefs
while rendering and while the display is active so all in likelihood the
device will be kept awake by activity during the access; and we strongly
discourage userspace from using GTT for performance reasons anyway. So
hopefully there is no pressing issue that requires a proper fix, and not
just an opt-out for igt!

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

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 84d2dc02e762..96a625cc961a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4762,6 +4762,24 @@ static int i915_sseu_status(struct seq_file *m, void *unused)
 	return 0;
 }
 
+static int i915_wakeref_open(struct inode *inode, struct file *file)
+{
+	intel_runtime_pm_get(inode->i_private);
+	return 0;
+}
+
+static int i915_wakeref_release(struct inode *inode, struct file *file)
+{
+	intel_runtime_pm_put(inode->i_private);
+	return 0;
+}
+
+static const struct file_operations i915_wakeref_fops = {
+	.owner = THIS_MODULE,
+	.open = i915_wakeref_open,
+	.release = i915_wakeref_release,
+};
+
 static int i915_forcewake_open(struct inode *inode, struct file *file)
 {
 	struct drm_i915_private *i915 = inode->i_private;
@@ -4959,6 +4977,12 @@ int i915_debugfs_register(struct drm_i915_private *dev_priv)
 	struct dentry *ent;
 	int ret, i;
 
+	ent = debugfs_create_file("i915_wakeref_user", S_IRUSR,
+				  minor->debugfs_root, to_i915(minor->dev),
+				  &i915_wakeref_fops);
+	if (!ent)
+		return -ENOMEM;
+
 	ent = debugfs_create_file("i915_forcewake_user", S_IRUSR,
 				  minor->debugfs_root, to_i915(minor->dev),
 				  &i915_forcewake_fops);
-- 
2.14.1



More information about the Intel-gfx-trybot mailing list