From: Mahesh Kumar <mahesh1.kumar@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3] lib/igt_debugfs: explicitly wait for first crc in igt_pipe_crc_start
Date: Mon, 13 Aug 2018 19:23:18 +0530 [thread overview]
Message-ID: <20180813135318.15702-1-mahesh1.kumar@intel.com> (raw)
In-Reply-To: <20180813125801.19053-1-mahesh1.kumar@intel.com>
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
until first crc available 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.
Changes Since V1:
- poll instead of read_one_crc (Maarten)
Changes Since V2:
- poll without timeout, we already have igt_timeout (Maarten)
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
---
lib/igt_debugfs.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index f3196f43..4de6b247 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -35,6 +35,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <i915_drm.h>
+#include <poll.h>
#include "drmtest.h"
#include "igt_aux.h"
@@ -748,6 +749,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);
+ struct pollfd pfd;
char buf[32];
/* Stop first just to make sure we don't have lingering state left. */
@@ -757,11 +759,16 @@ 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 poll for first CRC.");
pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
+ igt_assert(pipe_crc->crc_fd != -1);
+
+ pfd.fd = pipe_crc->crc_fd;
+ pfd.events = POLLIN;
+ poll(&pfd, 1, -1);
+
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
next prev parent reply other threads:[~2018-08-13 13:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Mahesh Kumar [this message]
2018-08-13 14:14 ` [igt-dev] [PATCH i-g-t v3] " 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
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=20180813135318.15702-1-mahesh1.kumar@intel.com \
--to=mahesh1.kumar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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;
as well as URLs for NNTP newsgroup(s).