All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Deepak <deepak.s@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/15] drm/i915: Add encoder->post_pll_disable() hooks and move CHV clock buffer disables there
Date: Mon, 17 Aug 2015 14:53:22 +0300	[thread overview]
Message-ID: <20150817115322.GD5176@intel.com> (raw)
In-Reply-To: <55D16001.1080908@linux.intel.com>

On Mon, Aug 17, 2015 at 09:46:01AM +0530, Deepak wrote:
> 
> 
> On 07/09/2015 02:15 AM, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Move the CHV clock buffer disable from chv_disable_pll() to the new
> > encoder .post_pll_disable() hook. This is more symmetric since the
> > clock buffer enable happens from the .pre_pll_enable() hook.
> >
> > We'll have more use for the new hook soon.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >   drivers/gpu/drm/i915/intel_display.c | 15 ++++-----------
> >   drivers/gpu/drm/i915/intel_dp.c      | 23 +++++++++++++++++++++++
> >   drivers/gpu/drm/i915/intel_drv.h     |  1 +
> >   drivers/gpu/drm/i915/intel_hdmi.c    | 23 +++++++++++++++++++++++
> >   4 files changed, 51 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 3df9cb2..db518a7 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -1851,17 +1851,6 @@ static void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
> >   	val &= ~DPIO_DCLKP_EN;
> >   	vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port), val);
> >   
> > -	/* disable left/right clock distribution */
> > -	if (pipe != PIPE_B) {
> > -		val = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW5_CH0);
> > -		val &= ~(CHV_BUFLEFTENA1_MASK | CHV_BUFRIGHTENA1_MASK);
> > -		vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW5_CH0, val);
> > -	} else {
> > -		val = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW1_CH1);
> > -		val &= ~(CHV_BUFLEFTENA2_MASK | CHV_BUFRIGHTENA2_MASK);
> > -		vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW1_CH1, val);
> > -	}
> > -
> >   	mutex_unlock(&dev_priv->sb_lock);
> >   }
> >   
> > @@ -6171,6 +6160,10 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
> >   			i9xx_disable_pll(intel_crtc);
> >   	}
> >   
> > +	for_each_encoder_on_crtc(dev, crtc, encoder)
> > +		if (encoder->post_pll_disable)
> > +			encoder->post_pll_disable(encoder);
> > +
> We call "vlv_force_pll_off" in vlv_power_sequencer_kick which call 
> chv_disablepll.
> Should we add the "post_pll_disable"in force pll off?

Nope. .post_pll_disable() is the counterpart to .pre_pll_enable() which
we don't use either in the pps kick procedure.

Apparently we don't need to concern ourselves with the clock
channel/districtution setp to make the pps kick work. Well, it's either
that, or we've just been lucky and those end up being set up in a good
way by accident. But now that you mention it, I do start wonder a bit
how it really works. So this is probably something I should test more
thoroughly at some point.

> >   	if (!IS_GEN2(dev))
> >   		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
> >   }
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > index 32d7e43..40b8430 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -2906,6 +2906,28 @@ static void chv_dp_pre_pll_enable(struct intel_encoder *encoder)
> >   	mutex_unlock(&dev_priv->sb_lock);
> >   }
> >   
> > +static void chv_dp_post_pll_disable(struct intel_encoder *encoder)
> > +{
> > +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > +	enum pipe pipe = to_intel_crtc(encoder->base.crtc)->pipe;
> > +	u32 val;
> > +
> > +	mutex_lock(&dev_priv->sb_lock);
> > +
> > +	/* disable left/right clock distribution */
> > +	if (pipe != PIPE_B) {
> > +		val = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW5_CH0);
> > +		val &= ~(CHV_BUFLEFTENA1_MASK | CHV_BUFRIGHTENA1_MASK);
> > +		vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW5_CH0, val);
> > +	} else {
> > +		val = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW1_CH1);
> > +		val &= ~(CHV_BUFLEFTENA2_MASK | CHV_BUFRIGHTENA2_MASK);
> > +		vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW1_CH1, val);
> > +	}
> > +
> > +	mutex_unlock(&dev_priv->sb_lock);
> > +}
> > +
> >   /*
> >    * Native read with retry for link status and receiver capability reads for
> >    * cases where the sink may still be asleep.
> > @@ -5931,6 +5953,7 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
> >   		intel_encoder->pre_enable = chv_pre_enable_dp;
> >   		intel_encoder->enable = vlv_enable_dp;
> >   		intel_encoder->post_disable = chv_post_disable_dp;
> > +		intel_encoder->post_pll_disable = chv_dp_post_pll_disable;
> >   	} else if (IS_VALLEYVIEW(dev)) {
> >   		intel_encoder->pre_pll_enable = vlv_dp_pre_pll_enable;
> >   		intel_encoder->pre_enable = vlv_pre_enable_dp;
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index 4f3b708..42fa135 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -148,6 +148,7 @@ struct intel_encoder {
> >   	void (*mode_set)(struct intel_encoder *intel_encoder);
> >   	void (*disable)(struct intel_encoder *);
> >   	void (*post_disable)(struct intel_encoder *);
> > +	void (*post_pll_disable)(struct intel_encoder *);
> >   	/* Read out the current hw state of this connector, returning true if
> >   	 * the encoder is active. If the encoder is enabled it also set the pipe
> >   	 * it is connected to in the pipe parameter. */
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> > index 9f79afb..86b1a2c 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -1678,6 +1678,28 @@ static void chv_hdmi_pre_pll_enable(struct intel_encoder *encoder)
> >   	mutex_unlock(&dev_priv->sb_lock);
> >   }
> >   
> > +static void chv_hdmi_post_pll_disable(struct intel_encoder *encoder)
> > +{
> > +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > +	enum pipe pipe = to_intel_crtc(encoder->base.crtc)->pipe;
> > +	u32 val;
> > +
> > +	mutex_lock(&dev_priv->sb_lock);
> > +
> > +	/* disable left/right clock distribution */
> > +	if (pipe != PIPE_B) {
> > +		val = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW5_CH0);
> > +		val &= ~(CHV_BUFLEFTENA1_MASK | CHV_BUFRIGHTENA1_MASK);
> > +		vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW5_CH0, val);
> > +	} else {
> > +		val = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW1_CH1);
> > +		val &= ~(CHV_BUFLEFTENA2_MASK | CHV_BUFRIGHTENA2_MASK);
> > +		vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW1_CH1, val);
> > +	}
> > +
> > +	mutex_unlock(&dev_priv->sb_lock);
> > +}
> > +
> >   static void vlv_hdmi_post_disable(struct intel_encoder *encoder)
> >   {
> >   	struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
> > @@ -2073,6 +2095,7 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port)
> >   		intel_encoder->pre_enable = chv_hdmi_pre_enable;
> >   		intel_encoder->enable = vlv_enable_hdmi;
> >   		intel_encoder->post_disable = chv_hdmi_post_disable;
> > +		intel_encoder->post_pll_disable = chv_hdmi_post_pll_disable;
> >   	} else if (IS_VALLEYVIEW(dev)) {
> >   		intel_encoder->pre_pll_enable = vlv_hdmi_pre_pll_enable;
> >   		intel_encoder->pre_enable = vlv_hdmi_pre_enable;
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2015-08-17 11:53 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 20:45 [PATCH 00/15] drm/i915: CHV DPIO power gating, take two ville.syrjala
2015-07-08 20:45 ` [PATCH 01/15] drm/i915: Always program m2 fractional value on CHV ville.syrjala
2015-08-17  2:19   ` Deepak
2015-08-17 11:45     ` Ville Syrjälä
2015-08-26  8:11       ` Deepak
2015-07-08 20:45 ` [PATCH 02/15] drm/i915: Always program unique transition scale for CHV ville.syrjala
2015-08-17  2:31   ` Deepak
2015-07-08 20:45 ` [PATCH 03/15] drm/i915: Add encoder->post_pll_disable() hooks and move CHV clock buffer disables there ville.syrjala
2015-08-17  4:16   ` Deepak
2015-08-17 11:53     ` Ville Syrjälä [this message]
2015-08-26  8:14       ` Deepak
2015-07-08 20:45 ` [PATCH 04/15] drm/i915: Move DPIO port init earlier ville.syrjala
2015-08-17  4:18   ` Deepak
2015-07-08 20:45 ` [PATCH 05/15] drm/i915: Add locking around chv_phy_control_init() ville.syrjala
2015-08-17  4:23   ` Deepak
2015-07-08 20:45 ` [PATCH 06/15] drm/i915: Move VLV/CHV prepare_pll later ville.syrjala
2015-08-17  4:36   ` Deepak
2015-08-17  4:39   ` Deepak
2015-07-08 20:45 ` [PATCH 07/15] drm/i915: Add vlv_dport_to_phy() ville.syrjala
2015-08-17  4:56   ` Deepak
2015-08-26  8:24   ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 08/15] drm/i915: Implement PHY lane power gating for CHV ville.syrjala
2015-08-19  1:48   ` Deepak
2015-08-26  8:27   ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 09/15] drm/i915: Trick CL2 into life on CHV when using pipe B with port B ville.syrjala
2015-08-19  2:17   ` Deepak
2015-08-19 11:29     ` Ville Syrjälä
2015-08-26 12:36       ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 10/15] drm/i915: Force common lane on for the PPS kick on CHV ville.syrjala
2015-07-10  7:56   ` [PATCH v2 " ville.syrjala
2015-08-19  2:21   ` [PATCH " Deepak
2015-08-19 11:32     ` Ville Syrjälä
2015-07-08 20:45 ` [PATCH 11/15] drm/i915: Enable DPIO SUS clock gating " ville.syrjala
2015-08-19 13:09   ` Deepak
2015-07-08 20:45 ` [PATCH 12/15] drm/i915: Force CL2 off in CHV x1 PHY ville.syrjala
2015-08-19 13:22   ` Deepak
2015-08-19 13:39     ` Ville Syrjälä
2015-08-26 12:38       ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 13/15] drm/i915: Clean up CHV lane soft reset programming ville.syrjala
2015-07-09 16:27   ` Daniel Vetter
2015-07-09 17:14   ` [PATCH v2 " ville.syrjala
2015-08-27  4:25   ` [PATCH " Deepak
2015-07-08 20:46 ` [PATCH 14/15] drm/i915: Add some CHV DPIO lane power state asserts ville.syrjala
2015-08-27  4:36   ` Deepak
2015-08-27 11:02     ` Ville Syrjälä
2015-08-31 10:47       ` Deepak
2015-07-08 20:46 ` [PATCH 15/15] drm/i915: Add CHV PHY LDO power sanity checks ville.syrjala
2015-08-27  4:39   ` Deepak
2015-09-01  9:45     ` Daniel Vetter
2015-07-09 13:24 ` [PATCH 00/15] drm/i915: CHV DPIO power gating, take two Deepak

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=20150817115322.GD5176@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=deepak.s@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.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.