public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Deepak S <deepak.s@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/7] drm/i915: Boost GPU frequency if we detect outstanding pageflips
Date: Wed, 18 Mar 2015 13:48:16 +0530	[thread overview]
Message-ID: <550934C8.7020901@linux.intel.com> (raw)
In-Reply-To: <1425654391-2126-6-git-send-email-chris@chris-wilson.co.uk>



On Friday 06 March 2015 08:36 PM, Chris Wilson wrote:
> If we hit a vblank and see that have a pageflip queue but not yet
> processed, ensure that the GPU is running at maximum in order to clear
> the backlog. Pageflips are only queued for the following vblank, if we
> miss it, there will be a visible stutter. Boosting the GPU frequency
> doesn't prevent us from missing the target vblank, but it should help
> the subsequent frames hitting theirs.
>
> v2: Reorder vblank vs flip-complete so that we only check for a missed
> flip after processing the completion events, and avoid spurious boosts.
>
> v3: Rename missed_vblank
> v4: Rebase
> v5: Cancel the outstanding work in runtime suspend
> v6: Rebase
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/intel_display.c | 11 ++++++++---
>   drivers/gpu/drm/i915/intel_drv.h     |  2 ++
>   drivers/gpu/drm/i915/intel_pm.c      | 34 ++++++++++++++++++++++++++++++++++
>   3 files changed, 44 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2412002d510b..7735f0a4184c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9818,6 +9818,7 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
>   	struct drm_i915_private *dev_priv = dev->dev_private;
>   	struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
>   	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	struct intel_unpin_work *work;
>   
>   	WARN_ON(!in_irq());
>   
> @@ -9825,12 +9826,16 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
>   		return;
>   
>   	spin_lock(&dev->event_lock);
> -	if (intel_crtc->unpin_work && __intel_pageflip_stall_check(dev, crtc)) {
> +	work = intel_crtc->unpin_work;
> +	if (work != NULL && __intel_pageflip_stall_check(dev, crtc)) {
>   		WARN_ONCE(1, "Kicking stuck page flip: queued at %d, now %d\n",
> -			 intel_crtc->unpin_work->flip_queued_vblank,
> -			 drm_vblank_count(dev, pipe));
> +			 work->flip_queued_vblank, drm_vblank_count(dev, pipe));
>   		page_flip_completed(intel_crtc);
> +		work = NULL;
>   	}
> +	if (work != NULL &&
> +	    drm_vblank_count(dev, pipe) - work->flip_queued_vblank > 1)
> +		intel_queue_rps_boost_for_request(dev, work->flip_queued_req);
>   	spin_unlock(&dev->event_lock);
>   }
>   
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 1e564da2fd38..87e09a58191a 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1242,6 +1242,8 @@ void gen6_rps_busy(struct drm_i915_private *dev_priv);
>   void gen6_rps_reset_ei(struct drm_i915_private *dev_priv);
>   void gen6_rps_idle(struct drm_i915_private *dev_priv);
>   void gen6_rps_boost(struct drm_i915_private *dev_priv);
> +void intel_queue_rps_boost_for_request(struct drm_device *dev,
> +				       struct drm_i915_gem_request *rq);
>   void ilk_wm_get_hw_state(struct drm_device *dev);
>   void skl_wm_get_hw_state(struct drm_device *dev);
>   void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 972333d2211d..120b8af3c60c 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -6598,6 +6598,40 @@ int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
>   		return val / GT_FREQUENCY_MULTIPLIER;
>   }
>   
> +struct request_boost {
> +	struct work_struct work;
> +	struct drm_i915_gem_request *rq;
> +};
> +
> +static void __intel_rps_boost_work(struct work_struct *work)
> +{
> +	struct request_boost *boost = container_of(work, struct request_boost, work);
> +
> +	if (!i915_gem_request_completed(boost->rq, true))
> +		gen6_rps_boost(to_i915(boost->rq->ring->dev));
> +
> +	i915_gem_request_unreference(boost->rq);
> +	kfree(boost);
> +}
> +
> +void intel_queue_rps_boost_for_request(struct drm_device *dev,
> +				       struct drm_i915_gem_request *rq)
> +{
> +	struct request_boost *boost;
> +
> +	if (rq == NULL || INTEL_INFO(dev)->gen < 6)
> +		return;
> +
> +	boost = kmalloc(sizeof(*boost), GFP_ATOMIC);
> +	if (boost == NULL)
> +		return;
> +
> +	INIT_WORK(&boost->work, __intel_rps_boost_work);
> +	i915_gem_request_assign(&boost->rq, rq);
> +
> +	queue_work(to_i915(dev)->wq, &boost->work);
> +}
> +
>   void intel_pm_setup(struct drm_device *dev)
>   {
>   	struct drm_i915_private *dev_priv = dev->dev_private;

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-18  8:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 15:06 [PATCH 1/7] drm/i915: Relax RPS contraints to allows setting minfreq on idle Chris Wilson
2015-03-06 15:06 ` [PATCH 2/7] drm/i915: Fix computation of last_adjustment for RPS autotuning Chris Wilson
2015-03-06 17:32   ` Daniel Vetter
2015-03-06 21:44     ` Chris Wilson
2015-03-18  6:56   ` Deepak S
2015-03-18  9:05     ` Chris Wilson
2015-03-18  9:20     ` Chris Wilson
2015-03-18 11:09       ` Deepak S
2015-03-06 15:06 ` [PATCH 3/7] drm/i915: Improved w/a for rps on Baytrail Chris Wilson
2015-03-18  7:56   ` Deepak S
2015-03-06 15:06 ` [PATCH 4/7] drm/i915: Use down ei for manual Baytrail RPS calculations Chris Wilson
2015-03-18  8:04   ` Deepak S
2015-03-06 15:06 ` [PATCH 5/7] drm/i915: Agressive downclocking on Baytrail Chris Wilson
2015-03-18  8:12   ` Deepak S
2015-03-18  9:48     ` Daniel Vetter
2015-03-18  9:49       ` Chris Wilson
2015-03-18 11:06       ` Deepak S
2015-03-06 15:06 ` [PATCH 6/7] drm/i915: Boost GPU frequency if we detect outstanding pageflips Chris Wilson
2015-03-18  8:18   ` Deepak S [this message]
2015-03-18  8:20     ` Deepak S
2015-03-06 15:06 ` [PATCH 7/7] drm/i915: Deminish contribution of wait-boosting from clients Chris Wilson
2015-03-06 17:58   ` shuang.he
2015-03-18  9:00   ` Deepak S
2015-03-09 15:38 ` [PATCH 1/7] drm/i915: Relax RPS contraints to allows setting minfreq on idle Jesse Barnes
2015-03-18  5:44 ` Deepak S
2015-03-18  9:07   ` Chris Wilson
2015-03-18  5:52 ` Deepak S

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=550934C8.7020901@linux.intel.com \
    --to=deepak.s@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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