Home | History | Annotate | Line # | Download | only in selftests
      1 /*	$NetBSD: igt_live_test.h,v 1.2 2021/12/18 23:45:31 riastradh Exp $	*/
      2 
      3 /*
      4  * SPDX-License-Identifier: MIT
      5  *
      6  * Copyright  2019 Intel Corporation
      7  */
      8 
      9 #ifndef IGT_LIVE_TEST_H
     10 #define IGT_LIVE_TEST_H
     11 
     12 #include "gt/intel_engine.h" /* for I915_NUM_ENGINES */
     13 
     14 struct drm_i915_private;
     15 
     16 struct igt_live_test {
     17 	struct drm_i915_private *i915;
     18 	const char *func;
     19 	const char *name;
     20 
     21 	unsigned int reset_global;
     22 	unsigned int reset_engine[I915_NUM_ENGINES];
     23 };
     24 
     25 /*
     26  * Flush the GPU state before and after the test to ensure that no residual
     27  * code is running on the GPU that may affect this test. Also compare the
     28  * state before and after the test and alert if it unexpectedly changes,
     29  * e.g. if the GPU was reset.
     30  */
     31 int igt_live_test_begin(struct igt_live_test *t,
     32 			struct drm_i915_private *i915,
     33 			const char *func,
     34 			const char *name);
     35 int igt_live_test_end(struct igt_live_test *t);
     36 
     37 #endif /* IGT_LIVE_TEST_H */
     38