[Intel-gfx] [PATCH 5/6] drm/i915: Split idling from forcing context switch

Chris Wilson chris at chris-wilson.co.uk
Wed May 25 13:12:55 UTC 2016


On Wed, May 25, 2016 at 03:57:04PM +0300, Joonas Lahtinen wrote:
> On ke, 2016-05-25 at 12:48 +0100, Chris Wilson wrote:
> > diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
> > index b144c3f5c650..5741b58d186c 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_evict.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_evict.c
> > @@ -33,6 +33,37 @@
> >  #include "intel_drv.h"
> >  #include "i915_trace.h"
> >  
> > +static int switch_to_pinned_context(struct drm_i915_private *dev_priv)
> 
> Why not switch_to_kernel_context as it's effectively what this does (-
> execlist behaviour)?

Because "pinned context" tells us why we were are switching. The kernel
context is just the placeholder that is pinned and allows eviction of
the previous context.

> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index 46684779d4d6..84f2ed78cf88 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -2261,7 +2261,7 @@ static bool do_idling(struct drm_i915_private *dev_priv)
> >  
> >  	if (unlikely(ggtt->do_idle_maps)) {
> >  		dev_priv->mm.interruptible = false;
> > -		if (i915_gpu_idle(dev_priv->dev)) {
> > +		if (i915_gem_wait_for_idle(dev_priv)) {
> >  			DRM_ERROR("Couldn't idle GPU\n");
> 
> This wait_for scheme and the error message do not make sense together.

Yes. Nothing about the HW bug this is for makes sense. Why let a message
you never wish to see make any difference ;)
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list