Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 11/14] drm/i915/dpio: Rename a few CHV DPIO PHY registers
Date: Mon, 22 Apr 2024 13:16:17 +0300	[thread overview]
Message-ID: <87sezdu2ha.fsf@intel.com> (raw)
In-Reply-To: <20240422083457.23815-12-ville.syrjala@linux.intel.com>

On Mon, 22 Apr 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Drop the leading underscore from the CHV PHY common lane
> register definitons. We use these directly from actual

*definitions

> code so the underscore here is misleading as usually it indicates
> an intermediate define that shouldn't be used directly.

I could go either this way, or to using the parametrized definitions and
passing the channel.

*shrug*

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  .../i915/display/intel_display_power_well.c   |  8 +++----
>  drivers/gpu/drm/i915/display/intel_dpio_phy.c | 16 ++++++-------
>  drivers/gpu/drm/i915/i915_reg.h               | 23 +++++++++----------
>  3 files changed, 23 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> index e8a6e53fd551..49114afc9a61 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> @@ -1442,9 +1442,9 @@ static void chv_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
>  	vlv_dpio_write(dev_priv, phy, CHV_CMN_DW28, tmp);
>  
>  	if (id == VLV_DISP_PW_DPIO_CMN_BC) {
> -		tmp = vlv_dpio_read(dev_priv, phy, _CHV_CMN_DW6_CH1);
> +		tmp = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW6_CH1);
>  		tmp |= DPIO_DYNPWRDOWNEN_CH1;
> -		vlv_dpio_write(dev_priv, phy, _CHV_CMN_DW6_CH1, tmp);
> +		vlv_dpio_write(dev_priv, phy, CHV_CMN_DW6_CH1, tmp);
>  	} else {
>  		/*
>  		 * Force the non-existing CL2 off. BXT does this
> @@ -1520,9 +1520,9 @@ static void assert_chv_phy_powergate(struct drm_i915_private *dev_priv, enum dpi
>  		return;
>  
>  	if (ch == DPIO_CH0)
> -		reg = _CHV_CMN_DW0_CH0;
> +		reg = CHV_CMN_DW0_CH0;
>  	else
> -		reg = _CHV_CMN_DW6_CH1;
> +		reg = CHV_CMN_DW6_CH1;
>  
>  	vlv_dpio_get(dev_priv);
>  	val = vlv_dpio_read(dev_priv, phy, reg);
> diff --git a/drivers/gpu/drm/i915/display/intel_dpio_phy.c b/drivers/gpu/drm/i915/display/intel_dpio_phy.c
> index 791902ba729c..89a51b420075 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpio_phy.c
> +++ b/drivers/gpu/drm/i915/display/intel_dpio_phy.c
> @@ -883,21 +883,21 @@ void chv_phy_pre_pll_enable(struct intel_encoder *encoder,
>  
>  	/* program left/right clock distribution */
>  	if (pipe != PIPE_B) {
> -		val = vlv_dpio_read(dev_priv, phy, _CHV_CMN_DW5_CH0);
> +		val = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW5_CH0);
>  		val &= ~(CHV_BUFLEFTENA1_MASK | CHV_BUFRIGHTENA1_MASK);
>  		if (ch == DPIO_CH0)
>  			val |= CHV_BUFLEFTENA1_FORCE;
>  		if (ch == DPIO_CH1)
>  			val |= CHV_BUFRIGHTENA1_FORCE;
> -		vlv_dpio_write(dev_priv, phy, _CHV_CMN_DW5_CH0, val);
> +		vlv_dpio_write(dev_priv, phy, CHV_CMN_DW5_CH0, val);
>  	} else {
> -		val = vlv_dpio_read(dev_priv, phy, _CHV_CMN_DW1_CH1);
> +		val = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW1_CH1);
>  		val &= ~(CHV_BUFLEFTENA2_MASK | CHV_BUFRIGHTENA2_MASK);
>  		if (ch == DPIO_CH0)
>  			val |= CHV_BUFLEFTENA2_FORCE;
>  		if (ch == DPIO_CH1)
>  			val |= CHV_BUFRIGHTENA2_FORCE;
> -		vlv_dpio_write(dev_priv, phy, _CHV_CMN_DW1_CH1, val);
> +		vlv_dpio_write(dev_priv, phy, CHV_CMN_DW1_CH1, val);
>  	}
>  
>  	/* program clock channel usage */
> @@ -1036,13 +1036,13 @@ void chv_phy_post_pll_disable(struct intel_encoder *encoder,
>  
>  	/* disable left/right clock distribution */
>  	if (pipe != PIPE_B) {
> -		val = vlv_dpio_read(dev_priv, phy, _CHV_CMN_DW5_CH0);
> +		val = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW5_CH0);
>  		val &= ~(CHV_BUFLEFTENA1_MASK | CHV_BUFRIGHTENA1_MASK);
> -		vlv_dpio_write(dev_priv, phy, _CHV_CMN_DW5_CH0, val);
> +		vlv_dpio_write(dev_priv, phy, CHV_CMN_DW5_CH0, val);
>  	} else {
> -		val = vlv_dpio_read(dev_priv, phy, _CHV_CMN_DW1_CH1);
> +		val = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW1_CH1);
>  		val &= ~(CHV_BUFLEFTENA2_MASK | CHV_BUFRIGHTENA2_MASK);
> -		vlv_dpio_write(dev_priv, phy, _CHV_CMN_DW1_CH1, val);
> +		vlv_dpio_write(dev_priv, phy, CHV_CMN_DW1_CH1, val);
>  	}
>  
>  	vlv_dpio_put(dev_priv);
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 3804ef4697d5..b24ce3cff1a0 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -459,13 +459,13 @@
>  #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)
>  
> -#define _CHV_CMN_DW0_CH0               0x8100
> +#define CHV_CMN_DW0_CH0			0x8100
>  #define   DPIO_ALLDL_POWERDOWN_SHIFT_CH0	19
>  #define   DPIO_ANYDL_POWERDOWN_SHIFT_CH0	18
>  #define   DPIO_ALLDL_POWERDOWN			(1 << 1)
>  #define   DPIO_ANYDL_POWERDOWN			(1 << 0)
>  
> -#define _CHV_CMN_DW5_CH0               0x8114
> +#define CHV_CMN_DW5_CH0			0x8114
>  #define   CHV_BUFRIGHTENA1_DISABLE	(0 << 20)
>  #define   CHV_BUFRIGHTENA1_NORMAL	(1 << 20)
>  #define   CHV_BUFRIGHTENA1_FORCE	(3 << 20)
> @@ -475,18 +475,18 @@
>  #define   CHV_BUFLEFTENA1_FORCE		(3 << 22)
>  #define   CHV_BUFLEFTENA1_MASK		(3 << 22)
>  
> -#define _CHV_CMN_DW13_CH0		0x8134
> -#define _CHV_CMN_DW0_CH1		0x8080
> +#define CHV_CMN_DW13_CH0		0x8134
> +#define CHV_CMN_DW0_CH1			0x8080
>  #define   DPIO_CHV_S1_DIV_SHIFT		21
>  #define   DPIO_CHV_P1_DIV_SHIFT		13 /* 3 bits */
>  #define   DPIO_CHV_P2_DIV_SHIFT		8  /* 5 bits */
>  #define   DPIO_CHV_K_DIV_SHIFT		4
>  #define   DPIO_PLL_FREQLOCK		(1 << 1)
>  #define   DPIO_PLL_LOCK			(1 << 0)
> -#define CHV_CMN_DW13(ch) _PIPE(ch, _CHV_CMN_DW13_CH0, _CHV_CMN_DW0_CH1)
> +#define CHV_CMN_DW13(ch) _PIPE(ch, CHV_CMN_DW13_CH0, CHV_CMN_DW0_CH1)
>  
> -#define _CHV_CMN_DW14_CH0		0x8138
> -#define _CHV_CMN_DW1_CH1		0x8084
> +#define CHV_CMN_DW14_CH0		0x8138
> +#define CHV_CMN_DW1_CH1			0x8084
>  #define   DPIO_AFC_RECAL		(1 << 14)
>  #define   DPIO_DCLKP_EN			(1 << 13)
>  #define   CHV_BUFLEFTENA2_DISABLE	(0 << 17) /* CL2 DW1 only */
> @@ -497,16 +497,15 @@
>  #define   CHV_BUFRIGHTENA2_NORMAL	(1 << 19) /* CL2 DW1 only */
>  #define   CHV_BUFRIGHTENA2_FORCE	(3 << 19) /* CL2 DW1 only */
>  #define   CHV_BUFRIGHTENA2_MASK		(3 << 19) /* CL2 DW1 only */
> -#define CHV_CMN_DW14(ch) _PIPE(ch, _CHV_CMN_DW14_CH0, _CHV_CMN_DW1_CH1)
> +#define CHV_CMN_DW14(ch) _PIPE(ch, CHV_CMN_DW14_CH0, CHV_CMN_DW1_CH1)
>  
> -#define _CHV_CMN_DW19_CH0		0x814c
> -#define _CHV_CMN_DW6_CH1		0x8098
> +#define CHV_CMN_DW19_CH0		0x814c
> +#define CHV_CMN_DW6_CH1		0x8098
>  #define   DPIO_ALLDL_POWERDOWN_SHIFT_CH1	30 /* CL2 DW6 only */
>  #define   DPIO_ANYDL_POWERDOWN_SHIFT_CH1	29 /* CL2 DW6 only */
>  #define   DPIO_DYNPWRDOWNEN_CH1		(1 << 28) /* CL2 DW6 only */
>  #define   CHV_CMN_USEDCLKCHANNEL	(1 << 13)
> -
> -#define CHV_CMN_DW19(ch) _PIPE(ch, _CHV_CMN_DW19_CH0, _CHV_CMN_DW6_CH1)
> +#define CHV_CMN_DW19(ch) _PIPE(ch, CHV_CMN_DW19_CH0, CHV_CMN_DW6_CH1)
>  
>  #define CHV_CMN_DW28			0x8170
>  #define   DPIO_CL1POWERDOWNEN		(1 << 23)

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-04-22 10:16 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  8:34 [PATCH 00/14] drm/i915: VLV/CHV DPIO register cleanup Ville Syrjala
2024-04-22  8:34 ` [PATCH 01/14] drm/i915/dpio: Remove pointless VLV_PCS01_DW8 read Ville Syrjala
2024-04-22  8:58   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 02/14] drm/i915/dpio: s/VLV_REF_DW13/VLV_REF_DW11/ Ville Syrjala
2024-04-22  9:01   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 03/14] drm/i915/dpio: s/VLV_PLL_DW9_BCAST/VLV_PCS_DW17_BCAST/ Ville Syrjala
2024-04-22  9:02   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 04/14] drm/i915/dpio: Fix VLV DPIO PLL register dword numbering Ville Syrjala
2024-04-22  9:41   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 05/14] drm/i915/dpio: Remove pointless variables from vlv/chv DPLL code Ville Syrjala
2024-04-22  9:54   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 06/14] drm/i915/dpio: Rename some variables Ville Syrjala
2024-04-22  9:56   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 07/14] drm/i915/dpio: s/port/ch/ Ville Syrjala
2024-04-22  9:59   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 08/14] drm/i915/dpio: s/pipe/ch/ Ville Syrjala
2024-04-22 10:02   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 09/14] drm/i915/dpio: Derive the phy from the port rather than pipe in encoder hooks Ville Syrjala
2024-04-22 10:10   ` Jani Nikula
2024-04-23  8:46     ` Ville Syrjälä
2024-04-23  9:20       ` Jani Nikula
2024-04-22  8:34 ` [PATCH 10/14] drm/i915/dpio: Give VLV DPIO group register a clearer name Ville Syrjala
2024-04-22 10:12   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 11/14] drm/i915/dpio: Rename a few CHV DPIO PHY registers Ville Syrjala
2024-04-22 10:16   ` Jani Nikula [this message]
2024-04-22  8:34 ` [PATCH 12/14] drm/i915/dpio: Clean up VLV/CHV DPIO PHY register defines Ville Syrjala
2024-04-23  9:18   ` Jani Nikula
2024-04-22  8:34 ` [PATCH 13/14] drm/i915/dpio: Clean up the vlv/chv PHY register bits Ville Syrjala
2024-04-22 12:46   ` Jani Nikula
2024-04-23  7:58     ` Ville Syrjälä
2024-04-22  8:34 ` [PATCH 14/14] drm/i915/dpio: Extract vlv_dpio_phy_regs.h Ville Syrjala
2024-04-22 12:50   ` Jani Nikula
2024-04-22 10:01 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: VLV/CHV DPIO register cleanup Patchwork
2024-04-22 10:08 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-26 10:19   ` Jani Nikula
2024-04-30 11:43 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: VLV/CHV DPIO register cleanup (rev2) Patchwork
2024-04-30 11:43 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-04-30 11:49 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-30 15:31 ` ✗ 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=87sezdu2ha.fsf@intel.com \
    --to=jani.nikula@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