Hibernation test
intel-gpu-tools currently has a bunch of tests for suspend, but currently none (that I could find) for hibernate.
Attached is a rudimentary patch to add said test. It does so by repurposing the drv_suspend driver to handle both suspend and hibernate, since the difference is miniscule.
I decided to split the suspend/autoresume functions in igt_aux.c though, to be able to leave the igt_system_uspend_autoresume() function unchanged (the other option would be to
introduce a boolean function argument and have that
decide what parameters to pass to rtcwake).
The timeout passed to rtcwake probably needs tuning (it might even need to be dynamically adjusted, since the time hibernation takes varies wildly depending on the amount of non-cache memory in use).
Kind regards, David Weinehall
PS: Go easy on me, mkay -- first patch to intel-gfx :P (meh, who am I kidding,
I should be flame tolerant enough, bring it on).
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
lib/igt_aux.c +30 -2
@@ -1,5 +1,5 @@/* -* Copyright © 2007, 2011, 2013, 2014 Intel Corporation +* Copyright © 2007, 2011, 2013, 2014, 2015 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
@@ -411,7 +411,7 @@ void igt_cleanup_aperture_trashers(void)* igt_system_suspend_autoresume: * * Execute a system suspend-to-mem cycle and automatically wake up again using -* the firmwares resume timer. +* the firmware's resume timer. * * This is very handy for implementing any kind of suspend/resume test. */
@@ -430,6 +430,34 @@ void igt_system_suspend_autoresume(void) }/** +* igt_system_hibernate_autoresume: +* +* Execute a system suspend-to-disk cycle and automatically wake up again using +* the firmware's resume timer. +* +* This is very handy for implementing any kind of hibernate/resume test. +*/ +void igt_system_hibernate_autoresume (void ) +{ +int ret; + +/* FIXME: I'm guessing simulation behaves the same way as with +* suspend/resume, but it might be prudent to make sure +*/ +/* FIXME: Simulation doesn't like suspend/resume, and not even a lighter +* approach using /sys/power/pm_test to just test our driver's callbacks +* seems to fare better. We need to investigate what's going on. */ +igt_skip_on_simulation (); + +/* The timeout might need to be adjusted if hibernation takes too long +* or if we have to wait excessively long before resume +*/ + ret =system ("rtcwake -s 90 -m disk" ); +igt_assert_f (ret ==0 ,"This failure means that something is wrong with the rtcwake tool " +"or how your distro is set up. This is not a i915.ko or i-g-t bug." ); +} + +/** * igt_drop_root: * * Drop root privileges and make sure it actually worked. Useful for tests
lib/igt_aux.h +3 -2
@@ -1,5 +1,5 @@/* -* Copyright © 2014 Intel Corporation +* Copyright © 2014, 2015 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
@@ -58,8 +58,9 @@ void igt_init_aperture_trashers(drm_intel_bufmgr *bufmgr);void igt_trash_aperture (void );void igt_cleanup_aperture_trashers (void ); -/* suspend and auto-resume system */ +/* suspend/hibernate and auto-resume system */ void igt_system_suspend_autoresume (void ); +void igt_system_hibernate_autoresume (void );/* dropping priviledges */ void igt_drop_root (void );
tests/drv_suspend.c +49 -19
135 lines not on this page · raw message
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Imre Deak
Reviewed-byQuoted 13 lines · David Weinehall
intel-gpu-tools currently has a bunch of tests for suspend, but currently none (that I could find) for hibernate.
Attached is a rudimentary patch to add said test. It does so by repurposing the
drv_suspenddriver to handle both suspend and hibernate, since the difference is miniscule.I decided to split the suspend/autoresume functions in
igt_aux.cthough, to be able to leave theigt_system_uspend_autoresume()function unchanged (the other option would be to
introduce a boolean function argument and have that
decide what parameters to pass to rtcwake).
Quoted 3 lines
The timeout passed to rtcwake probably needs tuning (it might even need to be dynamically adjusted, since the time hibernation takes varies wildly depending on the amount of non-cache memory in use).
I think in general we should try to keep the existing subtest names, but I couldn't find any concrete problem changing them in this case. The patch looks ok to me (please inline the patch next time):
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 14 lines · Imre Deak
Quoted 13 lines · David Weinehall
intel-gpu-tools currently has a bunch of tests for suspend, but currently none (that I could find) for hibernate.
Attached is a rudimentary patch to add said test. It does so by repurposing the
drv_suspenddriver to handle both suspend and hibernate, since the difference is miniscule.I decided to split the suspend/autoresume functions in
igt_aux.cthough, to be able to leave theigt_system_uspend_autoresume()function unchanged (the other option would be to
introduce a boolean function argument and have that
decide what parameters to pass to rtcwake).
Quoted 8 lines
Quoted 3 lines
The timeout passed to rtcwake probably needs tuning (it might even need to be dynamically adjusted, since the time hibernation takes varies wildly depending on the amount of non-cache memory in use).
I think in general we should try to keep the existing subtest names, but I couldn't find any concrete problem changing them in this case. The patch looks ok to me (please inline the patch next time):
Reviewed-by Imre Deak <[email protected]>
Thanks for the patch, I pushed it to igt.
--Imre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx