xref: /linux/drivers/gpu/drm/i915/gt/selftest_engine.c (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
124f90d66SChris Wilson // SPDX-License-Identifier: GPL-2.0
2c7302f20SChris Wilson /*
3c7302f20SChris Wilson  * Copyright © 2018 Intel Corporation
4c7302f20SChris Wilson  */
5c7302f20SChris Wilson 
6c7302f20SChris Wilson #include "i915_selftest.h"
7c7302f20SChris Wilson #include "selftest_engine.h"
8c7302f20SChris Wilson 
intel_engine_live_selftests(struct drm_i915_private * i915)9c7302f20SChris Wilson int intel_engine_live_selftests(struct drm_i915_private *i915)
10c7302f20SChris Wilson {
11c7302f20SChris Wilson 	static int (* const tests[])(struct intel_gt *) = {
12c7302f20SChris Wilson 		live_engine_pm_selftests,
13c7302f20SChris Wilson 		NULL,
14c7302f20SChris Wilson 	};
15*c14adcbdSMichał Winiarski 	struct intel_gt *gt = to_gt(i915);
16c7302f20SChris Wilson 	typeof(*tests) *fn;
17c7302f20SChris Wilson 
18c7302f20SChris Wilson 	for (fn = tests; *fn; fn++) {
19c7302f20SChris Wilson 		int err;
20c7302f20SChris Wilson 
21c7302f20SChris Wilson 		err = (*fn)(gt);
22c7302f20SChris Wilson 		if (err)
23c7302f20SChris Wilson 			return err;
24c7302f20SChris Wilson 	}
25c7302f20SChris Wilson 
26c7302f20SChris Wilson 	return 0;
27c7302f20SChris Wilson }
28