summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/selftests/drm_mm_selftests.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-22 11:36:09 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-27 14:34:39 +0300
commit50f0033d1a0f3a8e9eed09ab68067fbb57b0669d (patch)
treee0fd92904fed03f9a211662b73232a644daa7022 /drivers/gpu/drm/selftests/drm_mm_selftests.h
parenta33d42dd03352d2e9d3d2c00bfa435c7a5ebab25 (diff)
downloadlinux-50f0033d1a0f3a8e9eed09ab68067fbb57b0669d.tar.xz
drm: Add some kselftests for the DRM range manager (struct drm_mm)
First we introduce a smattering of infrastructure for writing selftests. The idea is that we have a test module that exercises a particular portion of the exported API, and that module provides a set of tests that can either be run as an ensemble via kselftest or individually via an igt harness (in this case igt/drm_mm). To accommodate selecting individual tests, we export a boolean parameter to control selection of each test - that is hidden inside a bunch of reusable boilerplate macros to keep writing the tests simple. v2: Choose a random random_seed unless one is specified by the user. v3: More parameters to control max_iterations and max_prime of the tests. Testcase: igt/drm_mm Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161222083641.2691-7-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/selftests/drm_mm_selftests.h')
-rw-r--r--drivers/gpu/drm/selftests/drm_mm_selftests.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/selftests/drm_mm_selftests.h b/drivers/gpu/drm/selftests/drm_mm_selftests.h
new file mode 100644
index 000000000000..1610e0a63a5b
--- /dev/null
+++ b/drivers/gpu/drm/selftests/drm_mm_selftests.h
@@ -0,0 +1,8 @@
+/* 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) */