[Intel-gfx] [PATCH] drm/i915: Keep rings pinned while the context is active

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 19 14:38:16 UTC 2019


Quoting Tvrtko Ursulin (2019-06-19 15:35:41)
> 
> On 19/06/2019 14:44, Chris Wilson wrote:
> > Remember to keep the rings pinned as well as the context image until the
> > GPU is no longer active.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110946
> > Fixes: ce476c80b8bf ("drm/i915: Keep contexts pinned until after the next kernel context switch")
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > ---
> >   drivers/gpu/drm/i915/gt/intel_context.c | 17 ++++++++++++-----
> >   drivers/gpu/drm/i915/gt/intel_lrc.c     |  9 +--------
> >   2 files changed, 13 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
> > index 2c454f227c2e..b84f11a52d88 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_context.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_context.c
> > @@ -126,6 +126,7 @@ static void intel_context_retire(struct i915_active *active)
> >       if (ce->state)
> >               __context_unpin_state(ce->state);
> >   
> > +     intel_ring_unpin(ce->ring);
> >       intel_context_put(ce);
> >   }
> >   
> > @@ -160,15 +161,16 @@ int intel_context_active_acquire(struct intel_context *ce, unsigned long flags)
> >   
> >       intel_context_get(ce);
> >   
> > +     err = intel_ring_pin(ce->ring);
> > +     if (err)
> > +             goto err_put;
> > +
> >       if (!ce->state)
> >               return 0;
> >   
> >       err = __context_pin_state(ce->state, flags);
> > -     if (err) {
> > -             i915_active_cancel(&ce->active);
> > -             intel_context_put(ce);
> > -             return err;
> > -     }
> > +     if (err)
> > +             goto err_put;
> 
> intel_ring_unpin?

Gah I did... A mistake when rebasing :(
-Chris


More information about the Intel-gfx mailing list