summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>2018-09-27 21:19:25 -0700
committerDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>2018-09-28 13:21:01 -0700
commitb91b915cf75311ddec2c41e4592ab7bf1badb272 (patch)
tree6eec9161e739f753aeabbbfd1e5ce17ecf299e4e
parentbdc8989328f57ec2e63a88c89a45440567c69eeb (diff)
tests/psr: Wait for PSR exit
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 <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
-rw-r--r--lib/igt_psr.c7
-rw-r--r--lib/igt_psr.h2
-rw-r--r--tests/kms_frontbuffer_tracking.c3
-rw-r--r--tests/kms_psr.c2
4 files changed, 9 insertions, 5 deletions
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 <errno.h>
-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,
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index 7c846afb..b9693822 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -29,7 +29,7 @@
#include "igt_aux.h"
bool psr_wait_entry(int debugfs_fd);
-bool psr_active(int debugfs_fd, bool check_active);
+bool psr_wait_exit(int debugfs_fd);
bool psr_enable(int debugfs_fd);
bool psr_disable(int debugfs_fd);
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 265c313a..356e5b6d 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1634,8 +1634,7 @@ static void do_status_assertions(int flags)
igt_assert_f(psr_wait_entry(drm.debugfs),
"PSR still disabled\n");
else if (flags & ASSERT_PSR_DISABLED)
- igt_assert_f(psr_active(drm.debugfs, false),
- "PSR still enabled\n");
+ igt_assert_f(psr_wait_exit(drm.debugfs), "PSR still enabled\n");
}
static void __do_assertions(const struct test_mode *t, int flags,
diff --git a/tests/kms_psr.c b/tests/kms_psr.c
index fcc04770..ebd64d46 100644
--- a/tests/kms_psr.c
+++ b/tests/kms_psr.c
@@ -294,7 +294,7 @@ static void run_test(data_t *data)
expected = "screen GREEN";
break;
}
- igt_assert(psr_active(data->debugfs_fd, false));
+ igt_assert(psr_wait_exit(data->debugfs_fd));
manual(expected);
}