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

* Re: [PATCH] drm/i915: Stop CRC gathering when the ctl file is closed
  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ä
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2013-10-21 16:17 UTC (permalink / raw)
  To: Syrjala, Ville; +Cc: intel-gfx

On Mon, Oct 21, 2013 at 6:01 PM,  <ville.syrjala@linux.intel.com> wrote:
> 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>

As discussed on irc this prevents fools like me from wreaking havoc
directly with the cli, at least if you still want to interactively
test stuff easily (background processes and all would work around
this). Imo it's better to disable (and maybe re-enable) the CRC stuff
when we disable/enable the pipe.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH] drm/i915: Stop CRC gathering when the ctl file is closed
  2013-10-21 16:17 ` Daniel Vetter
@ 2013-10-21 16:32   ` Ville Syrjälä
  0 siblings, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2013-10-21 16:32 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Mon, Oct 21, 2013 at 06:17:30PM +0200, Daniel Vetter wrote:
> On Mon, Oct 21, 2013 at 6:01 PM,  <ville.syrjala@linux.intel.com> wrote:
> > 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>
> 
> As discussed on irc this prevents fools like me from wreaking havoc
> directly with the cli, at least if you still want to interactively
> test stuff easily (background processes and all would work around
> this). Imo it's better to disable (and maybe re-enable) the CRC stuff
> when we disable/enable the pipe.

I would still suggest using exec for keeping the file open.

Especially if we go for the auto re-enable, since then we'd
essientially never turn off the crc capture once it's started
unless someone explicitly writes to the ctl file. We'd just pause
it while the pipe is off.

Also I would assume we want to avoid full modesets in the future
if possible, so relying on that doesn't feel very robust to me.

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[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