* [PATCH igt] lib/igt_aux: Improve documentation for igt_system_suspend_autoresume()
@ 2016-10-14 14:51 Imre Deak
2016-10-17 14:14 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Imre Deak @ 2016-10-14 14:51 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
While at it fix the order of states for consistency.
Suggested by Daniel.
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
lib/igt_aux.c | 21 ++++++++++++++++-----
lib/igt_aux.h | 36 +++++++++++++++++++++++++++++++++++-
2 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index f225c2f..421f6d4 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -628,8 +628,8 @@ void igt_cleanup_aperture_trashers(void)
static const char *suspend_state_name[] = {
[SUSPEND_STATE_FREEZE] = "freeze",
- [SUSPEND_STATE_MEM] = "mem",
[SUSPEND_STATE_STANDBY] = "standby",
+ [SUSPEND_STATE_MEM] = "mem",
[SUSPEND_STATE_DISK] = "disk",
};
@@ -744,11 +744,22 @@ static uint32_t get_supported_suspend_states(int power_dir)
/**
* igt_system_suspend_autoresume:
+ * @state: an #igt_suspend_state, the target suspend state
+ * @test: an #igt_suspend_test, test point at which to complete the suspend
+ * cycle
*
- * Execute a system suspend (to idle, memory, disk) cycle optionally
- * completing the cycle at a given test point and automaically wake up again.
- * Waking up is either achieved using the RTC wake-up alarm for a full suspend
- * cycle or a kernel timer for a suspend test cycle.
+ * Execute a system suspend cycle targeting the given @state optionally
+ * completing the cycle at the given @test point and automaically wake up
+ * again. Waking up is either achieved using the RTC wake-up alarm for a full
+ * suspend cycle or a kernel timer for a suspend test cycle. The kernel timer
+ * delay for a test cycle can be configured by the suspend.pm_test_delay
+ * kernel parameter (5 sec by default).
+ *
+ * #SUSPEND_TEST_NONE specifies a full suspend cycle.
+ * The #SUSPEND_TEST_FREEZER..#SUSPEND_TEST_CORE test points can make it
+ * possible to collect error logs in case a full suspend cycle would prevent
+ * this by hanging the machine, or they can provide an idea of the faulty
+ * component by comparing fail/no-fail results at different test points.
*
* This is very handy for implementing any kind of suspend/resume test.
*/
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 39fd8ea..d30196b 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -116,15 +116,48 @@ void igt_cleanup_aperture_trashers(void);
/* suspend/hibernate and auto-resume system */
+/**
+ * igt_suspend_state:
+ * @SUSPEND_STATE_FREEZE: suspend-to-idle target state, aka S0ix or freeze,
+ * first non-hibernation state
+ * @SUSPEND_STATE_STANDBY: standby target state, aka S1, second
+ * non-hibernation state
+ * @SUSPEND_STATE_MEM: suspend-to-mem target state aka S3, third
+ * non-hibernation state
+ * @SUSPEND_STATE_DISK: suspend-to-disk target state, aka S4 or hibernation
+ *
+ * Target suspend states used with igt_system_suspend_autoresume().
+ * See /sys/power/state for the available states on a given machine.
+ */
enum igt_suspend_state {
SUSPEND_STATE_FREEZE,
- SUSPEND_STATE_MEM,
SUSPEND_STATE_STANDBY,
+ SUSPEND_STATE_MEM,
SUSPEND_STATE_DISK,
+ /*< private >*/
SUSPEND_STATE_NUM,
};
+/**
+ * igt_suspend_test:
+ * @SUSPEND_TEST_NONE: no testing, perform a full suspend/resume cycle
+ * @SUSPEND_TEST_FREEZER: complete cycle after freezing all freezable threads
+ * @SUSPEND_TEST_DEVICES: complete cycle after the above step and suspending
+ * devices (before calling the drivers' suspend late and
+ * no_irq hooks). Platform and system devices are not
+ * suspended here, see #SUSPEND_TEST_CORE.
+ * @SUSPEND_TEST_PLATFORM: complete cycle after all the above steps and calling
+ * the ACPI platform global control methods (applies
+ * only with /sys/power/disk set to platform)
+ * @SUSPEND_TEST_PROCESSORS: complete cycle after all the above steps and
+ * disabling non-boot CPUs
+ * @SUSPEND_TEST_CORE: complete cycle after all the above steps and suspending
+ * platform and system devices
+ *
+ * Test points used with igt_system_suspend_autoresume(). Specifies if and where
+ * the suspend sequence is to be terminated.
+ */
enum igt_suspend_test {
SUSPEND_TEST_NONE,
SUSPEND_TEST_FREEZER,
@@ -133,6 +166,7 @@ enum igt_suspend_test {
SUSPEND_TEST_PROCESSORS,
SUSPEND_TEST_CORE,
+ /*< private >*/
SUSPEND_TEST_NUM,
};
--
2.5.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH igt] lib/igt_aux: Improve documentation for igt_system_suspend_autoresume()
2016-10-14 14:51 [PATCH igt] lib/igt_aux: Improve documentation for igt_system_suspend_autoresume() Imre Deak
@ 2016-10-17 14:14 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2016-10-17 14:14 UTC (permalink / raw)
To: Imre Deak; +Cc: Daniel Vetter, intel-gfx
On Fri, Oct 14, 2016 at 05:51:14PM +0300, Imre Deak wrote:
> While at it fix the order of states for consistency.
>
> Suggested by Daniel.
>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Going ocd with docs makes me really happy \o/ And I think it does help
for new folks to get started in our dragon dungeon of a driver. Thanks for doing this.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> lib/igt_aux.c | 21 ++++++++++++++++-----
> lib/igt_aux.h | 36 +++++++++++++++++++++++++++++++++++-
> 2 files changed, 51 insertions(+), 6 deletions(-)
>
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index f225c2f..421f6d4 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -628,8 +628,8 @@ void igt_cleanup_aperture_trashers(void)
>
> static const char *suspend_state_name[] = {
> [SUSPEND_STATE_FREEZE] = "freeze",
> - [SUSPEND_STATE_MEM] = "mem",
> [SUSPEND_STATE_STANDBY] = "standby",
> + [SUSPEND_STATE_MEM] = "mem",
> [SUSPEND_STATE_DISK] = "disk",
> };
>
> @@ -744,11 +744,22 @@ static uint32_t get_supported_suspend_states(int power_dir)
>
> /**
> * igt_system_suspend_autoresume:
> + * @state: an #igt_suspend_state, the target suspend state
> + * @test: an #igt_suspend_test, test point at which to complete the suspend
> + * cycle
> *
> - * Execute a system suspend (to idle, memory, disk) cycle optionally
> - * completing the cycle at a given test point and automaically wake up again.
> - * Waking up is either achieved using the RTC wake-up alarm for a full suspend
> - * cycle or a kernel timer for a suspend test cycle.
> + * Execute a system suspend cycle targeting the given @state optionally
> + * completing the cycle at the given @test point and automaically wake up
> + * again. Waking up is either achieved using the RTC wake-up alarm for a full
> + * suspend cycle or a kernel timer for a suspend test cycle. The kernel timer
> + * delay for a test cycle can be configured by the suspend.pm_test_delay
> + * kernel parameter (5 sec by default).
> + *
> + * #SUSPEND_TEST_NONE specifies a full suspend cycle.
> + * The #SUSPEND_TEST_FREEZER..#SUSPEND_TEST_CORE test points can make it
> + * possible to collect error logs in case a full suspend cycle would prevent
> + * this by hanging the machine, or they can provide an idea of the faulty
> + * component by comparing fail/no-fail results at different test points.
> *
> * This is very handy for implementing any kind of suspend/resume test.
> */
> diff --git a/lib/igt_aux.h b/lib/igt_aux.h
> index 39fd8ea..d30196b 100644
> --- a/lib/igt_aux.h
> +++ b/lib/igt_aux.h
> @@ -116,15 +116,48 @@ void igt_cleanup_aperture_trashers(void);
>
> /* suspend/hibernate and auto-resume system */
>
> +/**
> + * igt_suspend_state:
> + * @SUSPEND_STATE_FREEZE: suspend-to-idle target state, aka S0ix or freeze,
> + * first non-hibernation state
> + * @SUSPEND_STATE_STANDBY: standby target state, aka S1, second
> + * non-hibernation state
> + * @SUSPEND_STATE_MEM: suspend-to-mem target state aka S3, third
> + * non-hibernation state
> + * @SUSPEND_STATE_DISK: suspend-to-disk target state, aka S4 or hibernation
> + *
> + * Target suspend states used with igt_system_suspend_autoresume().
> + * See /sys/power/state for the available states on a given machine.
> + */
> enum igt_suspend_state {
> SUSPEND_STATE_FREEZE,
> - SUSPEND_STATE_MEM,
> SUSPEND_STATE_STANDBY,
> + SUSPEND_STATE_MEM,
> SUSPEND_STATE_DISK,
>
> + /*< private >*/
> SUSPEND_STATE_NUM,
> };
>
> +/**
> + * igt_suspend_test:
> + * @SUSPEND_TEST_NONE: no testing, perform a full suspend/resume cycle
> + * @SUSPEND_TEST_FREEZER: complete cycle after freezing all freezable threads
> + * @SUSPEND_TEST_DEVICES: complete cycle after the above step and suspending
> + * devices (before calling the drivers' suspend late and
> + * no_irq hooks). Platform and system devices are not
> + * suspended here, see #SUSPEND_TEST_CORE.
> + * @SUSPEND_TEST_PLATFORM: complete cycle after all the above steps and calling
> + * the ACPI platform global control methods (applies
> + * only with /sys/power/disk set to platform)
> + * @SUSPEND_TEST_PROCESSORS: complete cycle after all the above steps and
> + * disabling non-boot CPUs
> + * @SUSPEND_TEST_CORE: complete cycle after all the above steps and suspending
> + * platform and system devices
> + *
> + * Test points used with igt_system_suspend_autoresume(). Specifies if and where
> + * the suspend sequence is to be terminated.
> + */
> enum igt_suspend_test {
> SUSPEND_TEST_NONE,
> SUSPEND_TEST_FREEZER,
> @@ -133,6 +166,7 @@ enum igt_suspend_test {
> SUSPEND_TEST_PROCESSORS,
> SUSPEND_TEST_CORE,
>
> + /*< private >*/
> SUSPEND_TEST_NUM,
> };
>
> --
> 2.5.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-17 14:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 14:51 [PATCH igt] lib/igt_aux: Improve documentation for igt_system_suspend_autoresume() Imre Deak
2016-10-17 14:14 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.