Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: You-Sheng Yang <vicamo@gmail.com>
To: "José Roberto de Souza" <jose.souza@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/6] drm/i915/display: Move out code to return the digital_port of the aux ch
Date: Wed, 1 Apr 2020 15:18:52 +0800	[thread overview]
Message-ID: <e77622b4-b1b7-b002-5f87-5361c0e29886@gmail.com> (raw)
In-Reply-To: <20200401004120.408586-1-jose.souza@intel.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 3844 bytes --]

On 2020-04-01 08:41, José Roberto de Souza wrote:
> Moving the code to return the digital port of the aux channel also
> removing the intel_phy_is_tc() to make it generic.
> digital_port will be needed in icl_tc_phy_aux_power_well_enable()
> so adding it as a parameter to icl_tc_port_assert_ref_held().
> 
> While at at removing the duplicated call to icl_tc_phy_aux_ch() in
> icl_tc_port_assert_ref_held().
> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  .../drm/i915/display/intel_display_power.c    | 38 ++++++++++---------
>  1 file changed, 21 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c
> index 433e5a81dd4d..02a07aa710e4 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power.c
> @@ -500,26 +500,14 @@ static int power_well_async_ref_count(struct drm_i915_private *dev_priv,
>  	return refs;
>  }
>  
> -static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,
> -					struct i915_power_well *power_well)
> +static struct intel_digital_port *
> +aux_ch_to_digital_port(struct drm_i915_private *dev_priv,
> +		       enum aux_ch aux_ch)

This fails the build because icl_tc_port_assert_ref_held was originally
guarded by CONFIG_DRM_I915_DEBUG_RUNTIME_PM, but now
aux_ch_to_digital_port maybe used outside the scope.

>  {
> -	enum aux_ch aux_ch = icl_tc_phy_aux_ch(dev_priv, power_well);
>  	struct intel_digital_port *dig_port = NULL;
>  	struct intel_encoder *encoder;
>  
> -	/* Bypass the check if all references are released asynchronously */
> -	if (power_well_async_ref_count(dev_priv, power_well) ==
> -	    power_well->count)
> -		return;
> -
> -	aux_ch = icl_tc_phy_aux_ch(dev_priv, power_well);
> -
>  	for_each_intel_encoder(&dev_priv->drm, encoder) {
> -		enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
> -
> -		if (!intel_phy_is_tc(dev_priv, phy))
> -			continue;
> -
>  		/* We'll check the MST primary port */
>  		if (encoder->type == INTEL_OUTPUT_DP_MST)
>  			continue;
> @@ -536,6 +524,18 @@ static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,
>  		break;
>  	}
>  
> +	return dig_port;
> +}
> +
> +static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,
> +					struct i915_power_well *power_well,
> +					struct intel_digital_port *dig_port)
> +{
> +	/* Bypass the check if all references are released asynchronously */
> +	if (power_well_async_ref_count(dev_priv, power_well) ==
> +	    power_well->count)
> +		return;
> +
>  	if (drm_WARN_ON(&dev_priv->drm, !dig_port))
>  		return;
>  
> @@ -558,9 +558,10 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
>  				 struct i915_power_well *power_well)
>  {
>  	enum aux_ch aux_ch = icl_tc_phy_aux_ch(dev_priv, power_well);
> +	struct intel_digital_port *dig_port = aux_ch_to_digital_port(dev_priv, aux_ch);

E.g. here.

>  	u32 val;
>  
> -	icl_tc_port_assert_ref_held(dev_priv, power_well);
> +	icl_tc_port_assert_ref_held(dev_priv, power_well, dig_port);
>  
>  	val = intel_de_read(dev_priv, DP_AUX_CH_CTL(aux_ch));
>  	val &= ~DP_AUX_CH_CTL_TBT_IO;
> @@ -588,7 +589,10 @@ static void
>  icl_tc_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
>  				  struct i915_power_well *power_well)
>  {
> -	icl_tc_port_assert_ref_held(dev_priv, power_well);
> +	enum aux_ch aux_ch = icl_tc_phy_aux_ch(dev_priv, power_well);
> +	struct intel_digital_port *dig_port = aux_ch_to_digital_port(dev_priv, aux_ch);
> +
> +	icl_tc_port_assert_ref_held(dev_priv, power_well, dig_port);
>  
>  	hsw_power_well_disable(dev_priv, power_well);
>  }
> 

You-Sheng Yang


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2020-04-01 12:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01  0:41 [Intel-gfx] [PATCH 1/6] drm/i915/display: Move out code to return the digital_port of the aux ch José Roberto de Souza
2020-04-01  0:41 ` [Intel-gfx] [PATCH 2/6] drm/i915/tc: Export tc_port_live_status_mask() José Roberto de Souza
2020-04-01  0:41 ` [Intel-gfx] [PATCH 3/6] drm/i915/display: Add intel_aux_ch_to_power_domain() José Roberto de Souza
2020-04-01 12:09   ` Imre Deak
2020-04-01  0:41 ` [Intel-gfx] [PATCH 4/6] drm/i915/display: Split hsw_power_well_enable() into two José Roberto de Souza
2020-04-01  0:41 ` [Intel-gfx] [PATCH 5/6] drm/i915/tc/icl: Implement TC cold sequences José Roberto de Souza
2020-04-01 12:43   ` Imre Deak
2020-04-01 22:35     ` Souza, Jose
2020-04-02  1:02       ` Imre Deak
2020-04-03  1:18         ` Souza, Jose
2020-04-06 12:57           ` Imre Deak
2020-04-01  0:41 ` [Intel-gfx] [PATCH 6/6] drm/i915/tc/tgl: " José Roberto de Souza
2020-04-01 12:55   ` Imre Deak
2020-04-01 23:36     ` Souza, Jose
2020-04-02  1:08       ` Imre Deak
2020-04-01  1:31 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] drm/i915/display: Move out code to return the digital_port of the aux ch Patchwork
2020-04-01  1:43 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-04-01  2:34 ` [Intel-gfx] [PATCH 1/6] " kbuild test robot
2020-04-01  5:06 ` kbuild test robot
2020-04-01  7:18 ` You-Sheng Yang [this message]
2020-04-01 18:18   ` Souza, Jose

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=e77622b4-b1b7-b002-5f87-5361c0e29886@gmail.com \
    --to=vicamo@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@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