[igt-dev] [PATCH i-g-t 4/4] tests/i915/gem_exec_balancer: Add a test for combind balancing and bonding

Daniel Vetter daniel at ffwll.ch
Thu Jun 3 11:46:09 UTC 2021


On Wed, Apr 28, 2021 at 03:21:43PM -0500, Jason Ekstrand wrote:

In the subject of this one: s/combind/combined/

I think that's fairly complete sanity check. On the series:

Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch>

I think best if you include this in your overall igt set (can't be CI'ed
otherwise) and the Test-With: check this together with your kernel set.

Cheers, Daniel

> ---
>  tests/i915/gem_exec_balancer.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
> index 4f1fa390..b594e2e1 100644
> --- a/tests/i915/gem_exec_balancer.c
> +++ b/tests/i915/gem_exec_balancer.c
> @@ -167,6 +167,7 @@ static uint32_t batch_create(int i915)
>  static void invalid_balancer(int i915)
>  {
>  	I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(balancer, 64);
> +	I915_DEFINE_CONTEXT_ENGINES_BOND(bond, 1);
>  	I915_DEFINE_CONTEXT_PARAM_ENGINES(engines, 64);
>  	struct drm_i915_gem_context_param p = {
>  		.param = I915_CONTEXT_PARAM_ENGINES,
> @@ -283,6 +284,31 @@ static void invalid_balancer(int i915)
>  
>  		munmap(ptr + 4096, 4096);
>  
> +		if (count >= 2) {
> +			/* You can't bond to a balanced engine */
> +			memset(&bond, 0, sizeof(bond));
> +			bond.base.name = I915_CONTEXT_ENGINES_EXT_BOND;
> +			bond.master = ci[0];
> +			bond.virtual_index = 0;
> +			bond.num_bonds = 1;
> +			bond.engines[0] = ci[1];
> +
> +			balancer.base.next_extension = to_user_pointer(&bond);
> +			balancer.engine_index = 0;
> +			balancer.num_siblings = count;
> +			memcpy(balancer.engines, ci, count * sizeof(*ci));
> +
> +			memset(&engines, 0, sizeof(engines));
> +			engines.engines[0].engine_class = I915_ENGINE_CLASS_INVALID;
> +			engines.engines[0].engine_instance = I915_ENGINE_CLASS_INVALID_NONE;
> +			engines.extensions = to_user_pointer(&balancer);
> +
> +			p.size = (sizeof(struct i915_context_param_engines) +
> +				  sizeof(*engines.engines));
> +
> +			igt_assert_eq(__gem_context_set_param(i915, &p), -EINVAL);
> +		}
> +
>  		gem_context_destroy(i915, p.ctx_id);
>  		free(ci);
>  	}
> -- 
> 2.31.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the igt-dev mailing list