public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Only write watermark registers if a pipe is active
Date: Fri, 4 Mar 2016 12:52:41 +0200	[thread overview]
Message-ID: <20160304105241.GO10446@intel.com> (raw)
In-Reply-To: <1457044041-13978-1-git-send-email-matthew.d.roper@intel.com>

On Thu, Mar 03, 2016 at 02:27:21PM -0800, Matt Roper wrote:
> If all pipes are off, then we may have entered runtime suspend and
> writing these registers will have no effect anyway.  When a pipe is
> re-enabled, it's crtc_enable will take care of programming appropriate
> watermark values.
> 
> Cc: arun.siluvery@linux.intel.com
> Cc: ville.syrjala@linux.intel.com
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94349
> Fixes: ed4a6a7ca853 ("drm/i915: Add two-stage ILK-style watermark programming (v11)")
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
> I've still been unable to reproduce this defect on my SNB system; none of the
> suggested tests people have noted in Bugzilla have triggered it for me.  But
> based on the stack trace I'm guessing that the problem happens because we've
> disabled the last pipe and gone into runtime suspend before we get around to
> optimizing the watermarks.
> 
> I'm not super familiar with the details of runtime PM, so if there's a better
> way this should be handled, I'm open to suggestions.

This definitely feels like papering over the problem. Why is the modeset
code still calling watermark updates at the wrong time?

With my original two stage wm code most wm updates got kicked off from
the plane commits stage, and the only manual calls were in plaform
specific code just before a new pipe is enabled, or just after one is
disabled. Very little room for these sorts of errors in that scheme.
What we have currently isn't done like that and instead it seems to
me we've somehow sprinkled stuff all over some common codepaths which
apparently leads to these problems.

> 
>  drivers/gpu/drm/i915/intel_pm.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index f65e841..8c7fddf 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2802,8 +2802,6 @@ static void ilk_write_wm_values(struct drm_i915_private *dev_priv,
>  		I915_WRITE(WM2_LP_ILK, results->wm_lp[1]);
>  	if (dirty & WM_DIRTY_LP(3) && previous->wm_lp[2] != results->wm_lp[2])
>  		I915_WRITE(WM3_LP_ILK, results->wm_lp[2]);
> -
> -	dev_priv->wm.hw = *results;
>  }
>  
>  bool ilk_disable_lp_wm(struct drm_device *dev)
> @@ -3731,7 +3729,10 @@ static void ilk_program_watermarks(struct drm_i915_private *dev_priv)
>  
>  	ilk_compute_wm_results(dev, best_lp_wm, partitioning, &results);
>  
> -	ilk_write_wm_values(dev_priv, &results);
> +	if (config.num_pipes_active > 0)
> +		ilk_write_wm_values(dev_priv, &results);
> +
> +	dev_priv->wm.hw = results;
>  }
>  
>  static void ilk_initial_watermarks(struct intel_crtc_state *cstate)
> -- 
> 2.1.4

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

  reply	other threads:[~2016-03-04 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 22:27 [PATCH] drm/i915: Only write watermark registers if a pipe is active Matt Roper
2016-03-04 10:52 ` Ville Syrjälä [this message]
2016-03-04 23:49   ` Matt Roper
2016-03-07 14:29     ` Ville Syrjälä
2016-03-07 19:09       ` Matt Roper
2016-03-07  9:26 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-03-07  9:40 ` ✓ Fi.CI.BAT: success " 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=20160304105241.GO10446@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@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