All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Cc: Intel Graphics <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/3] drm/i915: Initialize CHV digital lock detect threshold
Date: Tue, 3 Mar 2015 17:38:29 +0200	[thread overview]
Message-ID: <20150303153829.GF11371@intel.com> (raw)
In-Reply-To: <1425395592-18432-1-git-send-email-vijay.a.purushothaman@linux.intel.com>

On Tue, Mar 03, 2015 at 08:43:12PM +0530, Vijay Purushothaman wrote:
> Initialize lock detect threshold and select coarse threshold for the
> case where M2 fraction division is disabled.
> 
> v2: Split the changes into multiple smaller patches based on review by
> Ville
> 
> v3: Addressed rest of the review comments. Clear out the old bits before
> we modify those bits as part of RMW
> 
> Signed-off-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h      |    1 +
>  drivers/gpu/drm/i915/intel_display.c |   13 +++++++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 8200e98..1a0f94e 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -1046,6 +1046,7 @@ enum skl_disp_power_wells {
>  #define _CHV_PLL_DW9_CH0		0x8024
>  #define _CHV_PLL_DW9_CH1		0x81A4
>  #define  DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT		1 /* 3 bits */
> +#define  DPIO_CHV_INT_LOCK_THRESHOLD_MASK		(7 << 1)
>  #define  DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE	1 /* 1: coarse & 0 : fine  */
>  #define CHV_PLL_DW9(ch) _PIPE(ch, _CHV_PLL_DW9_CH0, _CHV_PLL_DW9_CH1)
>  
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 15904a8..a6b5786 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6176,11 +6176,24 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
>  		dpio_val |= (2 << DPIO_CHV_FEEDFWD_GAIN_SHIFT);
>  		vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW3(port), dpio_val);
>  
> +		/* Program digital lock detect threshold */
> +		dpio_val = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW9(port));
> +		dpio_val &= ~DPIO_CHV_INT_LOCK_THRESHOLD_MASK;
> +		dpio_val |= (0x5 << DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT);

Missing
 dpio_val &= ~DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE;
here.

So I think to avoid such mistakes it's best to rewrite this too as:

val = read(PLL_DW9)
val &= ~(DPIO_CHV_INT_LOCK_THRESHOLD_MASK | DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE);
val |= 0x5 << DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT)
if (!bestm2_frac)
	val |= DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE;
write(PLL_DW9, val);

> +		vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW9(port), dpio_val);
> +
>  	} else {
>  		/* M2 fraction division disable */
>  		dpio_val = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW3(port));
>  		dpio_val &= ~DPIO_CHV_FRAC_DIV_EN;
>  		vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW3(port), dpio_val);
> +
> +		/* Program digital lock detect threshold */
> +		dpio_val = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW9(port));
> +		dpio_val &= ~DPIO_CHV_INT_LOCK_THRESHOLD_MASK;
> +		dpio_val |= (0x5 << DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT);
> +		dpio_val |= DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE;
> +		vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW9(port), dpio_val);
>  	}
>  
>  	/* Loop filter */
> -- 
> 1.7.9.5
> 
> _______________________________________________
> 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-03-03 15:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 18:31 [PATCH] drm/i915: More DPIO magic for CHV HDMI & DP Vijay Purushothaman
2015-01-30 11:09 ` Ville Syrjälä
2015-02-12 13:19   ` Purushothaman, Vijay A
2015-02-16  9:37   ` [v2 0/5] " Vijay Purushothaman
2015-02-16  9:37     ` [v2 1/5] drm/i915: Add new PHY reg definitions for lock threshold Vijay Purushothaman
2015-02-16 11:21       ` Ville Syrjälä
2015-02-16  9:37     ` [v2 2/5] drm/i915: Limit max VCO supported in CHV to 6.48GHz Vijay Purushothaman
2015-02-16 11:21       ` Ville Syrjälä
2015-02-23 16:13         ` Daniel Vetter
2015-03-03 14:57           ` Purushothaman, Vijay A
2015-03-05 15:52         ` Daniel Vetter
2015-03-05 15:59           ` Ville Syrjälä
2015-02-16  9:38     ` [v2 3/5] drm/i915: Disable M2 frac division for integer case Vijay Purushothaman
2015-02-16 11:23       ` Ville Syrjälä
2015-03-03 15:11         ` [PATCH 1/3] " Vijay Purushothaman
2015-03-03 15:36           ` Ville Syrjälä
2015-03-05 13:49             ` Purushothaman, Vijay A
2015-03-05 14:00             ` Vijay Purushothaman
2015-03-10  9:23               ` Daniel Vetter
2015-02-16  9:38     ` [v2 4/5] drm/i915: Initialize CHV digital lock detect threshold Vijay Purushothaman
2015-02-16 11:27       ` Ville Syrjälä
2015-03-03 15:13         ` [PATCH 2/3] " Vijay Purushothaman
2015-03-03 15:38           ` Ville Syrjälä [this message]
2015-03-05 13:50             ` Purushothaman, Vijay A
2015-03-05 14:02             ` Vijay Purushothaman
2015-02-16  9:38     ` [v2 5/5] drm/i915: Update prop, int co-eff and gain threshold for CHV Vijay Purushothaman
2015-02-16 11:32       ` Ville Syrjälä
2015-03-03 14:59         ` Purushothaman, Vijay A
2015-03-03 15:14         ` [PATCH 3/3] " Vijay Purushothaman
2015-03-03 15:45           ` Ville Syrjälä
2015-03-05 14:03             ` Vijay Purushothaman
2015-03-05 14:35               ` Ville Syrjälä
2015-02-23 16:13     ` [v2 0/5] More DPIO magic for CHV HDMI & DP Daniel Vetter
2015-02-10 12:43 ` [PATCH] drm/i915: " Jani Nikula
2015-02-12 13:20   ` Purushothaman, Vijay A

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=20150303153829.GF11371@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vijay.a.purushothaman@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.