hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/i915/i915_selftest.h
....@@ -24,6 +24,8 @@
2424 #ifndef __I915_SELFTEST_H__
2525 #define __I915_SELFTEST_H__
2626
27
+#include <linux/types.h>
28
+
2729 struct pci_dev;
2830 struct drm_i915_private;
2931
....@@ -31,8 +33,10 @@
3133 unsigned long timeout_jiffies;
3234 unsigned int timeout_ms;
3335 unsigned int random_seed;
36
+ char *filter;
3437 int mock;
3538 int live;
39
+ int perf;
3640 };
3741
3842 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
....@@ -42,6 +46,7 @@
4246
4347 int i915_mock_selftests(void);
4448 int i915_live_selftests(struct pci_dev *pdev);
49
+int i915_perf_selftests(struct pci_dev *pdev);
4550
4651 /* We extract the function declarations from i915_mock_selftests.h and
4752 * i915_live_selftests.h Add your unit test declarations there!
....@@ -58,6 +63,7 @@
5863 #undef selftest
5964 #define selftest(name, func) int func(struct drm_i915_private *i915);
6065 #include "selftests/i915_live_selftests.h"
66
+#include "selftests/i915_perf_selftests.h"
6167 #undef selftest
6268
6369 struct i915_subtest {
....@@ -65,12 +71,37 @@
6571 const char *name;
6672 };
6773
74
+int __i915_nop_setup(void *data);
75
+int __i915_nop_teardown(int err, void *data);
76
+
77
+int __i915_live_setup(void *data);
78
+int __i915_live_teardown(int err, void *data);
79
+
80
+int __intel_gt_live_setup(void *data);
81
+int __intel_gt_live_teardown(int err, void *data);
82
+
6883 int __i915_subtests(const char *caller,
84
+ int (*setup)(void *data),
85
+ int (*teardown)(int err, void *data),
6986 const struct i915_subtest *st,
7087 unsigned int count,
7188 void *data);
7289 #define i915_subtests(T, data) \
73
- __i915_subtests(__func__, T, ARRAY_SIZE(T), data)
90
+ __i915_subtests(__func__, \
91
+ __i915_nop_setup, __i915_nop_teardown, \
92
+ T, ARRAY_SIZE(T), data)
93
+#define i915_live_subtests(T, data) ({ \
94
+ typecheck(struct drm_i915_private *, data); \
95
+ __i915_subtests(__func__, \
96
+ __i915_live_setup, __i915_live_teardown, \
97
+ T, ARRAY_SIZE(T), data); \
98
+})
99
+#define intel_gt_live_subtests(T, data) ({ \
100
+ typecheck(struct intel_gt *, data); \
101
+ __i915_subtests(__func__, \
102
+ __intel_gt_live_setup, __intel_gt_live_teardown, \
103
+ T, ARRAY_SIZE(T), data); \
104
+})
74105
75106 #define SUBTEST(x) { x, #x }
76107
....@@ -81,6 +112,7 @@
81112
82113 static inline int i915_mock_selftests(void) { return 0; }
83114 static inline int i915_live_selftests(struct pci_dev *pdev) { return 0; }
115
+static inline int i915_perf_selftests(struct pci_dev *pdev) { return 0; }
84116
85117 #define I915_SELFTEST_DECLARE(x)
86118 #define I915_SELFTEST_ONLY(x) 0
....@@ -101,4 +133,6 @@
101133 #define igt_timeout(t, fmt, ...) \
102134 __igt_timeout((t), KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
103135
136
+void igt_hexdump(const void *buf, size_t len);
137
+
104138 #endif /* !__I915_SELFTEST_H__ */