public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915/gen9: Compute data rates for all planes on first commit
Date: Mon, 13 Jun 2016 16:50:31 +0200	[thread overview]
Message-ID: <20160613145031.GG1338@phenom.ffwll.local> (raw)
In-Reply-To: <1465510495-30302-3-git-send-email-matthew.d.roper@intel.com>

On Thu, Jun 09, 2016 at 03:14:54PM -0700, Matt Roper wrote:
> When we sanitize our DDB and watermark info during the first atomic
> commit, we need to calculate the total data rate.  Since we haven't
> explicitly added the planes for each CRTC to our atomic state, the total
> data rate calculation will try to use the cached values from a previous
> commit (which are 0 since there was no previous commit); this result is
> incorrect if we inherited any active planes from the BIOS.
> 
> During our very first atomic commit, we need to explicitly add all
> active planes to the atomic state to ensure that valid data rate values
> are calculated for them.  Subsequent commits will then have valid cached
> values to fall back on.
> 
> Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 0cd38ca..ba08639 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3933,6 +3933,18 @@ skl_compute_ddb(struct drm_atomic_state *state)
>  		if (IS_ERR(cstate))
>  			return PTR_ERR(cstate);
>  
> +		/*
> +		 * If this is our first commit after hw readout, we don't have
> +		 * valid data rate values cached.  Add all planes to ensure we
> +		 * calculate a valid data rate.
> +		 */
> +		if (dev_priv->wm.distrust_bios_wm) {
> +			ret = drm_atomic_add_affected_planes(state,
> +							     &intel_crtc->base);

Again, imo should be pulled out. Other wm code probably has the exact same
bug.
-Daniel

> +			if (ret)
> +				return ret;
> +		}
> +
>  		ret = skl_allocate_pipe_ddb(cstate, ddb);
>  		if (ret)
>  			return ret;
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-06-13 14:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 22:14 [PATCH 0/3] SKL watermark fixes for !fbcon Matt Roper
2016-06-09 22:14 ` [PATCH 1/3] drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization Matt Roper
2016-06-13  8:59   ` Maarten Lankhorst
2016-06-13  9:02     ` Maarten Lankhorst
2016-06-13 14:49   ` Daniel Vetter
2016-06-17 21:00     ` Matt Roper
2016-06-20 12:44       ` Daniel Vetter
2016-06-09 22:14 ` [PATCH 2/3] drm/i915/gen9: Compute data rates for all planes on first commit Matt Roper
2016-06-13  9:04   ` Maarten Lankhorst
2016-06-13 14:50   ` Daniel Vetter [this message]
2016-06-17 21:03     ` Matt Roper
2016-06-20 12:47       ` Daniel Vetter
2016-06-09 22:14 ` [PATCH 3/3] drm/i915/gen9: Drop invalid WARN() during data rate calculation Matt Roper
2016-06-13  9:33   ` Maarten Lankhorst
2016-06-13  9:38     ` [PATCH i-g-t] kms_universal_plane: Add testcase for when no plane is visible on the crtc Maarten Lankhorst
2016-06-17 21:25     ` [PATCH 3/3] drm/i915/gen9: Drop invalid WARN() during data rate calculation Matt Roper
2016-06-10  6:24 ` ✗ Ro.CI.BAT: failure for SKL watermark fixes for !fbcon Patchwork
2016-06-10 14:20   ` Matt Roper
2016-06-10  7:28 ` [PATCH 0/3] " Jani Nikula
2016-06-10 14:17   ` Matt Roper
2016-06-10  8:48 ` Tvrtko Ursulin

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=20160613145031.GG1338@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --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