xref: /openbsd-src/sys/dev/pci/drm/i915/selftests/intel_scheduler_helpers.h (revision 1bb76ff151c0aba8e3312a604e4cd2e5195cf4b7)
15ca02815Sjsg /* SPDX-License-Identifier: MIT */
25ca02815Sjsg /*
35ca02815Sjsg  * Copyright © 2021 Intel Corporation
45ca02815Sjsg  */
55ca02815Sjsg 
65ca02815Sjsg #ifndef _INTEL_SELFTEST_SCHEDULER_HELPERS_H_
75ca02815Sjsg #define _INTEL_SELFTEST_SCHEDULER_HELPERS_H_
85ca02815Sjsg 
95ca02815Sjsg #include <linux/types.h>
105ca02815Sjsg 
115ca02815Sjsg struct i915_request;
125ca02815Sjsg struct intel_engine_cs;
13*1bb76ff1Sjsg struct intel_gt;
145ca02815Sjsg 
155ca02815Sjsg struct intel_selftest_saved_policy {
165ca02815Sjsg 	u32 flags;
175ca02815Sjsg 	u32 reset;
185ca02815Sjsg 	u64 timeslice;
195ca02815Sjsg 	u64 preempt_timeout;
205ca02815Sjsg };
215ca02815Sjsg 
225ca02815Sjsg enum selftest_scheduler_modify {
235ca02815Sjsg 	SELFTEST_SCHEDULER_MODIFY_NO_HANGCHECK = 0,
245ca02815Sjsg 	SELFTEST_SCHEDULER_MODIFY_FAST_RESET,
255ca02815Sjsg };
265ca02815Sjsg 
27*1bb76ff1Sjsg struct intel_engine_cs *intel_selftest_find_any_engine(struct intel_gt *gt);
285ca02815Sjsg int intel_selftest_modify_policy(struct intel_engine_cs *engine,
295ca02815Sjsg 				 struct intel_selftest_saved_policy *saved,
305ca02815Sjsg 				 enum selftest_scheduler_modify modify_type);
315ca02815Sjsg int intel_selftest_restore_policy(struct intel_engine_cs *engine,
325ca02815Sjsg 				  struct intel_selftest_saved_policy *saved);
335ca02815Sjsg int intel_selftest_wait_for_rq(struct i915_request *rq);
345ca02815Sjsg 
355ca02815Sjsg #endif
36