diff options
author | Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com> | 2021-12-15 15:48:32 +0530 |
---|---|---|
committer | Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com> | 2021-12-15 15:48:55 +0530 |
commit | 61f0995ecaf1ce99d7046a325d8d926f27d8d2dd (patch) | |
tree | cce36cfd47ae955fa2c2c6f971b48827826d8a0e /tests/i915/gem_exec_balancer.c | |
parent | 4a181917e4f5c1ad070cecf6c2a828a19ce59ada (diff) |
tests/i915/gem_exec_balancer: bonding support check in invalid-balancer
Bonding is disabled on GEN12+ platforms, except ones already
supported by the i915 - TGL, RKL, and ADL-S.
Currently few tests are failing for same reason, with this
change they should rightly skip with proper message.
Reference: https://cgit.freedesktop.org/drm-tip/commit/?id=ce7e75c7ef1bf8ea3d947da8c674d2f40fd7d734
Changes since V3 :
- Initalization of bonding boolean not required - zbigniew
Changes since V2 :
- Solved checkpatch errors.
Changes since V1 :
- use function to check bonding capability so that
we dont skip whole test in case bonding not supported.
Acked-by: Zbigniew KempczyĆski <zbigniew.kempczynski@intel.com>
Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
Diffstat (limited to 'tests/i915/gem_exec_balancer.c')
-rw-r--r-- | tests/i915/gem_exec_balancer.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c index d58734ab..42fd0a52 100644 --- a/tests/i915/gem_exec_balancer.c +++ b/tests/i915/gem_exec_balancer.c @@ -180,6 +180,33 @@ __set_param_fresh_context(int i915, struct drm_i915_gem_context_param param) return err; } +static bool has_bonding(int i915) +{ + I915_DEFINE_CONTEXT_ENGINES_BOND(bonds[16], 1); + I915_DEFINE_CONTEXT_PARAM_ENGINES(engines, 1); + struct drm_i915_gem_context_param p = { + .param = I915_CONTEXT_PARAM_ENGINES, + .value = to_user_pointer(&engines), + .size = sizeof(engines), + }; + int ret; + + memset(&engines, 0, sizeof(engines)); + igt_assert_eq(__set_param_fresh_context(i915, p), 0); + + memset(bonds, 0, sizeof(bonds)); + for (int n = 0; n < ARRAY_SIZE(bonds); n++) { + bonds[n].base.name = I915_CONTEXT_ENGINES_EXT_BOND; + bonds[n].base.next_extension = + n ? to_user_pointer(&bonds[n - 1]) : 0; + bonds[n].num_bonds = 1; + } + engines.extensions = to_user_pointer(&bonds); + ret = __set_param_fresh_context(i915, p); + + return ret == -ENODEV ? false : true; +} + static void invalid_balancer(int i915) { I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(balancer, 64); @@ -191,6 +218,7 @@ static void invalid_balancer(int i915) }; uint32_t handle; void *ptr; + bool bonding; /* * Assume that I915_CONTEXT_PARAM_ENGINE validates the array @@ -198,6 +226,7 @@ static void invalid_balancer(int i915) * extension explodes. */ + bonding = has_bonding(i915); for (int class = 0; class < 32; class++) { struct i915_engine_class_instance *ci; unsigned int count; @@ -299,7 +328,7 @@ static void invalid_balancer(int i915) munmap(ptr + 4096, 4096); - if (count >= 2) { + if (count >= 2 && bonding) { /* You can't bond to a balanced engine */ memset(&bond, 0, sizeof(bond)); bond.base.name = I915_CONTEXT_ENGINES_EXT_BOND; |