All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	"# v4 . 8+" <stable@vger.kernel.org>,
	Mahesh Kumar <mahesh1.kumar@intel.com>
Subject: Re: [PATCH] drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2.
Date: Wed, 31 May 2017 15:08:43 -0700	[thread overview]
Message-ID: <20170531220843.GC26862@mdroper-desk.amr.corp.intel.com> (raw)
In-Reply-To: <20170531154236.27180-1-maarten.lankhorst@linux.intel.com>

On Wed, May 31, 2017 at 05:42:36PM +0200, Maarten Lankhorst wrote:
> On some systems there can be a race condition in which no crtc state is
> added to the first atomic commit. This results in all crtc's having a
> null DDB allocation, causing a FIFO underrun on any update until the
> first modeset.
> 
> Changes since v1:
> - Do not take the connection_mutex, this is already done below.
> 
> Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Inspired-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Fixes: 98d39494d375 ("drm/i915/gen9: Compute DDB allocation at atomic
> check time (v4)")
> Cc: <stable@vger.kernel.org> # v4.8+
> Cc: Mahesh Kumar <mahesh1.kumar@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 936eef1634c7..fce4bc5ccc99 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4819,11 +4819,19 @@ skl_compute_wm(struct drm_atomic_state *state)
>  	struct drm_crtc_state *cstate;
>  	struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
>  	struct skl_wm_values *results = &intel_state->wm_results;
> +	struct drm_device *dev = state->dev;
>  	struct skl_pipe_wm *pipe_wm;
>  	bool changed = false;
>  	int ret, i;
>  
>  	/*
> +	 * When we distrust bios wm we always need to recompute to set the
> +	 * expected DDB allocations for each CRTC.
> +	 */
> +	if (to_i915(dev)->wm.distrust_bios_wm)
> +		changed = true;
> +
> +	/*
>  	 * If this transaction isn't actually touching any CRTC's, don't
>  	 * bother with watermark calculation.  Note that if we pass this
>  	 * test, we're guaranteed to hold at least one CRTC state mutex,
> @@ -4833,6 +4841,7 @@ skl_compute_wm(struct drm_atomic_state *state)
>  	 */
>  	for_each_new_crtc_in_state(state, crtc, cstate, i)
>  		changed = true;
> +
>  	if (!changed)
>  		return 0;
>  
> -- 
> 2.11.0
> 

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795

  parent reply	other threads:[~2017-05-31 22:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 15:15 [PATCH 0/3] Remaining patches for WM cleanup series Mahesh Kumar
2017-05-26 15:15 ` [PATCH 1/3] drm/i915/skl+: Don't trust cached ddb values Mahesh Kumar
2017-05-26 21:23   ` Rodrigo Vivi
2017-05-29  5:56     ` Mahesh Kumar
2017-05-30 10:00   ` Maarten Lankhorst
2017-05-30 12:56     ` Mahesh Kumar
2017-05-30 14:35       ` Lankhorst, Maarten
2017-05-31  7:56   ` [PATCH] drm/i915: Always recompute watermarks when distrust_bios_wm is set Maarten Lankhorst
2017-05-31  7:56     ` Maarten Lankhorst
2017-05-31 10:42     ` Mahesh Kumar
2017-05-31 10:59       ` Maarten Lankhorst
2017-05-31 15:42     ` [PATCH] drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2 Maarten Lankhorst
2017-05-31 17:43       ` Mahesh Kumar
2017-05-31 17:43         ` Mahesh Kumar
2017-05-31 22:08       ` Matt Roper [this message]
2017-05-26 15:15 ` [PATCH 2/3] drm/i915/skl: New ddb allocation algorithm Mahesh Kumar
2017-05-31 22:16   ` Matt Roper
2017-06-01  5:59     ` Mahesh Kumar
2017-05-26 15:15 ` [PATCH 3/3] drm/i915/skl+: consider max supported plane pixel rate while scaling Mahesh Kumar
2017-06-01  8:24   ` Maarten Lankhorst
2017-05-26 15:43 ` ✗ Fi.CI.BAT: warning for Remaining patches for WM cleanup series (rev3) 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=20170531220843.GC26862@mdroper-desk.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mahesh1.kumar@intel.com \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.