summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2017-03-10 13:18:19 +0200
committerPetri Latvala <petri.latvala@intel.com>2017-03-13 15:55:37 +0200
commit5ca0da9f53023b9fcfd327a5f43bc7b0916b24b1 (patch)
tree13f8195a5df2f74643cfb9fb2d6116443e2b1213
parent9ac59bcc14d146400ae1b8d3df36d53cd7678991 (diff)
lib: Add i915 and drm-mm selftest headers from the kernel
Copied as of commit commit 496b575e3ccbf6fbe57a674c721af43dc8826361 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Feb 13 17:15:58 2017 +0000 drm/i915: Add initial selftests for hang detection and resets The headers are used to enumerate available tests when the running kernel does not support selftests. v2: Also add them to Makefile.sources Signed-off-by: Petri Latvala <petri.latvala@intel.com>
-rw-r--r--lib/Makefile.sources3
-rw-r--r--lib/drm_mm_selftests.h24
-rw-r--r--lib/i915_live_selftests.h19
-rw-r--r--lib/i915_mock_selftests.h20
4 files changed, 66 insertions, 0 deletions
diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 6348487f..151c3d96 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -83,6 +83,9 @@ lib_source_list = \
uwildmat/uwildmat.c \
igt_kmod.c \
igt_kmod.h \
+ drm_mm_selftests.h \
+ i915_live_selftests.h \
+ i915_mock_selftests.h \
$(NULL)
if HAVE_CHAMELIUM
diff --git a/lib/drm_mm_selftests.h b/lib/drm_mm_selftests.h
new file mode 100644
index 00000000..37bbdac5
--- /dev/null
+++ b/lib/drm_mm_selftests.h
@@ -0,0 +1,24 @@
+/* List each unit test as selftest(name, function)
+ *
+ * The name is used as both an enum and expanded as igt__name to create
+ * a module parameter. It must be unique and legal for a C identifier.
+ *
+ * Tests are executed in order by igt/drm_mm
+ */
+selftest(sanitycheck, igt_sanitycheck) /* keep first (selfcheck for igt) */
+selftest(init, igt_init)
+selftest(debug, igt_debug)
+selftest(reserve, igt_reserve)
+selftest(insert, igt_insert)
+selftest(replace, igt_replace)
+selftest(insert_range, igt_insert_range)
+selftest(align, igt_align)
+selftest(align32, igt_align32)
+selftest(align64, igt_align64)
+selftest(evict, igt_evict)
+selftest(evict_range, igt_evict_range)
+selftest(bottomup, igt_bottomup)
+selftest(topdown, igt_topdown)
+selftest(color, igt_color)
+selftest(color_evict, igt_color_evict)
+selftest(color_evict_range, igt_color_evict_range)
diff --git a/lib/i915_live_selftests.h b/lib/i915_live_selftests.h
new file mode 100644
index 00000000..18b174d8
--- /dev/null
+++ b/lib/i915_live_selftests.h
@@ -0,0 +1,19 @@
+/* List each unit test as selftest(name, function)
+ *
+ * The name is used as both an enum and expanded as subtest__name to create
+ * a module parameter. It must be unique and legal for a C identifier.
+ *
+ * The function should be of type int function(void). It may be conditionally
+ * compiled using #if IS_ENABLED(DRM_I915_SELFTEST).
+ *
+ * Tests are executed in order by igt/drv_selftest
+ */
+selftest(sanitycheck, i915_live_sanitycheck) /* keep first (igt selfcheck) */
+selftest(uncore, intel_uncore_live_selftests)
+selftest(requests, i915_gem_request_live_selftests)
+selftest(objects, i915_gem_object_live_selftests)
+selftest(dmabuf, i915_gem_dmabuf_live_selftests)
+selftest(coherency, i915_gem_coherency_live_selftests)
+selftest(gtt, i915_gem_gtt_live_selftests)
+selftest(contexts, i915_gem_context_live_selftests)
+selftest(hangcheck, intel_hangcheck_live_selftests)
diff --git a/lib/i915_mock_selftests.h b/lib/i915_mock_selftests.h
new file mode 100644
index 00000000..be9a9ebf
--- /dev/null
+++ b/lib/i915_mock_selftests.h
@@ -0,0 +1,20 @@
+/* List each unit test as selftest(name, function)
+ *
+ * The name is used as both an enum and expanded as subtest__name to create
+ * a module parameter. It must be unique and legal for a C identifier.
+ *
+ * The function should be of type int function(void). It may be conditionally
+ * compiled using #if IS_ENABLED(DRM_I915_SELFTEST).
+ *
+ * Tests are executed in order by igt/drv_selftest
+ */
+selftest(sanitycheck, i915_mock_sanitycheck) /* keep first (igt selfcheck) */
+selftest(scatterlist, scatterlist_mock_selftests)
+selftest(uncore, intel_uncore_mock_selftests)
+selftest(breadcrumbs, intel_breadcrumbs_mock_selftests)
+selftest(requests, i915_gem_request_mock_selftests)
+selftest(objects, i915_gem_object_mock_selftests)
+selftest(dmabuf, i915_gem_dmabuf_mock_selftests)
+selftest(vma, i915_vma_mock_selftests)
+selftest(evict, i915_gem_evict_mock_selftests)
+selftest(gtt, i915_gem_gtt_mock_selftests)