From ebd6eb69f57b0f36a4bf9978b5c47ba4be86d261 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Tue, 4 Jul 2017 16:33:19 +0300 Subject: 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 Reviewed-by: Lyude Paul --- tests/Makefile.am | 4 ++-- tests/chamelium.c | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index b051364c..f9d11e6c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -72,9 +72,9 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) -Wno-unused-result $(DEBUG_CFLAGS)\ $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \ $(NULL) -LDADD = ../lib/libintel_tools.la $(GLIB_LIBS) $(XMLRPC_LIBS) +LDADD = ../lib/libintel_tools.la $(XMLRPC_LIBS) -AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS) +AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) AM_LDFLAGS = -Wl,--as-needed drm_import_export_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) 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; -- cgit v1.2.3