public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Stop CRC gathering when the ctl file is closed
@ 2013-10-21 16:01 ville.syrjala
  2013-10-21 16:17 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: ville.syrjala @ 2013-10-21 16:01 UTC (permalink / raw)
  To: intel-gfx

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

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

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

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-21 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 16:01 [PATCH] drm/i915: Stop CRC gathering when the ctl file is closed ville.syrjala
2013-10-21 16:17 ` Daniel Vetter
2013-10-21 16:32   ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox