[Intel-gfx] [PATCH v2 1/2] drm/i915/selftests: Verify context workarounds

Chris Wilson chris at chris-wilson.co.uk
Mon May 20 10:30:48 UTC 2019


Quoting Tvrtko Ursulin (2019-05-20 11:18:15)
> @@ -1352,11 +1357,11 @@ static int engine_wa_list_verify(struct intel_engine_cs *engine,
>         if (!wal->count)
>                 return 0;
>  
> -       vma = create_scratch(&engine->i915->ggtt.vm, wal->count);
> +       vma = create_scratch(&ce->gem_context->i915->ggtt.vm, wal->count);

Use ce->engine->i915->ggtt.vm to save me a headache later.

>         if (IS_ERR(vma))
>                 return PTR_ERR(vma);
>  
> -       rq = i915_request_create(engine->kernel_context);
> +       rq = intel_context_create_request(ce);
>         if (IS_ERR(rq)) {
>                 err = PTR_ERR(rq);
>                 goto err_vma;

> @@ -1003,28 +1010,36 @@ static int live_isolated_whitelist(void *arg)
>         return err;
>  }
>  
> -static bool verify_gt_engine_wa(struct drm_i915_private *i915,
> -                               struct wa_lists *lists, const char *str)
> +static bool
> +verify_wa_lists(struct i915_gem_context *ctx, struct wa_lists *lists,
> +               const char *str)
>  {
> -       struct intel_engine_cs *engine;
> -       enum intel_engine_id id;
> +       struct drm_i915_private *i915 = ctx->i915;
> +       struct i915_gem_engines_iter it;
> +       struct intel_context *ce;
>         bool ok = true;
>  
>         ok &= wa_list_verify(&i915->uncore, &lists->gt_wa_list, str);
>  
> -       for_each_engine(engine, i915, id) {
> -               ok &= engine_wa_list_verify(engine,
> -                                           &lists->engine[id].wa_list,
> +       for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {

And for my piece of mind,
	GEM_BUG_ON(it.idx != ce->engine->id)
as I already forgot the relationship for the default engine map.

> +               ok &= engine_wa_list_verify(ce,
> +                                           &lists->engine[it.idx].wa_list,
> +                                           str) == 0;
> +
> +               ok &= engine_wa_list_verify(ce,
> +                                           &lists->engine[it.idx].ctx_wa_list,
>                                             str) == 0;
>         }

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list