public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Purushothaman, Vijay A" <vijay.a.purushothaman@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Intel Graphics <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/3] drm/i915: Disable M2 frac division for integer case
Date: Thu, 05 Mar 2015 19:19:30 +0530	[thread overview]
Message-ID: <54F85EEA.6030304@linux.intel.com> (raw)
In-Reply-To: <20150303153623.GE11371@intel.com>

On 3/3/2015 9:06 PM, Ville Syrjälä wrote:
> On Tue, Mar 03, 2015 at 08:41:54PM +0530, Vijay Purushothaman wrote:
>> v2 : Handle M2 frac division for both M2 frac and int cases
>>
>> v3 : Addressed Ville's review comments. Cleared the old bits for 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 |   24 ++++++++++++++++++------
>>   2 files changed, 19 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
>> index 55143cb..8200e98 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -1029,6 +1029,7 @@ enum skl_disp_power_wells {
>>   #define  DPIO_CHV_FIRST_MOD		(0 << 8)
>>   #define  DPIO_CHV_SECOND_MOD		(1 << 8)
>>   #define  DPIO_CHV_FEEDFWD_GAIN_SHIFT	0
>> +#define  DPIO_CHV_FEEDFWD_GAIN_MASK		(0xF << 0)
>>   #define CHV_PLL_DW3(ch) _PIPE(ch, _CHV_PLL_DW3_CH0, _CHV_PLL_DW3_CH1)
>>   
>>   #define _CHV_PLL_DW6_CH0		0x8018
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 7298796..15904a8 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -6131,6 +6131,7 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
>>   	enum dpio_channel port = vlv_pipe_to_channel(pipe);
>>   	u32 loopfilter, intcoeff;
>>   	u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac;
>> +	u32 dpio_val;
>>   	int refclk;
>>   
>>   	bestn = pipe_config->dpll.n;
>> @@ -6139,6 +6140,7 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
>>   	bestm2 = pipe_config->dpll.m2 >> 22;
>>   	bestp1 = pipe_config->dpll.p1;
>>   	bestp2 = pipe_config->dpll.p2;
>> +	dpio_val = 0;
>>   
>>   	/*
>>   	 * Enable Refclk and SSC
>> @@ -6163,13 +6165,23 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
>>   			DPIO_CHV_M1_DIV_BY_2 |
>>   			1 << DPIO_CHV_N_DIV_SHIFT);
>>   
>> -	/* M2 fraction division */
>> -	vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW2(port), bestm2_frac);
>> +	if (bestm2_frac) {
>> +		/* M2 fraction division */
>> +		vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW2(port), bestm2_frac);
>>   
>> -	/* M2 fraction division enable */
>> -	vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW3(port),
>> -		       DPIO_CHV_FRAC_DIV_EN |
>> -		       (2 << DPIO_CHV_FEEDFWD_GAIN_SHIFT));
>> +		/* M2 fraction division enable */
>> +		dpio_val = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW3(port));
>> +		dpio_val |= DPIO_CHV_FRAC_DIV_EN;
>> +		dpio_val &= ~DPIO_CHV_FEEDFWD_GAIN_MASK;
>> +		dpio_val |= (2 << DPIO_CHV_FEEDFWD_GAIN_SHIFT);
>> +		vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW3(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);
> You're not writing the feedfwd gain here. The register docs list it as
> 'Feedforwad gain for fractional mode/SSC mode PLL'. The SSC part there
> makes me think these bits might mean something even if the fractional
> divider is not used.
>
> At least I don't see any harm in setting it even if the fractional
> divider is not used. So with that in mind I'd probably write this as
> something like:
>
> val = read(PLL_DW3)
> val &= ~(FRAC_DIV_EN | FEEDFWD_GAIN_MASK)
> val |= 2 << FEEDFWD_GAIN_SHIFT;
> if (bestm2_trac)
> 	val |= FRAC_DIV_EN;
> write(PLL_DW3, val);
>
> This should also make it less likely we will accidentally update
> only one of the branches in the future when both need changing.
Makes sense. I will send v4 with this change and add your signed-off-by tag.

Thanks,
Vijay
>
>> +	}
>>   
>>   	/* Loop filter */
>>   	refclk = i9xx_get_refclk(crtc, 0);
>> -- 
>> 1.7.9.5
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2015-03-05 13:49 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 [this message]
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ä
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=54F85EEA.6030304@linux.intel.com \
    --to=vijay.a.purushothaman@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox