summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-08-07 19:12:07 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-08-12 14:46:46 +0200
commit5b0a8433fd0ff35062f0b1d3f50f5e04e76b576b (patch)
treeb9165f4917c4ed54e1dd810d48244f67b8c52417 /lib/igt_core.c
parent370c9897230b4d4973d0a2ab641901081108d97b (diff)
lib/core: Add igt_reset_timeout
Convenience wrapper suggested by Chris for igt_set_timeout(0, NULL). v2: While at it add an empty line in kms_flip to make set/reset_timeout a visual block. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index e2c2502b..c70176fb 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1771,7 +1771,8 @@ static void igt_alarm_handler(int signal)
* marked as failed.
*
* Any previous timer is cancelled and no timeout is scheduled if @seconds is
- * zero.
+ * zero. But for clarity the timeout set with this function should be cleared
+ * with igt_reset_timeout().
*/
void igt_set_timeout(unsigned int seconds,
const char *op)
@@ -1792,6 +1793,17 @@ void igt_set_timeout(unsigned int seconds,
alarm(seconds);
}
+/**
+ * igt_reset_timeout - reset timeout to default
+ *
+ * This function resets a timeout set by igt_set_timeout() and disables any
+ * timer set up by the former function.
+ */
+void igt_reset_timeout(void)
+{
+ igt_set_timeout(0, NULL);
+}
+
FILE *__igt_fopen_data(const char* igt_srcdir, const char* igt_datadir,
const char* filename)
{