All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "Lisovskiy, Stanislav" <stanislav.lisovskiy@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/adl_p: Increase CDCLK by 15% if PSR2 is used
Date: Tue, 22 Mar 2022 13:16:41 +0000	[thread overview]
Message-ID: <76162c4c04cfd85b26963beaa8c6313e10d6c64e.camel@intel.com> (raw)
In-Reply-To: <20220322074812.GA2113@intel.com>

On Tue, 2022-03-22 at 09:48 +0200, Lisovskiy, Stanislav wrote:
> On Mon, Mar 21, 2022 at 06:58:39PM +0200, Souza, Jose wrote:
> > On Mon, 2022-03-21 at 12:49 +0200, Stanislav Lisovskiy wrote:
> > > We are currently getting FIFO underruns, in particular
> > > when PSR2 is enabled. There seem to be no existing workaround
> > > or patches, which can fix that issue(were expecting some recent
> > > selective fetch update and DBuf bw/SAGV fixes to help,
> > > which unfortunately didn't).
> > > Current idea is that it looks like for some reason the
> > > DBuf prefill time isn't enough once we exit PSR2, despite its
> > > theoretically correct.
> > > So bump it up a bit by 15%(minimum experimental amount required
> > > to get it working), if PSR2 is enabled.
> > > For PSR1 there is no need in this hack, so we limit it only
> > > to PSR2 and Alderlake.
> > > 
> > > v2: - Added comment(Jose Souza)
> > >     - Fixed 15% calculation(Jose Souza)
> > > 
> > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_cdclk.c | 26 ++++++++++++++++++++++
> > >  1 file changed, 26 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > > index 8888fda8b701..92d57869983a 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > > @@ -2325,6 +2325,32 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
> > >  					dev_priv->max_cdclk_freq));
> > >  	}
> > >  
> > > +
> > > +	/*
> > > +	 * HACK.  We are getting FIFO underruns, in particular
> > > +	 * when PSR2 is enabled. There seem to be no existing workaround
> > > +	 * or patches as of now.
> > > +	 * Current idea is that it looks like for some reason the
> > > +	 * DBuf prefill time isn't enough once we exit PSR2, despite its
> > > +	 * theoretically correct.
> > > +	 * So bump it up a bit by 15%(minimum experimental amount required
> > > +	 * to get it working), if PSR2 is enabled.
> > > +	 * For PSR1 there is no need in this hack, so we limit it only
> > > +	 * to PSR2 and Alderlake.
> > > +	 */
> > > +	if (IS_ALDERLAKE_P(dev_priv)) {
> > > +		struct intel_encoder *encoder;
> > > +
> > > +		for_each_intel_encoder_with_psr(&dev_priv->drm, encoder) {
> > > +			struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> > > +
> > > +			if (intel_dp->psr.psr2_enabled) {
> > 
> > Again, you can't use this, PSR could end up disabled when this atomic commit it applied.
> > Please use intel_crtc_state.has_psr2.
> 
> Yes, but if PSR2 is disabled - we don't need this hack, we can live with lower
> CDCLK then, thus saving power. And once PSR2 is enabled we'll have to switch it
> on. I intentionally didn't want to enable it always, if PSR2 is supported in principle - we care only if its indeed enabled.

The problem is that this code don't handle this cases.
intel_dp->psr.psr2_enabled has the current PSR2 state, while crtc_state have the future(as soon as this state is applied) PSR2 state.
You should avoid access global state as much as possible during the atomic check phase.

In a case like, PSR2 disabled going to to a state with PSR2 enabled will cause this workaround to not be applied.

> Also CDCLK is the last thing, which is being calculated, thats how architecture
> is designed, so we can rely on all the states here, if you mean that.
> 
> Even if this would be not working(not aware why but still), would anyway prefer
> to find someway to enable this only, when PSR2 is indeed enabled, otherwise
> we would be kind of wasting power..
> 
> 
> Stan
> 
> > 
> > 
> > > +				min_cdclk = DIV_ROUND_UP(min_cdclk * 115, 100);
> > > +				break;
> > > +			}
> > > +		}
> > > +	}
> > > +
> > >  	if (min_cdclk > dev_priv->max_cdclk_freq) {
> > >  		drm_dbg_kms(&dev_priv->drm,
> > >  			    "required cdclk (%d kHz) exceeds max (%d kHz)\n",
> > 


  reply	other threads:[~2022-03-22 13:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 10:49 [Intel-gfx] [PATCH] drm/i915/adl_p: Increase CDCLK by 15% if PSR2 is used Stanislav Lisovskiy
2022-03-21 11:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/adl_p: Increase CDCLK by 15% if PSR2 is used (rev2) Patchwork
2022-03-21 11:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-21 14:39 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-03-21 16:58 ` [Intel-gfx] [PATCH] drm/i915/adl_p: Increase CDCLK by 15% if PSR2 is used Souza, Jose
2022-03-22  7:48   ` Lisovskiy, Stanislav
2022-03-22 13:16     ` Souza, Jose [this message]
2022-03-22 13:30       ` Lisovskiy, Stanislav
2022-03-22 13:34         ` Souza, Jose
2022-03-21 17:01 ` Souza, Jose
2022-03-22  7:49   ` Lisovskiy, Stanislav
2022-03-22 13:36     ` Souza, Jose
2022-03-29 13:10       ` Lisovskiy, Stanislav
2022-03-29 13:24         ` Souza, Jose
2022-03-29 13:53           ` Lisovskiy, Stanislav
2022-03-22 13:55 ` [Intel-gfx] " Mark Pearson
2022-03-22 14:18   ` Lisovskiy, Stanislav
2022-03-22 14:23     ` [Intel-gfx] [External] " Mark Pearson
2022-03-23 15:47       ` Souza, Jose
  -- strict thread matches above, loose matches on Subject: below --
2022-03-18  8:52 [Intel-gfx] [PATCH] " Stanislav Lisovskiy
2022-03-18 12:21 ` Souza, Jose
2022-03-18 12:27   ` Souza, Jose
2022-03-18 14:22     ` Lisovskiy, Stanislav
2022-03-18 14:40       ` Souza, Jose
2022-03-18 14:19   ` Lisovskiy, Stanislav
2022-03-18 14:38     ` Souza, Jose
2022-03-18 14:45       ` Lisovskiy, Stanislav
2022-01-24  9:06 [Intel-gfx] [PATCH 4/4] drm/i915: Don't allocate extra ddb during async flip for DG2 Stanislav Lisovskiy
2022-03-18  8:48 ` [Intel-gfx] [PATCH] drm/i915/adl_p: Increase CDCLK by 15% if PSR2 is used Stanislav Lisovskiy

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=76162c4c04cfd85b26963beaa8c6313e10d6c64e.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stanislav.lisovskiy@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 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.