diff mbox series

[2/8] drm/i915/icl: use combophy/TC helper functions during display detection

Message ID 20181003072203.12848-3-mahesh1.kumar@intel.com (mailing list archive)
State New, archived
Headers show
Series Refactor and Add helper function for combophy/tc ports | expand

Commit Message

Kumar, Mahesh Oct. 3, 2018, 7:21 a.m. UTC
Instead of directly comparing HPD pins use intel_port_is_combophy/tc
helper functions to distinguish between combophy/TC ports.

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Comments

Rodrigo Vivi Oct. 3, 2018, 5:58 p.m. UTC | #1
On Wed, Oct 03, 2018 at 12:51:57PM +0530, Mahesh Kumar wrote:
> Instead of directly comparing HPD pins use intel_port_is_combophy/tc
> helper functions to distinguish between combophy/TC ports.
> 
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>

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

> ---
>  drivers/gpu/drm/i915/intel_dp.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 15a981ef5966..f6b9be81ea18 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4965,19 +4965,14 @@ static bool icl_digital_port_connected(struct intel_encoder *encoder)
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
>  
> -	switch (encoder->hpd_pin) {
> -	case HPD_PORT_A:
> -	case HPD_PORT_B:
> +	if (intel_port_is_combophy(dev_priv, encoder->port))
>  		return icl_combo_port_connected(dev_priv, dig_port);
> -	case HPD_PORT_C:
> -	case HPD_PORT_D:
> -	case HPD_PORT_E:
> -	case HPD_PORT_F:
> +	else if (intel_port_is_tc(dev_priv, encoder->port))
>  		return icl_tc_port_connected(dev_priv, dig_port);
> -	default:
> +	else
>  		MISSING_CASE(encoder->hpd_pin);
> -		return false;
> -	}
> +
> +	return false;
>  }
>  
>  /*
> -- 
> 2.16.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Lucas De Marchi Oct. 4, 2018, 9:16 p.m. UTC | #2
On Wed, Oct 03, 2018 at 12:51:57PM +0530, Mahesh Kumar wrote:
> Instead of directly comparing HPD pins use intel_port_is_combophy/tc
> helper functions to distinguish between combophy/TC ports.
> 
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> ---

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

>  drivers/gpu/drm/i915/intel_dp.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 15a981ef5966..f6b9be81ea18 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4965,19 +4965,14 @@ static bool icl_digital_port_connected(struct intel_encoder *encoder)
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
>  
> -	switch (encoder->hpd_pin) {
> -	case HPD_PORT_A:
> -	case HPD_PORT_B:
> +	if (intel_port_is_combophy(dev_priv, encoder->port))
>  		return icl_combo_port_connected(dev_priv, dig_port);
> -	case HPD_PORT_C:
> -	case HPD_PORT_D:
> -	case HPD_PORT_E:
> -	case HPD_PORT_F:
> +	else if (intel_port_is_tc(dev_priv, encoder->port))
>  		return icl_tc_port_connected(dev_priv, dig_port);
> -	default:
> +	else
>  		MISSING_CASE(encoder->hpd_pin);
> -		return false;
> -	}
> +
> +	return false;
>  }
>  
>  /*
> -- 
> 2.16.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 15a981ef5966..f6b9be81ea18 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4965,19 +4965,14 @@  static bool icl_digital_port_connected(struct intel_encoder *encoder)
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
 
-	switch (encoder->hpd_pin) {
-	case HPD_PORT_A:
-	case HPD_PORT_B:
+	if (intel_port_is_combophy(dev_priv, encoder->port))
 		return icl_combo_port_connected(dev_priv, dig_port);
-	case HPD_PORT_C:
-	case HPD_PORT_D:
-	case HPD_PORT_E:
-	case HPD_PORT_F:
+	else if (intel_port_is_tc(dev_priv, encoder->port))
 		return icl_tc_port_connected(dev_priv, dig_port);
-	default:
+	else
 		MISSING_CASE(encoder->hpd_pin);
-		return false;
-	}
+
+	return false;
 }
 
 /*