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