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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

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

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux