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 07/12] drm/i915: Relocate vlv_wait_port_ready()
Date: Thu, 13 Feb 2025 21:18:29 +0200	[thread overview]
Message-ID: <87zfipwt4q.fsf@intel.com> (raw)
In-Reply-To: <20250213150220.13580-8-ville.syrjala@linux.intel.com>

On Thu, 13 Feb 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> While vlv_wait_port_ready() doens't directly talk to the VLV/CHV
> DPIO PHY, the signals it's looking for do come from the PHY. So
> it seems appropriate to relocate it into intel_dpio_phy.c.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

> ---
>  drivers/gpu/drm/i915/display/intel_display.c  | 34 -------------------
>  drivers/gpu/drm/i915/display/intel_display.h  |  3 --
>  drivers/gpu/drm/i915/display/intel_dpio_phy.c | 34 +++++++++++++++++++
>  drivers/gpu/drm/i915/display/intel_dpio_phy.h |  8 +++++
>  4 files changed, 42 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 4278212a2496..c2bde539a4ff 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -474,40 +474,6 @@ static void assert_planes_disabled(struct intel_crtc *crtc)
>  		assert_plane_disabled(plane);
>  }
>  
> -void vlv_wait_port_ready(struct intel_display *display,
> -			 struct intel_digital_port *dig_port,
> -			 unsigned int expected_mask)
> -{
> -	u32 port_mask;
> -	i915_reg_t dpll_reg;
> -
> -	switch (dig_port->base.port) {
> -	default:
> -		MISSING_CASE(dig_port->base.port);
> -		fallthrough;
> -	case PORT_B:
> -		port_mask = DPLL_PORTB_READY_MASK;
> -		dpll_reg = DPLL(display, 0);
> -		break;
> -	case PORT_C:
> -		port_mask = DPLL_PORTC_READY_MASK;
> -		dpll_reg = DPLL(display, 0);
> -		expected_mask <<= 4;
> -		break;
> -	case PORT_D:
> -		port_mask = DPLL_PORTD_READY_MASK;
> -		dpll_reg = DPIO_PHY_STATUS;
> -		break;
> -	}
> -
> -	if (intel_de_wait(display, dpll_reg, port_mask, expected_mask, 1000))
> -		drm_WARN(display->drm, 1,
> -			 "timed out waiting for [ENCODER:%d:%s] port ready: got 0x%x, expected 0x%x\n",
> -			 dig_port->base.base.base.id, dig_port->base.base.name,
> -			 intel_de_read(display, dpll_reg) & port_mask,
> -			 expected_mask);
> -}
> -
>  void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)
>  {
>  	struct intel_display *display = to_intel_display(new_crtc_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
> index 2e11fc2ba1f4..b3cdf7f04450 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.h
> +++ b/drivers/gpu/drm/i915/display/intel_display.h
> @@ -488,9 +488,6 @@ bool intel_encoder_is_tc(struct intel_encoder *encoder);
>  enum tc_port intel_encoder_to_tc(struct intel_encoder *encoder);
>  
>  int ilk_get_lanes_required(int target_clock, int link_bw, int bpp);
> -void vlv_wait_port_ready(struct intel_display *display,
> -			 struct intel_digital_port *dig_port,
> -			 unsigned int expected_mask);
>  
>  bool intel_fuzzy_clock_check(int clock1, int clock2);
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_dpio_phy.c b/drivers/gpu/drm/i915/display/intel_dpio_phy.c
> index 5f88702818d3..968b795206b3 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpio_phy.c
> +++ b/drivers/gpu/drm/i915/display/intel_dpio_phy.c
> @@ -1156,3 +1156,37 @@ void vlv_phy_reset_lanes(struct intel_encoder *encoder,
>  	vlv_dpio_write(dev_priv, phy, VLV_PCS_DW1_GRP(ch), 0x00e00060);
>  	vlv_dpio_put(dev_priv);
>  }
> +
> +void vlv_wait_port_ready(struct intel_display *display,
> +			 struct intel_digital_port *dig_port,
> +			 unsigned int expected_mask)
> +{
> +	u32 port_mask;
> +	i915_reg_t dpll_reg;
> +
> +	switch (dig_port->base.port) {
> +	default:
> +		MISSING_CASE(dig_port->base.port);
> +		fallthrough;
> +	case PORT_B:
> +		port_mask = DPLL_PORTB_READY_MASK;
> +		dpll_reg = DPLL(display, 0);
> +		break;
> +	case PORT_C:
> +		port_mask = DPLL_PORTC_READY_MASK;
> +		dpll_reg = DPLL(display, 0);
> +		expected_mask <<= 4;
> +		break;
> +	case PORT_D:
> +		port_mask = DPLL_PORTD_READY_MASK;
> +		dpll_reg = DPIO_PHY_STATUS;
> +		break;
> +	}
> +
> +	if (intel_de_wait(display, dpll_reg, port_mask, expected_mask, 1000))
> +		drm_WARN(display->drm, 1,
> +			 "timed out waiting for [ENCODER:%d:%s] port ready: got 0x%x, expected 0x%x\n",
> +			 dig_port->base.base.base.id, dig_port->base.base.name,
> +			 intel_de_read(display, dpll_reg) & port_mask,
> +			 expected_mask);
> +}
> diff --git a/drivers/gpu/drm/i915/display/intel_dpio_phy.h b/drivers/gpu/drm/i915/display/intel_dpio_phy.h
> index a82939165546..15596407fe87 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpio_phy.h
> +++ b/drivers/gpu/drm/i915/display/intel_dpio_phy.h
> @@ -72,6 +72,9 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,
>  				const struct intel_crtc_state *crtc_state);
>  void vlv_phy_reset_lanes(struct intel_encoder *encoder,
>  			 const struct intel_crtc_state *old_crtc_state);
> +void vlv_wait_port_ready(struct intel_display *display,
> +			 struct intel_digital_port *dig_port,
> +			 unsigned int expected_mask);
>  #else
>  static inline void bxt_port_to_phy_channel(struct intel_display *display, enum port port,
>  					   enum dpio_phy *phy, enum dpio_channel *ch)
> @@ -170,6 +173,11 @@ static inline void vlv_phy_reset_lanes(struct intel_encoder *encoder,
>  				       const struct intel_crtc_state *old_crtc_state)
>  {
>  }
> +static inline void vlv_wait_port_ready(struct intel_display *display,
> +				       struct intel_digital_port *dig_port,
> +				       unsigned int expected_mask)
> +{
> +}
>  #endif
>  
>  #endif /* __INTEL_DPIO_PHY_H__ */

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-02-13 19:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13 15:02 [PATCH 00/12] drm/i915: Hoist some stuff out from intel_display.c Ville Syrjala
2025-02-13 15:02 ` [PATCH 01/12] drm/i915: Move modeset_retry stuff into intel_connector.c Ville Syrjala
2025-02-13 19:11   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 02/12] drm/i915: Always initialize connector->modeset_retry_work Ville Syrjala
2025-02-13 19:11   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 03/12] drm/i915: Extract intel_connector_cancel_modeset_retry_work() Ville Syrjala
2025-02-13 19:12   ` Jani Nikula
2025-02-13 19:13   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 04/12] drm/i915: Extract intel_hdcp_cancel_works() Ville Syrjala
2025-02-13 19:14   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 05/12] drm/i915: Move intel_hpd_poll_fini() into intel_hotplug.c Ville Syrjala
2025-02-13 19:15   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 06/12] drm/i915: Move intel_plane_destroy() into intel_atomic_plane.c Ville Syrjala
2025-02-13 19:17   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 07/12] drm/i915: Relocate vlv_wait_port_ready() Ville Syrjala
2025-02-13 19:18   ` Jani Nikula [this message]
2025-02-13 15:02 ` [PATCH 08/12] drm/i915: Simplify vlv_wait_port_ready() arguments Ville Syrjala
2025-02-13 19:19   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 09/12] drm/i915: Relocate intel_plane_uses_fence() Ville Syrjala
2025-02-13 19:20   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 10/12] drm/i915: Relocate intel_{rotation, remapped}_info_size() Ville Syrjala
2025-02-13 19:21   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 11/12] drm/i915: Relocate some other plane fb related stuff into intel_fb.c Ville Syrjala
2025-02-13 19:22   ` Jani Nikula
2025-02-13 15:02 ` [PATCH 12/12] drm/i915: s/state/plane_state/ Ville Syrjala
2025-02-13 19:23   ` Jani Nikula
2025-02-13 15:25 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Hoist some stuff out from intel_display.c Patchwork
2025-02-13 15:25 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-13 15:44 ` ✗ i915.CI.BAT: failure " Patchwork
2025-02-14 18:22 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Hoist some stuff out from intel_display.c (rev2) Patchwork
2025-02-14 18:22 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-14 18:39 ` ✗ i915.CI.BAT: failure " Patchwork
2025-02-15  3:02 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Hoist some stuff out from intel_display.c (rev3) Patchwork
2025-02-15  3:02 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-15  3:18 ` ✓ i915.CI.BAT: success " Patchwork
2025-02-15  6:56 ` ✗ i915.CI.Full: 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=87zfipwt4q.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