All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: pass dev_priv explicitly to PORT_DFT2_G4X
Date: Mon, 6 May 2024 15:13:04 +0300	[thread overview]
Message-ID: <ZjjJUO6_QRII3zrN@intel.com> (raw)
In-Reply-To: <0db8ee7b66b9660fc9fd80598257c6d36f0f506b.1714990089.git.jani.nikula@intel.com>

On Mon, May 06, 2024 at 01:09:04PM +0300, Jani Nikula wrote:
> Avoid the implicit dev_priv local variable use, and pass dev_priv
> explicitly to the PORT_DFT2_G4X register macro.

Looks like we only use this on VLV/CHV, so could define a fixed
offset _VLV variant.

But this works too
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_pipe_crc.c | 8 ++++----
>  drivers/gpu/drm/i915/i915_reg.h               | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c b/drivers/gpu/drm/i915/display/intel_pipe_crc.c
> index 35c3dd1130ce..b3dcfee6ec0e 100644
> --- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c
> +++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c
> @@ -167,7 +167,7 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
>  	 *   - DisplayPort scrambling: used for EMI reduction
>  	 */
>  	if (need_stable_symbols) {
> -		u32 tmp = intel_de_read(dev_priv, PORT_DFT2_G4X);
> +		u32 tmp = intel_de_read(dev_priv, PORT_DFT2_G4X(dev_priv));
>  
>  		tmp |= DC_BALANCE_RESET_VLV;
>  		switch (pipe) {
> @@ -183,7 +183,7 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
>  		default:
>  			return -EINVAL;
>  		}
> -		intel_de_write(dev_priv, PORT_DFT2_G4X, tmp);
> +		intel_de_write(dev_priv, PORT_DFT2_G4X(dev_priv), tmp);
>  	}
>  
>  	return 0;
> @@ -229,7 +229,7 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
>  static void vlv_undo_pipe_scramble_reset(struct drm_i915_private *dev_priv,
>  					 enum pipe pipe)
>  {
> -	u32 tmp = intel_de_read(dev_priv, PORT_DFT2_G4X);
> +	u32 tmp = intel_de_read(dev_priv, PORT_DFT2_G4X(dev_priv));
>  
>  	switch (pipe) {
>  	case PIPE_A:
> @@ -246,7 +246,7 @@ static void vlv_undo_pipe_scramble_reset(struct drm_i915_private *dev_priv,
>  	}
>  	if (!(tmp & PIPE_SCRAMBLE_RESET_MASK))
>  		tmp &= ~DC_BALANCE_RESET_VLV;
> -	intel_de_write(dev_priv, PORT_DFT2_G4X, tmp);
> +	intel_de_write(dev_priv, PORT_DFT2_G4X(dev_priv), tmp);
>  }
>  
>  static int ilk_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source,
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 4a88eb9cd1f8..5670eee4a498 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -1479,7 +1479,7 @@
>  
>  #define PORT_DFT_I9XX				_MMIO(0x61150)
>  #define   DC_BALANCE_RESET			(1 << 25)
> -#define PORT_DFT2_G4X		_MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x61154)
> +#define PORT_DFT2_G4X(dev_priv)		_MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x61154)
>  #define   DC_BALANCE_RESET_VLV			(1 << 31)
>  #define   PIPE_SCRAMBLE_RESET_MASK		((1 << 14) | (0x3 << 0))
>  #define   PIPE_C_SCRAMBLE_RESET			REG_BIT(14) /* chv */
> -- 
> 2.39.2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-05-06 12:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 10:09 [PATCH 0/3] drm/i915/display: remove implicit dev_priv from pipe crc Jani Nikula
2024-05-06 10:09 ` [PATCH 1/3] drm/i915: pass dev_priv explicitly to PIPE_CRC_CTL Jani Nikula
2024-05-06 12:14   ` Ville Syrjälä
2024-05-06 10:09 ` [PATCH 2/3] drm/i915: pass dev_priv explicitly to PIPE_CRC_* Jani Nikula
2024-05-06 12:13   ` Ville Syrjälä
2024-05-06 10:09 ` [PATCH 3/3] drm/i915: pass dev_priv explicitly to PORT_DFT2_G4X Jani Nikula
2024-05-06 12:13   ` Ville Syrjälä [this message]
2024-05-08  9:17     ` Jani Nikula
2024-05-06 10:57 ` ✓ Fi.CI.BAT: success for drm/i915/display: remove implicit dev_priv from pipe crc Patchwork
2024-05-06 13:59 ` ✗ 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=ZjjJUO6_QRII3zrN@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.