summaryrefslogtreecommitdiff
path: root/tests/chamelium.c
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@linux.intel.com>2017-07-04 16:33:19 +0300
committerLyude <lyude@redhat.com>2017-07-06 11:55:53 -0400
commitebd6eb69f57b0f36a4bf9978b5c47ba4be86d261 (patch)
treebf6f229ff0e8e0b149c3fc929d0f7ca79080a6ba /tests/chamelium.c
parent80aa69fd675bce77dda751e5e5c5d651e9f08e1e (diff)
Make igtrc configuration common, with configurable suspend/resume delay
This adds support for configurable suspend/resume delay and takes the occasion to move igtrc configuation from igt_chamelium to igt_core. This way, suspend/resume delay configuration can be used for all tests. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'tests/chamelium.c')
-rw-r--r--tests/chamelium.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/chamelium.c b/tests/chamelium.c
index 0da010ab..e26f0557 100644
--- a/tests/chamelium.c
+++ b/tests/chamelium.c
@@ -42,7 +42,6 @@ typedef struct {
} data_t;
#define HOTPLUG_TIMEOUT 20 /* seconds */
-#define SUSPEND_RESUME_DELAY 20 /* seconds */
#define HPD_STORM_PULSE_INTERVAL_DP 100 /* ms */
#define HPD_STORM_PULSE_INTERVAL_HDMI 200 /* ms */
@@ -223,21 +222,21 @@ try_suspend_resume_hpd(data_t *data, struct chamelium_port *port,
enum igt_suspend_state state, enum igt_suspend_test test,
struct udev_monitor *mon, bool connected)
{
+ int delay;
int p;
- igt_set_autoresume_delay(SUSPEND_RESUME_DELAY);
igt_flush_hotplugs(mon);
+ delay = igt_get_autoresume_delay(state) * 1000 / 2;
+
if (port) {
- chamelium_schedule_hpd_toggle(data->chamelium, port,
- SUSPEND_RESUME_DELAY * 1000 / 2,
+ chamelium_schedule_hpd_toggle(data->chamelium, port, delay,
!connected);
} else {
for (p = 0; p < data->port_count; p++) {
port = data->ports[p];
chamelium_schedule_hpd_toggle(data->chamelium, port,
- SUSPEND_RESUME_DELAY * 1000 / 2,
- !connected);
+ delay, !connected);
}
port = NULL;