public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] HACK lib/igt_debugfs: add igt_pipe_crc_get_current_with_reference
@ 2019-02-14 13:57 Juha-Pekka Heikkila via igt-dev
  2019-02-14 13:57 ` [igt-dev] [PATCH i-g-t 2/2] HACK tests/kms_rotation_crc: use igt_pipe_crc_get_current_with_reference() Juha-Pekka Heikkila via igt-dev
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Juha-Pekka Heikkila via igt-dev @ 2019-02-14 13:57 UTC (permalink / raw)
  To: igt-dev

igt_pipe_crc_get_current_with_reference will get current crc
and compare it to reference crc. 'current' is returned out
from function but if current didn't match to reference
five following crc's are checked if they'd match and printed
as info.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 lib/igt_debugfs.c | 28 ++++++++++++++++++++++++++++
 lib/igt_debugfs.h |  1 +
 2 files changed, 29 insertions(+)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 6cfaa97..1245274 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -1002,6 +1002,34 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
 	igt_pipe_crc_stop(pipe_crc);
 }
 
+/**
+ * igt_pipe_crc_get_current_with_reference:
+ * @drm_fd: Pointer to drm fd for vblank counter
+ * @pipe_crc: pipe CRC object
+ * @crc: buffer pointer for the captured CRC value
+ *
+ * Same as igt_pipe_crc_get_current(), but if current crc doesn't
+ * match to reference see if within 5 next crc there will come match.
+ */
+void
+igt_pipe_crc_get_current_with_reference(int drm_fd, igt_pipe_crc_t *pipe_crc,
+					igt_crc_t *crc, igt_crc_t *reference)
+{
+	igt_crc_t following_crc;
+	int i;
+
+	igt_pipe_crc_get_current(drm_fd, pipe_crc, crc);
+	if (reference != NULL && !igt_check_crc_equal(crc, reference)) {
+		for (i = 0; i < 5; i++) {
+			igt_pipe_crc_get_single(pipe_crc, &following_crc);
+			if (igt_check_crc_equal(crc, reference)) {
+				igt_info("current crc didn't match to reference but %d frame after crc did match!", i+1);
+				break;
+			}
+		}
+	}
+}
+
 /*
  * Drop caches
  */
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 1233cd8..b293f51 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -137,6 +137,7 @@ void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
 void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc);
 
 void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
+void igt_pipe_crc_get_current_with_reference(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc, igt_crc_t *reference);
 
 void igt_hpd_storm_set_threshold(int fd, unsigned int threshold);
 void igt_hpd_storm_reset(int fd);
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-02-15  7:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-14 13:57 [igt-dev] [PATCH i-g-t 1/2] HACK lib/igt_debugfs: add igt_pipe_crc_get_current_with_reference Juha-Pekka Heikkila via igt-dev
2019-02-14 13:57 ` [igt-dev] [PATCH i-g-t 2/2] HACK tests/kms_rotation_crc: use igt_pipe_crc_get_current_with_reference() Juha-Pekka Heikkila via igt-dev
2019-02-14 14:19 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] HACK lib/igt_debugfs: add igt_pipe_crc_get_current_with_reference Patchwork
2019-02-14 19:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-14 22:10 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] HACK lib/igt_debugfs: add igt_pipe_crc_get_current_with_reference (rev2) Patchwork
2019-02-15  7:55 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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