[Intel-gfx] [PATCH igt 16/28] lib/crc: Add a helper to read a single CRC value
Damien Lespiau
damien.lespiau at intel.com
Fri Feb 7 15:49:00 CET 2014
In this case, we also take care of starting/stopping the CRC collection.
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
lib/igt_debugfs.c | 14 ++++++++++++++
lib/igt_debugfs.h | 1 +
2 files changed, 15 insertions(+)
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index a0d84bf..4a4a4dd 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -342,6 +342,20 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
}
/*
+ * Read 1 CRC from @pipe_crc. This function blocks until the CRC is retrieved.
+ * @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.
+ */
+void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
+{
+ igt_pipe_crc_start(pipe_crc);
+ read_one_crc(pipe_crc, out_crc);
+ igt_pipe_crc_stop(pipe_crc);
+}
+
+/*
* Drop caches
*/
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 075e446..6b7e623 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -79,6 +79,7 @@ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
igt_crc_t **out_crcs);
+void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
/*
* Drop caches
--
1.8.3.1
More information about the Intel-gfx
mailing list