igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_debugfs: explicitly wait for first crc in igt_pipe_crc_start
@ 2018-08-08 13:17 Mahesh Kumar
  2018-08-08 13:45 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Mahesh Kumar @ 2018-08-08 13:17 UTC (permalink / raw)
  To: igt-dev

Now crc framework does not wait for first CRC during open, User need
to wait for crc if he wants so.
This patch make changes in igt_pipe_crc_start to make sure we wait
for first crc after open to keep the tests behaviour same.
Without this if driver is skipping few initial crcs there will be
mismatch in expected and actual number of crcs returned by crc
framework.

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
---
 lib/igt_debugfs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index f3196f43..f4c388bf 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -748,6 +748,7 @@ static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
 void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
 {
 	const char *src = pipe_crc_source_name(pipe_crc->source);
+	igt_crc_t first_crc;
 	char buf[32];
 
 	/* Stop first just to make sure we don't have lingering state left. */
@@ -757,11 +758,13 @@ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
 
 	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
-	igt_set_timeout(10, "Opening crc fd, which waits for first CRC.");
+	igt_set_timeout(10, "Opening crc fd, and wait for first CRC.");
 	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
+	igt_assert(pipe_crc->crc_fd != -1);
+	read_one_crc(pipe_crc, &first_crc);
+
 	igt_reset_timeout();
 
-	igt_assert(pipe_crc->crc_fd != -1);
 	errno = 0;
 }
 
-- 
2.16.2

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

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

end of thread, other threads:[~2018-08-13 17:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-08 13:17 [igt-dev] [PATCH i-g-t] lib/igt_debugfs: explicitly wait for first crc in igt_pipe_crc_start Mahesh Kumar
2018-08-08 13:45 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-08-08 14:04 ` [igt-dev] [PATCH i-g-t] " Maarten Lankhorst
2018-08-08 15:20   ` Kumar, Mahesh
2018-08-08 18:53 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
2018-08-13 12:58 ` [igt-dev] [PATCH i-g-t v2] " Mahesh Kumar
2018-08-13 13:38   ` Maarten Lankhorst
2018-08-13 13:53   ` [igt-dev] [PATCH i-g-t v3] " Mahesh Kumar
2018-08-13 14:14     ` Maarten Lankhorst
2018-08-13 14:52 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_debugfs: explicitly wait for first crc in igt_pipe_crc_start (rev3) Patchwork
2018-08-13 17:44 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).