summaryrefslogtreecommitdiff
path: root/tests/i915/gem_exec_balancer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-03-31 11:28:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-04-01 16:15:11 +0100
commit0b4dffb6eaed9b34d3a515b09d4954e363d5a4c8 (patch)
treea0f9e83bb8293f3a516521e427e205d860a4dce0 /tests/i915/gem_exec_balancer.c
parent9ff50a94f97725fe365f6d5bbb6c3d0439370f41 (diff)
i915/gem_exec_balancer: Check for bonding support before exercising
Don't bother trying and failing to test bonding if the kernel doesn't even support it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Andi Shyti <andi.shyti@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/i915/gem_exec_balancer.c')
-rw-r--r--tests/i915/gem_exec_balancer.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index da8aff6d..9930e394 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -1936,6 +1936,22 @@ static bool has_load_balancer(int i915)
return err == 0;
}
+static bool has_bonding(int i915)
+{
+ I915_DEFINE_CONTEXT_ENGINES_BOND(bonds, 0) = {
+ .base.name = I915_CONTEXT_ENGINES_EXT_BOND,
+ };
+ struct i915_engine_class_instance ci = {};
+ uint32_t ctx;
+ int err;
+
+ ctx = gem_context_create(i915);
+ err = __set_load_balancer(i915, ctx, &ci, 1, &bonds);
+ gem_context_destroy(i915, ctx);
+
+ return err == 0;
+}
+
igt_main
{
int i915 = -1;
@@ -1992,11 +2008,18 @@ igt_main
igt_subtest("smoke")
smoketest(i915, 20);
- igt_subtest("bonded-imm")
- bonded(i915, 0);
+ igt_subtest_group {
+ igt_fixture igt_require(has_bonding(i915));
+
+ igt_subtest("bonded-imm")
+ bonded(i915, 0);
+
+ igt_subtest("bonded-cork")
+ bonded(i915, CORK);
- igt_subtest("bonded-cork")
- bonded(i915, CORK);
+ igt_subtest("bonded-early")
+ bonded_early(i915);
+ }
igt_subtest("bonded-slice")
bonded_slice(i915);
@@ -2007,9 +2030,6 @@ igt_main
igt_subtest("bonded-semaphore")
bonded_semaphore(i915);
- igt_subtest("bonded-early")
- bonded_early(i915);
-
igt_fixture {
igt_stop_hang_detector();
}