summaryrefslogtreecommitdiff
path: root/lib/igt_core.h
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2018-03-22 17:24:15 +0000
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2018-03-26 10:20:24 +0100
commit9d9978aff16949c1a4e1508301d8169a21362ae8 (patch)
tree1d831414ad5ab4e643d071fcc06dd08cbdffcbd3 /lib/igt_core.h
parentc2ee90774496a9772f17a7a359d7a670bf7d6b85 (diff)
lib/dummyload: Add pollable spin batch
Pollable spin batch exports a spin->running pointer which can be checked by dereferencing it to see if the spinner is actually executing on the GPU. This is useful for tests which want to make sure they do not proceed with their next step whilst the spinner is potentially only being processed by the driver and not actually executing. Pollable spinner can be created with igt_spin_batch_new_poll or __igt_spin_batch_new_poll, after which igt_spin_busywait_until_running can be used to busy wait until it is executing. v2: * Move READ_ONCE to igt_core. * Add igt_spin_busywait_until_running. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_core.h')
-rw-r--r--lib/igt_core.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h
index 66523a20..57e97f2b 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -950,4 +950,6 @@ void igt_kmsg(const char *format, ...);
#define KMSG_INFO "<6>[IGT] "
#define KMSG_DEBUG "<7>[IGT] "
+#define READ_ONCE(x) (*(volatile typeof(x) *)(&(x)))
+
#endif /* IGT_CORE_H */