summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
authorPaul Kocialkowki <paul.kocialkowski@linux.intel.com>2017-06-27 13:53:05 +0300
committerLyude <lyude@redhat.com>2017-06-27 16:52:45 -0400
commitd1b08a89edeab5df3c1ca10cb74a5b527fee84d3 (patch)
treefc2a62983158dcd44a08d299286326be9fc2b7e9 /lib/igt_aux.c
parent8d300218439724551873b5ab46b270ecc17f290d (diff)
lib/igt_aux: Use provided autoresume delay for rtc wake
This stores the autoresume delay provided via igt_set_autoresume_delay for use during suspend via rtc wake scheduling. This delay was previously only used for pm_test suspendm while the function suggests it should be applied to all autoresume cases. There is also definitely a use case for configuring the rtc wake delay, so this implements it. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index eb563f72..882dba06 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -680,6 +680,8 @@ void igt_cleanup_aperture_trashers(void)
free(trash_bos);
}
+static int autoresume_delay;
+
static const char *suspend_state_name[] = {
[SUSPEND_STATE_FREEZE] = "freeze",
[SUSPEND_STATE_STANDBY] = "standby",
@@ -746,7 +748,10 @@ static void suspend_via_rtcwake(enum igt_suspend_state state)
igt_assert(state < SUSPEND_STATE_NUM);
- delay = state == SUSPEND_STATE_DISK ? 30 : 15;
+ if (autoresume_delay)
+ delay = autoresume_delay;
+ else
+ delay = state == SUSPEND_STATE_DISK ? 30 : 15;
/*
* Skip if rtcwake would fail for a reason not related to the kernel's
@@ -889,6 +894,8 @@ void igt_set_autoresume_delay(int delay_secs)
igt_require(write(delay_fd, delay_str, strlen(delay_str)));
close(delay_fd);
+
+ autoresume_delay = delay_secs;
}
/**