public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Manasi Navare <manasi.d.navare@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/7] drm/i915/cnl: Fix, simplify and unify wrpll variable sizes.
Date: Tue, 14 Nov 2017 13:09:30 -0800	[thread overview]
Message-ID: <20171114210930.GB18077@intel.com> (raw)
In-Reply-To: <20171114194759.24541-4-rodrigo.vivi@intel.com>

On Tue, Nov 14, 2017 at 11:47:55AM -0800, Rodrigo Vivi wrote:
> - 64 bits is not needed for afe_clock now we don't convert
>   that to Hz.
> - 16 bits is not enough for all dco stuff.
> - unsigned is not relevant/needed for all divisors values.
> 

Yup great catch, DCO stuff needs 3 bytes so we need to define it as
u32.

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com

> Cc: Mika Kahola <mika.kahola@intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> Cc: James Ausmus <james.ausmus@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dpll_mgr.c | 30 ++++++++++++------------------
>  1 file changed, 12 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> index db7afd314462..fba969cbda37 100644
> --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> @@ -2110,10 +2110,8 @@ static bool cnl_ddi_pll_get_hw_state(struct drm_i915_private *dev_priv,
>  	return ret;
>  }
>  
> -static void cnl_wrpll_get_multipliers(unsigned int bestdiv,
> -				      unsigned int *pdiv,
> -				      unsigned int *qdiv,
> -				      unsigned int *kdiv)
> +static void cnl_wrpll_get_multipliers(int bestdiv, int *pdiv,
> +				      int *qdiv, int *kdiv)
>  {
>  	/* even dividers */
>  	if (bestdiv % 2 == 0) {
> @@ -2151,9 +2149,9 @@ static void cnl_wrpll_get_multipliers(unsigned int bestdiv,
>  	}
>  }
>  
> -static void cnl_wrpll_params_populate(struct skl_wrpll_params *params, uint32_t dco_freq,
> -				      uint32_t ref_freq, uint32_t pdiv, uint32_t qdiv,
> -				      uint32_t kdiv)
> +static void cnl_wrpll_params_populate(struct skl_wrpll_params *params,
> +				      u32 dco_freq, u32 ref_freq,
> +				      int pdiv, int qdiv, int kdiv)
>  {
>  	switch (kdiv) {
>  	case 1:
> @@ -2202,23 +2200,19 @@ cnl_ddi_calculate_wrpll(int clock,
>  			struct drm_i915_private *dev_priv,
>  			struct skl_wrpll_params *wrpll_params)
>  {
> -	uint64_t afe_clock = clock * 5;
> -	unsigned int dco_min = 7998 * KHz(1);
> -	unsigned int dco_max = 10000 * KHz(1);
> -	unsigned int dco_mid = (dco_min + dco_max) / 2;
> -
> +	u32 afe_clock = clock * 5;
> +	u32 dco_min = 7998 * KHz(1);
> +	u32 dco_max = 10000 * KHz(1);
> +	u32 dco_mid = (dco_min + dco_max) / 2;
>  	static const int dividers[] = {  2,  4,  6,  8, 10, 12,  14,  16,
>  					 18, 20, 24, 28, 30, 32,  36,  40,
>  					 42, 44, 48, 50, 52, 54,  56,  60,
>  					 64, 66, 68, 70, 72, 76,  78,  80,
>  					 84, 88, 90, 92, 96, 98, 100, 102,
>  					  3,  5,  7,  9, 15, 21 };
> -	unsigned int d, dco;
> -	unsigned int dco_centrality = 0;
> -	unsigned int best_dco_centrality = 999999;
> -	unsigned int best_div = 0;
> -	unsigned int best_dco = 0;
> -	unsigned int pdiv = 0, qdiv = 0, kdiv = 0;
> +	u32 dco, best_dco = 0, dco_centrality = 0;
> +	u32 best_dco_centrality = 999999;
> +	int d, best_div = 0, pdiv = 0, qdiv = 0, kdiv = 0;
>  
>  	for (d = 0; d < ARRAY_SIZE(dividers); d++) {
>  		dco = afe_clock * dividers[d];
> -- 
> 2.13.6
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-11-14 21:06 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 19:47 [PATCH 0/7] WRPLL fixes for HDMI 2.0 on Cannonlake Rodrigo Vivi
2017-11-14 19:47 ` [PATCH 1/7] drm/i915/cnl: Remove spurious central_freq Rodrigo Vivi
2017-11-14 20:40   ` Manasi Navare
2017-11-14 19:47 ` [PATCH 2/7] drm/i915/cnl: Remove useless conversion Rodrigo Vivi
2017-11-14 20:56   ` Manasi Navare
2017-11-15 12:52     ` Jani Nikula
2017-11-14 19:47 ` [PATCH 3/7] drm/i915/cnl: Fix, simplify and unify wrpll variable sizes Rodrigo Vivi
2017-11-14 21:09   ` Manasi Navare [this message]
2017-11-14 19:47 ` [PATCH 4/7] drm/i915/cnl: Fix wrpll math for higher freqs Rodrigo Vivi
2017-11-14 20:00   ` Ville Syrjälä
2017-11-14 20:09     ` Rodrigo Vivi
2017-11-14 20:26       ` Ville Syrjälä
2017-11-14 23:42     ` [PATCH] " Rodrigo Vivi
2017-11-16 12:47       ` Ville Syrjälä
2017-11-15  8:06   ` [PATCH 4/7] " Mika Kahola
2017-11-15 18:04     ` Rodrigo Vivi
2017-11-16 10:52       ` Mika Kahola
2017-11-14 19:47 ` [PATCH 5/7] drm/i915/cnl: Don't blindly replace qdiv Rodrigo Vivi
2017-11-14 23:34   ` Manasi Navare
2017-11-14 19:47 ` [PATCH 6/7] drm/i915/cnl: Write dco_fraction calculation as spec Rodrigo Vivi
2017-11-14 20:22   ` Ville Syrjälä
2017-11-14 20:43     ` Rodrigo Vivi
2017-11-14 20:46     ` Ville Syrjälä
2017-11-14 21:29       ` Rodrigo Vivi
2017-11-14 23:25         ` Rodrigo Vivi
2017-11-14 23:51       ` [PATCH] drm/i915/cnl: Simplify dco_fraction calculation Rodrigo Vivi
2017-11-15 11:09         ` Ville Syrjälä
2017-11-14 19:47 ` [PATCH 7/7] drm/i915/cnl: Extend HDMI 2.0 support to CNL Rodrigo Vivi
     [not found]   ` <20171115111448.GZ10981@intel.com>
2017-11-15 18:22     ` Rodrigo Vivi
2017-11-15 18:31       ` Ville Syrjälä
2017-11-15 18:37         ` Rodrigo Vivi
2017-11-15 18:42         ` [PATCH] " Rodrigo Vivi
2017-11-14 20:47 ` ✗ Fi.CI.BAT: failure for WRPLL fixes for HDMI 2.0 on Cannonlake Patchwork
2017-11-15  0:05 ` ✓ Fi.CI.BAT: success for WRPLL fixes for HDMI 2.0 on Cannonlake. (rev2) Patchwork
2017-11-15  0:23 ` ✓ Fi.CI.BAT: success for WRPLL fixes for HDMI 2.0 on Cannonlake. (rev3) Patchwork
2017-11-15  3:27 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-11-16 17:02 ` ✓ Fi.CI.BAT: success for WRPLL fixes for HDMI 2.0 on Cannonlake. (rev4) Patchwork
2017-11-16 17:51 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-16 17:53 ` [PATCH 0/7] WRPLL fixes for HDMI 2.0 on Cannonlake Rodrigo Vivi
     [not found] <<20171115110931.GY10981@intel.com>
2017-11-15 18:42 ` [PATCH] drm/i915/cnl: Simplify dco_fraction calculation Rodrigo Vivi
2017-11-15 18:46   ` Ville Syrjälä
2017-11-15 19:09 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-15 20:30 ` ✗ Fi.CI.IGT: warning " 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=20171114210930.GB18077@intel.com \
    --to=manasi.d.navare@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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