All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/6] drm/i915: Move VLV divider readout to intel_dpio_phy.c
Date: Fri, 13 May 2016 17:23:50 +0300	[thread overview]
Message-ID: <20160513142350.GB4329@intel.com> (raw)
In-Reply-To: <1463148903-6337-5-git-send-email-ander.conselvan.de.oliveira@intel.com>

On Fri, May 13, 2016 at 05:15:01PM +0300, Ander Conselvan de Oliveira wrote:
> Reading the dividers depends on sideband messaging, so it fits well if
> the other functions in intel_dpio_phy.c. The new function will also be
> used in a future patch.
> 
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h       |  2 ++
>  drivers/gpu/drm/i915/intel_display.c  | 11 +----------
>  drivers/gpu/drm/i915/intel_dpio_phy.c | 16 ++++++++++++++++
>  3 files changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 99dfacd..7dfa555 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -3640,6 +3640,8 @@ void vlv_phy_reset_lanes(struct intel_encoder *encoder);
>  void vlv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
>  			 u32 bestm1, u32 bestm2, u32 bestp1, u32 bestp2,
>  			 int port_clock, bool dp);
> +void vlv_phy_read_dividers(struct drm_i915_private *dev_priv,
> +			   enum pipe pipe, struct intel_dpll *clock);

..._pll_dividers() ?

>  
>  int intel_gpu_freq(struct drm_i915_private *dev_priv, int val);
>  int intel_freq_opcode(struct drm_i915_private *dev_priv, int val);
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 3e494ec..8d61263 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7806,22 +7806,13 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc,
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	int pipe = pipe_config->cpu_transcoder;
>  	struct intel_dpll clock;
> -	u32 mdiv;
>  	int refclk = 100000;
>  
>  	/* In case of DSI, DPLL will not be used */
>  	if ((pipe_config->dpll_hw_state.dpll & DPLL_VCO_ENABLE) == 0)
>  		return;
>  
> -	mutex_lock(&dev_priv->sb_lock);
> -	mdiv = vlv_dpio_read(dev_priv, pipe, VLV_PLL_DW3(pipe));
> -	mutex_unlock(&dev_priv->sb_lock);
> -
> -	clock.m1 = (mdiv >> DPIO_M1DIV_SHIFT) & 7;
> -	clock.m2 = mdiv & DPIO_M2DIV_MASK;
> -	clock.n = (mdiv >> DPIO_N_SHIFT) & 0xf;
> -	clock.p1 = (mdiv >> DPIO_P1_SHIFT) & 7;
> -	clock.p2 = (mdiv >> DPIO_P2_SHIFT) & 0x1f;
> +	vlv_phy_read_dividers(dev_priv, pipe, &clock);
>  
>  	pipe_config->port_clock = vlv_calc_dpll_params(refclk, &clock);
>  }
> diff --git a/drivers/gpu/drm/i915/intel_dpio_phy.c b/drivers/gpu/drm/i915/intel_dpio_phy.c
> index fcadc92..d28ef9f 100644
> --- a/drivers/gpu/drm/i915/intel_dpio_phy.c
> +++ b/drivers/gpu/drm/i915/intel_dpio_phy.c
> @@ -670,3 +670,19 @@ void vlv_phy_prepare_pll(struct intel_crtc *crtc, u32 bestn,
>  	vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW11(pipe), 0x87871000);
>  	mutex_unlock(&dev_priv->sb_lock);
>  }
> +
> +void vlv_phy_read_dividers(struct drm_i915_private *dev_priv,
> +			   enum pipe pipe, struct intel_dpll *clock)
> +{
> +	u32 mdiv;
> +
> +	mutex_lock(&dev_priv->sb_lock);
> +	mdiv = vlv_dpio_read(dev_priv, pipe, VLV_PLL_DW3(pipe));
> +	mutex_unlock(&dev_priv->sb_lock);
> +
> +	clock->m1 = (mdiv >> DPIO_M1DIV_SHIFT) & 7;
> +	clock->m2 = mdiv & DPIO_M2DIV_MASK;
> +	clock->n = (mdiv >> DPIO_N_SHIFT) & 0xf;
> +	clock->p1 = (mdiv >> DPIO_P1_SHIFT) & 7;
> +	clock->p2 = (mdiv >> DPIO_P2_SHIFT) & 0x1f;
> +}
> -- 
> 2.5.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2016-05-13 14:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 14:14 [PATCH 0/6] Move dpio access out of intel_display.c Ander Conselvan de Oliveira
2016-05-13 14:14 ` [PATCH 1/6] drm/i915: Rename struct dpll to struct intel_dpll Ander Conselvan de Oliveira
2016-05-13 14:29   ` Ville Syrjälä
2016-05-17  8:25     ` Ander Conselvan De Oliveira
2016-05-13 14:14 ` [PATCH 2/6] drm/i915: Move dpio code of VLV/CHV dpll enabling to intel_dpio_phy.c Ander Conselvan de Oliveira
2016-05-13 14:15 ` [PATCH 3/6] drm/i915: Merge vlv/chv _prepare_pll() with their enable counterpart Ander Conselvan de Oliveira
2016-05-13 14:15 ` [PATCH 4/6] drm/i915: Move VLV divider readout to intel_dpio_phy.c Ander Conselvan de Oliveira
2016-05-13 14:23   ` Ville Syrjälä [this message]
2016-05-13 14:15 ` [PATCH 5/6] drm/i915: Move CHV " Ander Conselvan de Oliveira
2016-05-13 14:27   ` Ville Syrjälä
2016-05-13 14:15 ` [PATCH 6/6] drm/i915: Move toggling of CHV DPIO_DCLKP_EN " Ander Conselvan de Oliveira
2016-05-13 14:25   ` Ville Syrjälä
2016-05-17  8:27     ` Ander Conselvan De Oliveira
2016-05-13 16:09 ` ✗ Ro.CI.BAT: failure for Move dpio access out of intel_display.c Patchwork
2016-05-17 12:26 ` [PATCH 0/6] " Daniel Vetter
2016-05-17 13:30   ` Ander Conselvan De Oliveira
2016-05-17 14:04     ` Daniel Vetter

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=20160513142350.GB4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ander.conselvan.de.oliveira@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.