All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
To: "jani.nikula@linux.intel.com" <jani.nikula@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Runyan, Arthur J" <arthur.j.runyan@intel.com>,
	"Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH] drm/i915/cnp: Wa 1181: Fix Backlight issue
Date: Tue, 29 Aug 2017 17:14:45 +0000	[thread overview]
Message-ID: <1504026885.8120.7.camel@rdvivi-vienna> (raw)
In-Reply-To: <878ti2an88.fsf@intel.com>

On Tue, 2017-08-29 at 09:42 +0300, Jani Nikula wrote:
> On Tue, 29 Aug 2017, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > This workaround fixes a CNL PCH bug when changing
> > backlight from a lower frequency to a higher frequency.
> >
> > During random reboot cycles, display backlight seems to
> > be off/ dim for 2-3 mins.
> >
> > The only functional change on this patch is to
> > set bit 13 of 0xC2020 for CNL PCH.
> >
> > The rest of patch is organizing identation around
> > those bits definitions and re-organizing CFL workarounds.
> >
> > Cc: Arthur J Runyan <arthur.j.runyan@intel.com>
> > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_reg.h | 11 ++++++-----
> >  drivers/gpu/drm/i915/intel_pm.c | 27 +++++++++++++++++++++++++--
> >  2 files changed, 31 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index c59c590e45c4..31b1b1dfb754 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -7474,11 +7474,12 @@ enum {
> >  #define  FDI_RX_PHASE_SYNC_POINTER_EN	(1<<0)
> >  #define FDI_RX_CHICKEN(pipe)	_MMIO_PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
> >  
> > -#define SOUTH_DSPCLK_GATE_D	_MMIO(0xc2020)
> > -#define  PCH_DPLUNIT_CLOCK_GATE_DISABLE (1<<30)
> > -#define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
> > -#define  PCH_CPUNIT_CLOCK_GATE_DISABLE (1<<14)
> > -#define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
> > +#define SOUTH_DSPCLK_GATE_D			_MMIO(0xc2020)
> > +#define  PCH_DPLUNIT_CLOCK_GATE_DISABLE		(1<<30)
> > +#define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE	(1<<29)
> > +#define  PCH_CPUNIT_CLOCK_GATE_DISABLE		(1<<14)
> > +#define  CNP_PWM_CGE_GATING_DISABLE		(1<<13)
> 
> Only add this one line, please don't reshuffle the rest.

yep... my momentary OCD took over and fixed indentation around what I
was touching to avoid extra patch...

> 
> > +#define  PCH_LP_PARTITION_LEVEL_DISABLE		(1<<12)
> >  
> >  /* CPU: FDI_TX */
> >  #define _FDI_TXA_CTL            0x60100
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 88bbbc44c00d..5a4b41ea0c3a 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -8264,8 +8264,19 @@ static void gen8_set_l3sqc_credits(struct drm_i915_private *dev_priv,
> >  	I915_WRITE(GEN7_MISCCPCTL, misccpctl);
> >  }
> >  
> > +static void cnp_init_clock_gating(struct drm_i915_private *dev_priv)
> > +{
> > +	if (!HAS_PCH_CNP(dev_priv))
> > +		return;
> 
> Is this for CFL without CNP?

Nope. CNP only.

So far we have CFL with KBP and CNP
and we have CNL with CNP but who know what we might have in the future,
so I preferred to skip inside the function instead of adding 2 ifs
outside and/or have to fix it later.

> 
> BR,
> Jani.
> 
> > +
> > +	/* Wa #1181 */
> > +	I915_WRITE(SOUTH_DSPCLK_GATE_D, CNP_PWM_CGE_GATING_DISABLE);
> > +}
> > +
> >  static void cannonlake_init_clock_gating(struct drm_i915_private *dev_priv)
> >  {
> > +	cnp_init_clock_gating(dev_priv);
> > +
> >  	/* This is not an Wa. Enable for better image quality */
> >  	I915_WRITE(_3D_CHICKEN3,
> >  		   _MASKED_BIT_ENABLE(_3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE));
> > @@ -8285,6 +8296,16 @@ static void cannonlake_init_clock_gating(struct drm_i915_private *dev_priv)
> >  			   SARBUNIT_CLKGATE_DIS);
> >  }
> >  
> > +static void coffeelake_init_clock_gating(struct drm_i915_private *dev_priv)
> > +{
> > +	cnp_init_clock_gating(dev_priv);
> > +	gen9_init_clock_gating(dev_priv);
> > +
> > +	/* WaFbcNukeOnHostModify:cfl */
> > +	I915_WRITE(ILK_DPFC_CHICKEN, I915_READ(ILK_DPFC_CHICKEN) |
> > +		   ILK_DPFC_NUKE_ON_ANY_MODIFICATION);
> > +}
> > +
> >  static void kabylake_init_clock_gating(struct drm_i915_private *dev_priv)
> >  {
> >  	gen9_init_clock_gating(dev_priv);
> > @@ -8299,7 +8320,7 @@ static void kabylake_init_clock_gating(struct drm_i915_private *dev_priv)
> >  		I915_WRITE(GEN6_UCGCTL1, I915_READ(GEN6_UCGCTL1) |
> >  			   GEN6_GAMUNIT_CLOCK_GATE_DISABLE);
> >  
> > -	/* WaFbcNukeOnHostModify:kbl,cfl */
> > +	/* WaFbcNukeOnHostModify:kbl */
> >  	I915_WRITE(ILK_DPFC_CHICKEN, I915_READ(ILK_DPFC_CHICKEN) |
> >  		   ILK_DPFC_NUKE_ON_ANY_MODIFICATION);
> >  }
> > @@ -8767,9 +8788,11 @@ void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
> >  {
> >  	if (IS_CANNONLAKE(dev_priv))
> >  		dev_priv->display.init_clock_gating = cannonlake_init_clock_gating;
> > +	else if (IS_COFFEELAKE(dev_priv))
> > +		dev_priv->display.init_clock_gating = coffeelake_init_clock_gating;
> >  	else if (IS_SKYLAKE(dev_priv))
> >  		dev_priv->display.init_clock_gating = skylake_init_clock_gating;
> > -	else if (IS_KABYLAKE(dev_priv) || IS_COFFEELAKE(dev_priv))
> > +	else if (IS_KABYLAKE(dev_priv))
> >  		dev_priv->display.init_clock_gating = kabylake_init_clock_gating;
> >  	else if (IS_BROXTON(dev_priv))
> >  		dev_priv->display.init_clock_gating = bxt_init_clock_gating;
> 

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

  reply	other threads:[~2017-08-29 17:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29  5:07 [PATCH] drm/i915/cnp: Wa 1181: Fix Backlight issue Rodrigo Vivi
2017-08-29  5:28 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-29  6:34 ` ✓ Fi.CI.IGT: " Patchwork
2017-08-29  6:42 ` [PATCH] " Jani Nikula
2017-08-29 17:14   ` Vivi, Rodrigo [this message]
2017-08-31  4:52   ` Rodrigo Vivi
2017-09-05 18:42     ` Pandiyan, Dhinakaran
2017-09-05 19:16       ` Rodrigo Vivi
2017-08-31 11:55 ` ✓ Fi.CI.BAT: success for drm/i915/cnp: Wa 1181: Fix Backlight issue (rev2) Patchwork
2017-08-31 16:47 ` ✓ Fi.CI.IGT: " 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=1504026885.8120.7.camel@rdvivi-vienna \
    --to=rodrigo.vivi@intel.com \
    --cc=arthur.j.runyan@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.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.