From: Juha-Pekka Heikkila via igt-dev <igt-dev@lists.freedesktop.org>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/2] HACK lib/igt_debugfs: add igt_pipe_crc_get_current_with_reference
Date: Thu, 14 Feb 2019 15:57:12 +0200 [thread overview]
Message-ID: <1550152633-31291-1-git-send-email-juhapekka.heikkila@gmail.com> (raw)
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
next reply other threads:[~2019-02-14 13:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 13:57 Juha-Pekka Heikkila via igt-dev [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1550152633-31291-1-git-send-email-juhapekka.heikkila@gmail.com \
--to=igt-dev@lists.freedesktop.org \
--cc=juhapekka.heikkila@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox