summaryrefslogtreecommitdiff
path: root/lib/igt_debugfs.h
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-10-09 11:47:43 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2013-10-15 19:40:07 +0100
commit4ba97ddf96136d463e5b584fe997d6de698c0a74 (patch)
tree2a680d029c97450bb4b952d1f002a06cd4ddcfa3 /lib/igt_debugfs.h
parentf673775fe8a7d9faeaa80f4af9677fecf16e4b17 (diff)
debugfs_pipe_crc: Let's check CRCs!
Let's add a new test that sets a mode, wait for a few vblanks (3) and then make sure we read 3 identical CRCs. Some subtests check for various parsing errors. In the process, improve the debugfs helpers to deal with CRCs. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib/igt_debugfs.h')
-rw-r--r--lib/igt_debugfs.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 1ae6bbdf..7c280e74 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -25,8 +25,12 @@
#ifndef __IGT_DEBUGFS_H__
#define __IGT_DEBUGFS_H__
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
+#include "igt_display.h"
+
typedef struct {
char root[128];
char dri_path[128];
@@ -37,4 +41,37 @@ int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename, int mode);
FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
const char *mode);
+/*
+ * Pipe CRC
+ */
+
+enum intel_pipe_crc_source {
+ INTEL_PIPE_CRC_SOURCE_NONE,
+ INTEL_PIPE_CRC_SOURCE_PLANE1,
+ INTEL_PIPE_CRC_SOURCE_PLANE2,
+ INTEL_PIPE_CRC_SOURCE_PF,
+ INTEL_PIPE_CRC_SOURCE_MAX,
+};
+
+typedef struct _igt_pipe_crc igt_pipe_crc_t;
+typedef struct {
+ uint32_t frame;
+ int n_words;
+ uint32_t crc[5];
+} igt_crc_t;
+
+bool igt_crc_is_null(igt_crc_t *crc);
+bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b);
+char *igt_crc_to_string(igt_crc_t *crc);
+
+igt_pipe_crc_t *
+igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
+ enum intel_pipe_crc_source source);
+void igt_pipe_crc_reset(void);
+void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
+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);
+
#endif /* __IGT_DEBUGFS_H__ */