summaryrefslogtreecommitdiff
path: root/lib/igt_dummyload.h
diff options
context:
space:
mode:
authorAbdiel Janulgue <abdiel.janulgue@linux.intel.com>2016-10-11 21:30:08 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2016-11-29 11:32:44 +0000
commit35fa2ca73b6b9682d0f3366b0cb4e82ac6c340ec (patch)
treef0d01bc2e78082416226e1838f2444582cd3d9a2 /lib/igt_dummyload.h
parentd57ae360b32c4edfb88e9a0400ec5ec3a3e6959f (diff)
lib: add igt_dummyload
A lot of igt testcases need some GPU workload to make sure a race window is big enough. Unfortunately having a fixed amount of workload leads to spurious test failures or overly long runtimes on some fast/slow platforms. This library contains functionality to submit GPU workloads that should consume exactly a specific amount of time. Since v14: Since we are using multiple signals, walk list of batches to terminate a batch to avoid using a single global batch. Cycle signals between SIGRTMIN and SIGRTMAX properly. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: tomeu@tomeuvizoso.net Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Diffstat (limited to 'lib/igt_dummyload.h')
-rw-r--r--lib/igt_dummyload.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
new file mode 100644
index 00000000..2adfadf2
--- /dev/null
+++ b/lib/igt_dummyload.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __IGT_DUMMYLOAD_H__
+#define __IGT_DUMMYLOAD_H__
+
+#include <stdint.h>
+#include <time.h>
+
+#include "igt_aux.h"
+
+typedef struct igt_spin {
+ unsigned int handle;
+ timer_t timer;
+ int signo;
+ struct igt_list link;
+ uint32_t *batch;
+} igt_spin_t;
+
+igt_spin_t *igt_spin_batch_new(int fd, int engine, unsigned int dep_handle);
+void igt_spin_batch_set_timeout(igt_spin_t *spin, int64_t ns);
+void igt_spin_batch_end(igt_spin_t *spin);
+void igt_spin_batch_free(int fd, igt_spin_t *spin);
+
+void igt_terminate_spin_batches(void);
+
+#endif /* __IGT_DUMMYLOAD_H__ */