1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright © 2018 Intel Corporation
5  */
6 
7 #ifndef __I915_SELFTESTS_IGT_SPINNER_H__
8 #define __I915_SELFTESTS_IGT_SPINNER_H__
9 
10 #include "../i915_selftest.h"
11 
12 #include "gt/intel_engine.h"
13 
14 #include "../i915_drv.h"
15 #include "../i915_request.h"
16 #include "../i915_gem_context.h"
17 
18 struct igt_spinner {
19 	struct drm_i915_private *i915;
20 	struct drm_i915_gem_object *hws;
21 	struct drm_i915_gem_object *obj;
22 	u32 *batch;
23 	void *seqno;
24 };
25 
26 int igt_spinner_init(struct igt_spinner *spin, struct drm_i915_private *i915);
27 void igt_spinner_fini(struct igt_spinner *spin);
28 
29 struct i915_request *
30 igt_spinner_create_request(struct igt_spinner *spin,
31 			   struct i915_gem_context *ctx,
32 			   struct intel_engine_cs *engine,
33 			   u32 arbitration_command);
34 void igt_spinner_end(struct igt_spinner *spin);
35 
36 bool igt_wait_for_spinner(struct igt_spinner *spin, struct i915_request *rq);
37 
38 #endif
39