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 "gem/i915_gem_context.h" 11 #include "gt/intel_engine.h" 12 13 #include "i915_drv.h" 14 #include "i915_request.h" 15 #include "i915_selftest.h" 16 17 struct igt_spinner { 18 struct drm_i915_private *i915; 19 struct drm_i915_gem_object *hws; 20 struct drm_i915_gem_object *obj; 21 u32 *batch; 22 void *seqno; 23 }; 24 25 int igt_spinner_init(struct igt_spinner *spin, struct drm_i915_private *i915); 26 void igt_spinner_fini(struct igt_spinner *spin); 27 28 struct i915_request * 29 igt_spinner_create_request(struct igt_spinner *spin, 30 struct i915_gem_context *ctx, 31 struct intel_engine_cs *engine, 32 u32 arbitration_command); 33 void igt_spinner_end(struct igt_spinner *spin); 34 35 bool igt_wait_for_spinner(struct igt_spinner *spin, struct i915_request *rq); 36 37 #endif 38