[Intel-gfx] [PATCH] drm/i915: Stop CRC gathering when the ctl file is closed

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Mon Oct 21 18:01:07 CEST 2013


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

If no one is looking at the CRCs, stop gathering them.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index eb61c4b..e7470b8 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2294,12 +2294,25 @@ out:
 	return len;
 }
 
+static int display_crc_ctl_release(struct inode *inode, struct file *file)
+{
+	struct seq_file *m = file->private_data;
+	struct drm_device *dev = m->private;
+	enum pipe pipe;
+
+	/* stop gathering CRCs */
+	for_each_pipe(pipe)
+		pipe_crc_set_source(dev, pipe, INTEL_PIPE_CRC_SOURCE_NONE);
+
+	return single_release(inode, file);
+}
+
 static const struct file_operations i915_display_crc_ctl_fops = {
 	.owner = THIS_MODULE,
 	.open = display_crc_ctl_open,
 	.read = seq_read,
 	.llseek = seq_lseek,
-	.release = single_release,
+	.release = display_crc_ctl_release,
 	.write = display_crc_ctl_write
 };
 
-- 
1.8.1.5




More information about the Intel-gfx mailing list