summaryrefslogtreecommitdiff
path: root/lib/igt_core.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-12 14:41:46 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-13 09:32:44 +0100
commit9c2be694164cd654e4e15cdd9f15da7127ad6176 (patch)
treeafb5eaf6426edbea0f69fe9a05b937691713b490 /lib/igt_core.h
parentd21094516d2e93468b5d24904a334cb48cc2852f (diff)
igt/gem_wait: Use explicit timers
Rather than guestimating a workload that should take a certain amount of time, use a sigitimer to terminate a batch (and so complete the wait) after an exact amount of time. And in the process expand testing to cover multiple rings and hangcheck. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_core.h')
-rw-r--r--lib/igt_core.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h
index 433b88c9..03be757c 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -403,6 +403,24 @@ static inline void igt_ignore_warn(bool value)
} while (0)
/**
+ * igt_assert_cmps64:
+ * @n1: first value
+ * @cmp: compare operator
+ * @ncmp: negated version of @cmp
+ * @n2: second value
+ *
+ * Like igt_assert_cmpuint(), but for larger signed ints.
+ */
+#define igt_assert_cmps64(n1, cmp, ncmp, n2) \
+ do { \
+ int64_t __n1 = (n1), __n2 = (n2); \
+ if (__n1 cmp __n2) ; else \
+ __igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, \
+ #n1 " " #cmp " " #n2, \
+ "error: %lld " #ncmp " %lld\n", (long long)__n1, (long long)__n2); \
+ } while (0)
+
+/**
* igt_assert_cmpu64:
* @n1: first value
* @cmp: compare operator
@@ -461,6 +479,15 @@ static inline void igt_ignore_warn(bool value)
#define igt_assert_eq_u32(n1, n2) igt_assert_cmpuint(n1, ==, !=, n2)
/**
+ * igt_assert_eq_s64:
+ * @n1: first integer
+ * @n2: second integer
+ *
+ * Like igt_assert_eq_u32(), but for int64_t.
+ */
+#define igt_assert_eq_s64(n1, n2) igt_assert_cmps64(n1, ==, !=, n2)
+
+/**
* igt_assert_eq_u64:
* @n1: first integer
* @n2: second integer