igt_spinner.h 1.0 KB

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