[Intel-gfx] [PATCH i-g-t v2 1/2] lib: Add i915 and drm-mm selftest headers from the kernel

Petri Latvala petri.latvala at intel.com
Mon Mar 13 10:43:57 UTC 2017


Copied as of commit

 commit 496b575e3ccbf6fbe57a674c721af43dc8826361
 Author: Chris Wilson <chris at 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 at intel.com>
---
 lib/Makefile.sources      |  3 +++
 lib/drm_mm_selftests.h    | 24 ++++++++++++++++++++++++
 lib/i915_live_selftests.h | 19 +++++++++++++++++++
 lib/i915_mock_selftests.h | 20 ++++++++++++++++++++
 4 files changed, 66 insertions(+)
 create mode 100644 lib/drm_mm_selftests.h
 create mode 100644 lib/i915_live_selftests.h
 create mode 100644 lib/i915_mock_selftests.h

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 6348487..151c3d9 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 0000000..37bbdac
--- /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 0000000..18b174d
--- /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 0000000..be9a9eb
--- /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)
-- 
2.9.3



More information about the Intel-gfx mailing list