diff mbox series

[1/2] drm/i915/dp: Drop redundant AUX power get/put in intel_dp_force()

Message ID 20230830140421.2031111-1-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915/dp: Drop redundant AUX power get/put in intel_dp_force() | expand

Commit Message

Imre Deak Aug. 30, 2023, 2:04 p.m. UTC
intel_dp_force() takes the AUX power reference as required by the DP AUX
transactions in intel_dp_set_edid(). However the low level AUX handler
takes this reference already so the get/put in intel_dp_force() can be
dropped. This also fixes a problem where the TC port mode changed while
the AUX power well was enabled.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8779
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Rodrigo Vivi Aug. 30, 2023, 9:29 p.m. UTC | #1
On Wed, Aug 30, 2023 at 05:04:20PM +0300, Imre Deak wrote:
> intel_dp_force() takes the AUX power reference as required by the DP AUX
> transactions in intel_dp_set_edid(). However the low level AUX handler

you mean intel_dp_aux_xfer right?

> takes this reference already so the get/put in intel_dp_force() can be
> dropped. This also fixes a problem where the TC port mode changed while
> the AUX power well was enabled.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8779
> Signed-off-by: Imre Deak <imre.deak@intel.com>

It makes sense to get that in lower levels, so

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 9d303caf969e0..16fb12d187a29 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5365,9 +5365,6 @@ intel_dp_force(struct drm_connector *connector)
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
>  	struct intel_encoder *intel_encoder = &dig_port->base;
>  	struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);
> -	enum intel_display_power_domain aux_domain =
> -		intel_aux_power_domain(dig_port);
> -	intel_wakeref_t wakeref;
>  
>  	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n",
>  		    connector->base.id, connector->name);
> @@ -5376,11 +5373,7 @@ intel_dp_force(struct drm_connector *connector)
>  	if (connector->status != connector_status_connected)
>  		return;
>  
> -	wakeref = intel_display_power_get(dev_priv, aux_domain);
> -
>  	intel_dp_set_edid(intel_dp);
> -
> -	intel_display_power_put(dev_priv, aux_domain, wakeref);
>  }
>  
>  static int intel_dp_get_modes(struct drm_connector *connector)
> -- 
> 2.37.2
>
Imre Deak Aug. 31, 2023, 10:19 a.m. UTC | #2
On Wed, Aug 30, 2023 at 05:29:09PM -0400, Rodrigo Vivi wrote:
> On Wed, Aug 30, 2023 at 05:04:20PM +0300, Imre Deak wrote:
> > intel_dp_force() takes the AUX power reference as required by the DP AUX
> > transactions in intel_dp_set_edid(). However the low level AUX handler
> 
> you mean intel_dp_aux_xfer right?

Yes, intel_dp_set_edid() -> intel_dp_aux_xfer(), the same way as in
intel_dp_detect().

> > takes this reference already so the get/put in intel_dp_force() can be
> > dropped. This also fixes a problem where the TC port mode changed while
> > the AUX power well was enabled.
> > 
> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8779
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> It makes sense to get that in lower levels, so
> 
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Thanks, I pushed the patches.

> > ---
> >  drivers/gpu/drm/i915/display/intel_dp.c | 7 -------
> >  1 file changed, 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > index 9d303caf969e0..16fb12d187a29 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -5365,9 +5365,6 @@ intel_dp_force(struct drm_connector *connector)
> >  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> >  	struct intel_encoder *intel_encoder = &dig_port->base;
> >  	struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);
> > -	enum intel_display_power_domain aux_domain =
> > -		intel_aux_power_domain(dig_port);
> > -	intel_wakeref_t wakeref;
> >  
> >  	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n",
> >  		    connector->base.id, connector->name);
> > @@ -5376,11 +5373,7 @@ intel_dp_force(struct drm_connector *connector)
> >  	if (connector->status != connector_status_connected)
> >  		return;
> >  
> > -	wakeref = intel_display_power_get(dev_priv, aux_domain);
> > -
> >  	intel_dp_set_edid(intel_dp);
> > -
> > -	intel_display_power_put(dev_priv, aux_domain, wakeref);
> >  }
> >  
> >  static int intel_dp_get_modes(struct drm_connector *connector)
> > -- 
> > 2.37.2
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 9d303caf969e0..16fb12d187a29 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5365,9 +5365,6 @@  intel_dp_force(struct drm_connector *connector)
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct intel_encoder *intel_encoder = &dig_port->base;
 	struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);
-	enum intel_display_power_domain aux_domain =
-		intel_aux_power_domain(dig_port);
-	intel_wakeref_t wakeref;
 
 	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n",
 		    connector->base.id, connector->name);
@@ -5376,11 +5373,7 @@  intel_dp_force(struct drm_connector *connector)
 	if (connector->status != connector_status_connected)
 		return;
 
-	wakeref = intel_display_power_get(dev_priv, aux_domain);
-
 	intel_dp_set_edid(intel_dp);
-
-	intel_display_power_put(dev_priv, aux_domain, wakeref);
 }
 
 static int intel_dp_get_modes(struct drm_connector *connector)