From b91b915cf75311ddec2c41e4592ab7bf1badb272 Mon Sep 17 00:00:00 2001 From: Dhinakaran Pandiyan Date: Thu, 27 Sep 2018 21:19:25 -0700 Subject: tests/psr: Wait for PSR exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PSR appears to not exit immediately after the test commits a page flip, give some leeway for PSR to idle. Let's set the timeout at 40 ms with a 5 ms interval between each status read. Signed-off-by: Dhinakaran Pandiyan Reviewed-by: José Roberto de Souza --- lib/igt_psr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/igt_psr.c') diff --git a/lib/igt_psr.c b/lib/igt_psr.c index c2bae95b..355fe627 100644 --- a/lib/igt_psr.c +++ b/lib/igt_psr.c @@ -25,7 +25,7 @@ #include "igt_sysfs.h" #include -bool psr_active(int debugfs_fd, bool check_active) +static bool psr_active(int debugfs_fd, bool check_active) { bool active; char buf[512]; @@ -42,6 +42,11 @@ bool psr_wait_entry(int debugfs_fd) return igt_wait(psr_active(debugfs_fd, true), 500, 1); } +bool psr_wait_exit(int debugfs_fd) +{ + return igt_wait(psr_active(debugfs_fd, false), 40, 10); +} + static ssize_t psr_write(int debugfs_fd, const char *buf) { return igt_sysfs_write(debugfs_fd, "i915_edp_psr_debug", buf, -- cgit v1.2.3