public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	intel-gfx@lists.freedesktop.org,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Subject: Re: [PATCH 03/11] drm/i915: Restore dev_priv->mm.interruptible for overlay
Date: Wed, 7 Dec 2016 19:51:16 +0200	[thread overview]
Message-ID: <20161207175116.GU31595@intel.com> (raw)
In-Reply-To: <20161207174139.GA4815@nuc-i3427.alporthouse.com>

On Wed, Dec 07, 2016 at 05:41:39PM +0000, Chris Wilson wrote:
> On Wed, Dec 07, 2016 at 07:28:05PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We need an uninterruptible wait for the overlay off request during
> > modeset. Restore the operation of dev_priv->mm.interruptible
> > sufficiently for that.
> > 
> > Toss in a WARN_ON() to make sure the request succeeds.
> > 
> > Fixes: 7da844c5c6fc ("drm/i915: Move the special case wait-request handling to its one caller")
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_request.c | 36 +++++++++++++++++++++++++++++++++
> >  drivers/gpu/drm/i915/i915_gem_request.h | 35 ++------------------------------
> >  drivers/gpu/drm/i915/intel_display.c    |  2 +-
> >  3 files changed, 39 insertions(+), 34 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> > index fcf22b0e2967..1a7b88166c51 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_request.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> > @@ -1199,3 +1199,39 @@ void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
> >  	for_each_engine(engine, dev_priv, id)
> >  		engine_retire_requests(engine);
> >  }
> > +
> > +/**
> > + * i915_gem_active_retire - waits until the request is retired
> > + * @active - the active request on which to wait
> > + *
> > + * i915_gem_active_retire() waits until the request is completed,
> > + * and then ensures that at least the retirement handler for this
> > + * @active tracker is called before returning. If the @active
> > + * tracker is idle, the function returns immediately.
> > + */
> > +int __must_check
> > +i915_gem_active_retire(struct i915_gem_active *active,
> > +		       struct mutex *mutex)
> > +{
> > +	struct drm_i915_gem_request *request;
> > +	long ret;
> > +
> > +	request = i915_gem_active_raw(active, mutex);
> > +	if (!request)
> > +		return 0;
> > +
> > +	ret = i915_wait_request(request,
> > +				(request->i915->mm.interruptible ?
> > +				 I915_WAIT_INTERRUPTIBLE : 0) |
> > +				I915_WAIT_LOCKED,
> > +				MAX_SCHEDULE_TIMEOUT);
> 
> At least pass in the flags.
> 
> > +	if (ret < 0)
> > +		return ret;
> > +
> > +	list_del_init(&active->link);
> > +	RCU_INIT_POINTER(active->request, NULL);
> > +
> > +	active->retire(active, request);
> > +
> > +	return 0;
> > +}
> > diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
> > index e2b077df2da0..09add6b9cfc7 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_request.h
> > +++ b/drivers/gpu/drm/i915/i915_gem_request.h
> > @@ -657,39 +657,8 @@ i915_gem_active_wait(const struct i915_gem_active *active, unsigned int flags)
> >  	return ret < 0 ? ret : 0;
> >  }
> >  
> > -/**
> > - * i915_gem_active_retire - waits until the request is retired
> > - * @active - the active request on which to wait
> > - *
> > - * i915_gem_active_retire() waits until the request is completed,
> > - * and then ensures that at least the retirement handler for this
> > - * @active tracker is called before returning. If the @active
> > - * tracker is idle, the function returns immediately.
> > - */
> > -static inline int __must_check
> > -i915_gem_active_retire(struct i915_gem_active *active,
> > -		       struct mutex *mutex)
> > -{
> > -	struct drm_i915_gem_request *request;
> > -	long ret;
> > -
> > -	request = i915_gem_active_raw(active, mutex);
> > -	if (!request)
> > -		return 0;
> > -
> > -	ret = i915_wait_request(request,
> > -				I915_WAIT_INTERRUPTIBLE | I915_WAIT_LOCKED,
> > -				MAX_SCHEDULE_TIMEOUT);
> > -	if (ret < 0)
> > -		return ret;
> > -
> > -	list_del_init(&active->link);
> > -	RCU_INIT_POINTER(active->request, NULL);
> > -
> > -	active->retire(active, request);
> > -
> > -	return 0;
> > -}
> > +int __must_check i915_gem_active_retire(struct i915_gem_active *active,
> > +					struct mutex *mutex);
> >  
> >  #define for_each_active(mask, idx) \
> >  	for (; mask ? idx = ffs(mask) - 1, 1 : 0; mask &= ~BIT(idx))
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index a41082e2750e..5a74991854e3 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -4923,7 +4923,7 @@ static void intel_crtc_dpms_overlay_disable(struct intel_crtc *intel_crtc)
> >  
> >  		mutex_lock(&dev->struct_mutex);
> >  		dev_priv->mm.interruptible = false;
> > -		(void) intel_overlay_switch_off(intel_crtc->overlay);
> > +		WARN_ON(intel_overlay_switch_off(intel_crtc->overlay) != 0);
> >  		dev_priv->mm.interruptible = true;
> >  		mutex_unlock(&dev->struct_mutex);
> 
> Or we can push this wait to where it can interrupt, such as prepare_planes_fb.
> (For intel_atomic_commit_tail, intel_crtc_disable_noatomic() should always
> be a no-op.) And then we are down to just the shrinker running
> uninterruptibly, just one last place to fix.

Hmm. Yeah I guess we could try to do this in a different place.

> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-12-07 17:51 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 17:28 [PATCH 00/11] drm/i915: Overlay fixes ville.syrjala
2016-12-07 17:28 ` [PATCH 01/11] drm/i915: Fix oops in overlay due to frontbuffer trakcing ville.syrjala
2016-12-07 17:48   ` Chris Wilson
2016-12-07 17:28 ` [PATCH 02/11] drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff ville.syrjala
2016-12-07 17:44   ` Chris Wilson
2016-12-07 17:49     ` Ville Syrjälä
2016-12-07 17:56   ` [PATCH] " Chris Wilson
2016-12-07 18:11     ` Ville Syrjälä
2016-12-07 18:22       ` Chris Wilson
2016-12-21 14:45         ` [PATCH] drm/i915: Initialize overlay->last_flip properly ville.syrjala
2016-12-07 17:28 ` [PATCH 03/11] drm/i915: Restore dev_priv->mm.interruptible for overlay ville.syrjala
2016-12-07 17:41   ` Chris Wilson
2016-12-07 17:51     ` Ville Syrjälä [this message]
2016-12-07 18:25       ` Chris Wilson
2016-12-07 18:45         ` [PATCH] drm/i915: Asynchronously wait for the overlay to finish Chris Wilson
2016-12-07 18:49         ` [PATCH 03/11] drm/i915: Restore dev_priv->mm.interruptible for overlay Ville Syrjälä
2016-12-07 17:28 ` [PATCH 04/11] drm/i915: Fix the overlay frontbuffer tracking ville.syrjala
2016-12-08  9:46   ` Chris Wilson
2016-12-07 17:28 ` [PATCH 05/11] drm/i915: Use pipe_src_w in overlay code ville.syrjala
2016-12-08  8:35   ` Chris Wilson
2016-12-08 16:11     ` Ville Syrjälä
2016-12-07 17:28 ` [PATCH 06/11] drm/i915: Kill intel_panel_fitter_pipe() ville.syrjala
2016-12-08  8:31   ` Chris Wilson
2016-12-07 17:28 ` [PATCH 07/11] drm/i915: Simplify SWIDTHSW calculation ville.syrjala
2016-12-08  8:40   ` Chris Wilson
2016-12-07 17:28 ` [PATCH 08/11] drm/i915: Reorganize overlay filter coeffs into a nicer form ville.syrjala
2016-12-08  8:45   ` Chris Wilson
2016-12-08 16:17     ` Ville Syrjälä
2016-12-08 16:26       ` Chris Wilson
2016-12-22 19:55         ` Ville Syrjälä
2016-12-07 17:28 ` [PATCH 09/11] drm/i915: Use primary plane->state for overlay ckey setup ville.syrjala
2016-12-08  8:50   ` Chris Wilson
2016-12-07 17:28 ` [PATCH 10/11] drm/i915: Disable L2 cache clock gating on 830 when using the overlay ville.syrjala
2016-12-08  9:39   ` Chris Wilson
2016-12-07 17:28 ` [PATCH 11/11] drm/i915: Kill the 830 MI_OVERLAY_OFF workaround ville.syrjala
2016-12-08  0:02   ` kbuild test robot
2016-12-08 14:27   ` kbuild test robot
2016-12-22 19:52   ` [PATCH v2 " ville.syrjala
2016-12-22 21:40     ` Chris Wilson
2016-12-23 14:46       ` Ville Syrjälä
2016-12-07 20:22 ` ✓ Fi.CI.BAT: success for drm/i915: Overlay fixes (rev3) Patchwork
2016-12-21 15:45 ` ✓ Fi.CI.BAT: success for drm/i915: Overlay fixes (rev4) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161207175116.GU31595@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox