Re: [PATCH v2] drm/i915: Restore inhibiting the load of the default context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 10, 2015 at 12:19:29PM +0200, Mika Kuoppala wrote:
> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:
> 
> > Following a GPU reset, we may leave the context in a poorly defined
> > state, and reloading from that context will leave the GPU flummoxed. For
> > secondary contexts, this will lead to that context being banned - but
> > currently it is also causing the default context to become banned,
> > leading to turmoil in the shared state.
> >
> > This is a regression from
> >
> > commit 6702cf16e0ba8b0129f5aa1b6609d4e9c70bc13b [v4.1]
> > Author: Ben Widawsky <benjamin.widawsky@xxxxxxxxx>
> > Date:   Mon Mar 16 16:00:58 2015 +0000
> >
> >     drm/i915: Initialize all contexts
> >
> > which quietly introduced the removal of the MI_RESTORE_INHIBIT on the
> > default context.
> >
> > v2: Mark the global default context as uninitialized on GPU reset so
> > that the context-local workarounds are reloaded upon re-enabling.
> >
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>

Queued for -next, thanks for the patch.
-Daniel

> 
> > Cc: Michel Thierry <michel.thierry@xxxxxxxxx>
> > Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
> > Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_context.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> > index 43761c5bcaca..f024d5d2c746 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_context.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> > @@ -340,6 +340,10 @@ void i915_gem_context_reset(struct drm_device *dev)
> >  			i915_gem_context_unreference(lctx);
> >  			ring->last_context = NULL;
> >  		}
> > +
> > +		/* Force the GPU state to be reinitialised on enabling */
> > +		if (ring->default_context)
> > +			ring->default_context->legacy_hw_ctx.initialized = false;
> >  	}
> >  }
> >  
> > @@ -708,7 +712,7 @@ static int do_switch(struct drm_i915_gem_request *req)
> >  	if (ret)
> >  		goto unpin_out;
> >  
> > -	if (!to->legacy_hw_ctx.initialized) {
> > +	if (!to->legacy_hw_ctx.initialized || i915_gem_context_is_default(to)) {
> >  		hw_flags |= MI_RESTORE_INHIBIT;
> >  		/* NB: If we inhibit the restore, the context is not allowed to
> >  		 * die because future work may end up depending on valid address
> > -- 
> > 2.6.2
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux