All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Atwood, Matthew S" <matthew.s.atwood@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"De Marchi, Lucas" <lucas.demarchi@intel.com>
Subject: Re: [PATCH 09/22] drm/i915/tgl: re-indent code to prepare for DKL changes
Date: Mon, 22 Jul 2019 22:31:07 +0000	[thread overview]
Message-ID: <9b789a8ed865ea766cdc2a5c53d229aed6b0e434.camel@intel.com> (raw)
In-Reply-To: <20190713010940.17711-10-lucas.demarchi@intel.com>

On Fri, 2019-07-12 at 18:09 -0700, Lucas De Marchi wrote:
> The final save operation into pll_state of the calculations done will
> be different for DKL PHY. Prepare for that by reindenting code so
> it's
> easier to check for correctness. This one has no change in behavior.
> 
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 119 ++++++++++----
> ----
>  1 file changed, 66 insertions(+), 53 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> index 319a26a1ec10..7312a47f79ad 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> @@ -2804,60 +2804,73 @@ static bool icl_calc_mg_pll_state(struct
> intel_crtc_state *crtc_state,
>  	}
>  	ssc_steplog = 4;
>  
> -	pll_state->mg_pll_div0 = (m2div_rem > 0 ? MG_PLL_DIV0_FRACNEN_H
> : 0) |
> -				  MG_PLL_DIV0_FBDIV_FRAC(m2div_frac) |
> -				  MG_PLL_DIV0_FBDIV_INT(m2div_int);
> -
> -	pll_state->mg_pll_div1 = MG_PLL_DIV1_IREF_NDIVRATIO(iref_ndiv)
> |
> -				 MG_PLL_DIV1_DITHER_DIV_2 |
> -				 MG_PLL_DIV1_NDIVRATIO(1) |
> -				 MG_PLL_DIV1_FBPREDIV(m1div);
> -
> -	pll_state->mg_pll_lf = MG_PLL_LF_TDCTARGETCNT(tdc_targetcnt) |
> -			       MG_PLL_LF_AFCCNTSEL_512 |
> -			       MG_PLL_LF_GAINCTRL(1) |
> -			       MG_PLL_LF_INT_COEFF(int_coeff) |
> -			       MG_PLL_LF_PROP_COEFF(prop_coeff);
> -
> -	pll_state->mg_pll_frac_lock = MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32
> |
> -				      MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_3
> 2 |
> -				      MG_PLL_FRAC_LOCK_LOCKTHRESH(10) |
> -				      MG_PLL_FRAC_LOCK_DCODITHEREN |
> -				      MG_PLL_FRAC_LOCK_FEEDFWRDGAIN(fee
> dfwgain);
> -	if (use_ssc || m2div_rem > 0)
> -		pll_state->mg_pll_frac_lock |=
> MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN;
> -
> -	pll_state->mg_pll_ssc = (use_ssc ? MG_PLL_SSC_EN : 0) |
> -				MG_PLL_SSC_TYPE(2) |
> -				MG_PLL_SSC_STEPLENGTH(ssc_steplen) |
> -				MG_PLL_SSC_STEPNUM(ssc_steplog) |
> -				MG_PLL_SSC_FLLEN |
> -				MG_PLL_SSC_STEPSIZE(ssc_stepsize);
> -
> -	pll_state->mg_pll_tdc_coldst_bias = MG_PLL_TDC_COLDST_COLDSTART
> |
> -					    MG_PLL_TDC_COLDST_IREFINT_E
> N |
> -					    MG_PLL_TDC_COLDST_REFBIAS_S
> TART_PULSE_W(iref_pulse_w) |
> -					    MG_PLL_TDC_TDCOVCCORR_EN |
> -					    MG_PLL_TDC_TDCSEL(3);
> -
> -	pll_state->mg_pll_bias = MG_PLL_BIAS_BIAS_GB_SEL(3) |
> -				 MG_PLL_BIAS_INIT_DCOAMP(0x3F) |
> -				 MG_PLL_BIAS_BIAS_BONUS(10) |
> -				 MG_PLL_BIAS_BIASCAL_EN |
> -				 MG_PLL_BIAS_CTRIM(12) |
> -				 MG_PLL_BIAS_VREF_RDAC(4) |
> -				 MG_PLL_BIAS_IREFTRIM(iref_trim);
> -
> -	if (refclk_khz == 38400) {
> -		pll_state->mg_pll_tdc_coldst_bias_mask =
> MG_PLL_TDC_COLDST_COLDSTART;
> -		pll_state->mg_pll_bias_mask = 0;
> -	} else {
> -		pll_state->mg_pll_tdc_coldst_bias_mask = -1U;
> -		pll_state->mg_pll_bias_mask = -1U;
> -	}
> +	/* write pll_state calculations */
> +	{
> +		pll_state->mg_pll_div0 =
> +			(m2div_rem > 0 ? MG_PLL_DIV0_FRACNEN_H : 0) |
> +			MG_PLL_DIV0_FBDIV_FRAC(m2div_frac) |
> +			MG_PLL_DIV0_FBDIV_INT(m2div_int);
> +
> +		pll_state->mg_pll_div1 =
> +			MG_PLL_DIV1_IREF_NDIVRATIO(iref_ndiv) |
> +			MG_PLL_DIV1_DITHER_DIV_2 |
> +			MG_PLL_DIV1_NDIVRATIO(1) |
> +			MG_PLL_DIV1_FBPREDIV(m1div);
> +
> +		pll_state->mg_pll_lf =
> +			MG_PLL_LF_TDCTARGETCNT(tdc_targetcnt) |
> +			MG_PLL_LF_AFCCNTSEL_512 |
> +			MG_PLL_LF_GAINCTRL(1) |
> +			MG_PLL_LF_INT_COEFF(int_coeff) |
> +			MG_PLL_LF_PROP_COEFF(prop_coeff);
> +
> +		pll_state->mg_pll_frac_lock =
> +			MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32 |
> +			MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_32 |
> +			MG_PLL_FRAC_LOCK_LOCKTHRESH(10) |
> +			MG_PLL_FRAC_LOCK_DCODITHEREN |
> +			MG_PLL_FRAC_LOCK_FEEDFWRDGAIN(feedfwgain);
> +		if (use_ssc || m2div_rem > 0)
> +			pll_state->mg_pll_frac_lock |=
> +				MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN;
> +
> +		pll_state->mg_pll_ssc =
> +			(use_ssc ? MG_PLL_SSC_EN : 0) |
> +			MG_PLL_SSC_TYPE(2) |
> +			MG_PLL_SSC_STEPLENGTH(ssc_steplen) |
> +			MG_PLL_SSC_STEPNUM(ssc_steplog) |
> +			MG_PLL_SSC_FLLEN |
> +			MG_PLL_SSC_STEPSIZE(ssc_stepsize);
> +
> +		pll_state->mg_pll_tdc_coldst_bias =
> +			MG_PLL_TDC_COLDST_COLDSTART |
> +			MG_PLL_TDC_COLDST_IREFINT_EN |
> +			MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W(iref_pu
> lse_w) |
> +			MG_PLL_TDC_TDCOVCCORR_EN |
> +			MG_PLL_TDC_TDCSEL(3);
> +
> +		pll_state->mg_pll_bias =
> +			MG_PLL_BIAS_BIAS_GB_SEL(3) |
> +			MG_PLL_BIAS_INIT_DCOAMP(0x3F) |
> +			MG_PLL_BIAS_BIAS_BONUS(10) |
> +			MG_PLL_BIAS_BIASCAL_EN |
> +			MG_PLL_BIAS_CTRIM(12) |
> +			MG_PLL_BIAS_VREF_RDAC(4) |
> +			MG_PLL_BIAS_IREFTRIM(iref_trim);
> +
> +		if (refclk_khz == 38400) {
> +			pll_state->mg_pll_tdc_coldst_bias_mask =
> +				MG_PLL_TDC_COLDST_COLDSTART;
> +			pll_state->mg_pll_bias_mask = 0;
> +		} else {
> +			pll_state->mg_pll_tdc_coldst_bias_mask = -1U;
> +			pll_state->mg_pll_bias_mask = -1U;
> +		}
>  
> -	pll_state->mg_pll_tdc_coldst_bias &= pll_state-
> >mg_pll_tdc_coldst_bias_mask;
> -	pll_state->mg_pll_bias &= pll_state->mg_pll_bias_mask;
> +		pll_state->mg_pll_tdc_coldst_bias &=
> +			pll_state->mg_pll_tdc_coldst_bias_mask;
> +		pll_state->mg_pll_bias &= pll_state->mg_pll_bias_mask;
> +	}
>  
>  	return true;
>  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-07-22 22:31 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-13  1:09 [PATCH 00/22] Tiger Lake part 2 Lucas De Marchi
2019-07-13  1:09 ` [PATCH 01/22] drm/i915/tgl: skip setting PORT_CL_DW12_* on initialization Lucas De Marchi
2019-07-18 20:35   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 02/22] drm/i915/tgl: select correct bit for port select Lucas De Marchi
2019-07-16 21:37   ` Srivatsa, Anusha
2019-07-18 20:20   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 03/22] drm/i915/tgl: update ddi/tc clock_off bits Lucas De Marchi
2019-07-16 22:41   ` Srivatsa, Anusha
2019-07-18 21:09   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 04/22] drm/i915/tgl: Add hpd interrupt handling Lucas De Marchi
2019-07-19 13:47   ` Ville Syrjälä
2019-07-19 16:45     ` Lucas De Marchi
2019-07-19 17:08       ` Ville Syrjälä
2019-07-19 17:14         ` Ville Syrjälä
2019-07-19 17:28           ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 05/22] drm/i915/tgl: Update north display hotplug detection to TGL connections Lucas De Marchi
2019-07-16 23:09   ` Srivatsa, Anusha
2019-07-13  1:09 ` [PATCH 06/22] drm/i915/tgl: handle DP aux interrupts Lucas De Marchi
2019-07-17  0:14   ` Srivatsa, Anusha
2019-07-13  1:09 ` [PATCH 07/22] drm/i915/dmc: Load DMC on TGL Lucas De Marchi
2019-07-19 10:44   ` Anshuman Gupta
2019-07-19 15:34     ` Lucas De Marchi
2019-07-19 16:05   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 08/22] drm/i915/tgl: Add DKL phy pll registers Lucas De Marchi
2019-07-19 21:22   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 09/22] drm/i915/tgl: re-indent code to prepare for DKL changes Lucas De Marchi
2019-07-22 22:31   ` Atwood, Matthew S [this message]
2019-07-13  1:09 ` [PATCH 10/22] drm/i915/tgl: Add DKL phy pll state calculations Lucas De Marchi
2019-07-13  1:09 ` [PATCH 11/22] drm/i915/tgl: start adding the DKL PLLs to use on TC ports Lucas De Marchi
2019-07-13  1:09 ` [PATCH 12/22] drm/i915/tgl: Add support for dkl pll write Lucas De Marchi
2019-07-13  1:09 ` [PATCH 13/22] drm/i915/gen12: add support for reading the timestamp frequency Lucas De Marchi
2019-07-13  1:09 ` [PATCH 14/22] drm/i915/tgl: allow the reg_read ioctl to read the RCS TIMESTAMP register Lucas De Marchi
2019-07-13  1:09 ` [PATCH 15/22] drm/i915/tgl: Introduce initial Tigerlake Workarounds Lucas De Marchi
2019-07-13  1:09 ` [PATCH 16/22] drm/i915/tgl: Implement Wa_1604555607 Lucas De Marchi
2019-07-18  6:03   ` Tvrtko Ursulin
2019-07-19 17:41     ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 17/22] drm/i915/tgl: Implement Wa_1406941453 Lucas De Marchi
2019-07-23 16:35   ` Summers, Stuart
2019-07-13  1:09 ` [PATCH 18/22] drm/i915/tgl: Define MOCS entries for Tigerlake Lucas De Marchi
2019-07-18 13:08   ` Ville Syrjälä
2019-07-18 17:09     ` Daniele Ceraolo Spurio
2019-07-18 17:44       ` Ville Syrjälä
2019-07-24 22:32       ` Lucas De Marchi
2019-07-25 18:26         ` Lis, Tomasz
2019-07-13  1:09 ` [PATCH 19/22] drm/i915/tgl: Tigerlake only has global MOCS registers Lucas De Marchi
2019-07-18 17:40   ` Daniele Ceraolo Spurio
2019-07-19 19:42     ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 20/22] drm/i915: Move MOCS setup to intel_mocs.c Lucas De Marchi
2019-07-23 16:30   ` Summers, Stuart
2019-07-13  1:09 ` [PATCH 21/22] drm/i915/tgl: Add and use new DC5 and DC6 residency counter registers Lucas De Marchi
2019-07-18  5:47   ` Anshuman Gupta
2019-07-19 15:58     ` Atwood, Matthew S
2019-07-19 18:39     ` Lucas De Marchi
2019-07-22  7:41       ` Anshuman Gupta
2019-07-22 17:40         ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 22/22] drm/i915/mst: Do not hardcoded the crtcs that encoder can connect Lucas De Marchi
2019-07-18 13:10   ` Ville Syrjälä
2019-08-15 17:41     ` James Ausmus
2019-07-13  1:19 ` ✗ Fi.CI.CHECKPATCH: warning for Tiger Lake part 2 Patchwork
2019-07-13  1:38 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-14 20:26 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-07-15 22:32 ` ✗ Fi.CI.CHECKPATCH: warning for Tiger Lake part 2 (rev2) Patchwork
2019-07-15 22:55 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-16  0:02 ` ✗ Fi.CI.IGT: failure " 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=9b789a8ed865ea766cdc2a5c53d229aed6b0e434.camel@intel.com \
    --to=matthew.s.atwood@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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.