[Intel-gfx] [PATCH] drm/i915/selftests: Pass intel_context to igt_spinner

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 31 06:56:33 UTC 2019


Quoting Tvrtko Ursulin (2019-07-31 06:55:23)
> 
> On 30/07/2019 16:48, Chris Wilson wrote:
> > @@ -1183,11 +1189,16 @@ live_engine_reset_workarounds(void *arg)
> >                       goto err;
> >               }
> >   
> > -             ret = igt_spinner_init(&spin, i915);
> > -             if (ret)
> > -                     goto err;
> > +             ce = i915_gem_context_get_engine(ctx, engine->id);
> > +             if (IS_ERR(ce))
> > +                     continue;
> 
> Can't instead use the for_each_gem_engine pattern as in live_sanitycheck?

The problem here is that the verify_wa which then also uses
for_each_gem_engine. Just needs to rejiggle the other callers so that
the context is always locked.

> > -     spin->hws = i915_gem_object_create_internal(i915, PAGE_SIZE);
> > +     spin->hws = i915_gem_object_create_internal(gt->i915, PAGE_SIZE);
> 
> I'd add the i915 local.

Maybe, at some point we need to pass gt into [internal] object creation.
At the moment, I like gt->i915 for being an eyesore. When there are
enough of them, it indicates which API needs adjusting next :)
-Chris


More information about the Intel-gfx mailing list