summaryrefslogtreecommitdiff
path: root/lib/igt_debugfs.c
diff options
context:
space:
mode:
authorMika Kahola <mika.kahola@intel.com>2019-01-14 14:14:39 +0200
committerMika Kahola <mika.kahola@intel.com>2019-01-18 09:41:19 +0200
commit0c80bd7f2a964605f307e0220c6bb756685582b9 (patch)
tree23e1725d0aeac15272f3ef6815a4369060cb6394 /lib/igt_debugfs.c
parent8614d5eb114a660c3bd7ff77eab8bed53424cd30 (diff)
lib/igt_debugfs: Unify crc collection
For one shot crc collection, let's use the same helper function as we use for continuous crc collection. With this patch, we first drain the pipe from queued crc values and read the fresh crc. v2: We don't need to drain the pipe right after we start collecting crc's (Dhinakaran) Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'lib/igt_debugfs.c')
-rw-r--r--lib/igt_debugfs.c58
1 files changed, 28 insertions, 30 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index a3aca846..13f4f1c1 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -902,36 +902,6 @@ static void crc_sanity_checks(igt_crc_t *crc)
}
/**
- * igt_pipe_crc_collect_crc:
- * @pipe_crc: pipe CRC object
- * @out_crc: buffer for the captured CRC values
- *
- * Read a single CRC from @pipe_crc. This function blocks until the CRC is
- * retrieved, irrespective of whether @pipe_crc has been opened with
- * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock(). @out_crc must be
- * allocated by the caller.
- *
- * This function takes care of the pipe_crc book-keeping, it will start/stop
- * the collection of the CRC.
- *
- * This function also calls the interactive debug with the "crc" domain, so you
- * can make use of this feature to actually see the screen that is being CRC'd.
- *
- * For continuous CRC collection look at igt_pipe_crc_start(),
- * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
- */
-void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
-{
- igt_debug_wait_for_keypress("crc");
-
- igt_pipe_crc_start(pipe_crc);
- read_one_crc(pipe_crc, out_crc);
- igt_pipe_crc_stop(pipe_crc);
-
- crc_sanity_checks(out_crc);
-}
-
-/**
* igt_pipe_crc_drain:
* @pipe_crc: pipe CRC object
*
@@ -1004,6 +974,34 @@ igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
crc_sanity_checks(crc);
}
+/**
+ * igt_pipe_crc_collect_crc:
+ * @pipe_crc: pipe CRC object
+ * @out_crc: buffer for the captured CRC values
+ *
+ * Read a single CRC from @pipe_crc. This function blocks until the CRC is
+ * retrieved, irrespective of whether @pipe_crc has been opened with
+ * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock(). @out_crc must be
+ * allocated by the caller.
+ *
+ * This function takes care of the pipe_crc book-keeping, it will start/stop
+ * the collection of the CRC.
+ *
+ * This function also calls the interactive debug with the "crc" domain, so you
+ * can make use of this feature to actually see the screen that is being CRC'd.
+ *
+ * For continuous CRC collection look at igt_pipe_crc_start(),
+ * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
+ */
+void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
+{
+ igt_debug_wait_for_keypress("crc");
+
+ igt_pipe_crc_start(pipe_crc);
+ igt_pipe_crc_get_single(pipe_crc, out_crc);
+ igt_pipe_crc_stop(pipe_crc);
+}
+
/*
* Drop caches
*/