[07/23] drm/i915: Use the correct AUX power domain in TypeC TBT-alt mode

Submitted by Imre Deak on June 4, 2019, 2:58 p.m.

Details

Message ID 20190604145826.16424-8-imre.deak@intel.com
State New
Headers show
Series "drm/i915: Fix TypeC port mode switching" ( rev: 2 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Imre Deak June 4, 2019, 2:58 p.m.
In the TypeC TBT-alt port mode we must use the TBT AUX power domain,
fix that.

Cc: Manasi Navare <manasi.d.navare@intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 26474788b7b2..0e425a6eebf3 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6609,6 +6609,25 @@  enum intel_display_power_domain intel_port_to_power_domain(enum port port)
 enum intel_display_power_domain
 intel_aux_power_domain(struct intel_digital_port *dig_port)
 {
+	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
+
+	if (intel_port_is_tc(dev_priv, dig_port->base.port) &&
+	    dig_port->tc_mode == TC_PORT_TBT_ALT) {
+		switch (dig_port->aux_ch) {
+		case AUX_CH_C:
+			return POWER_DOMAIN_AUX_TBT1;
+		case AUX_CH_D:
+			return POWER_DOMAIN_AUX_TBT2;
+		case AUX_CH_E:
+			return POWER_DOMAIN_AUX_TBT3;
+		case AUX_CH_F:
+			return POWER_DOMAIN_AUX_TBT4;
+		default:
+			MISSING_CASE(dig_port->aux_ch);
+			return POWER_DOMAIN_AUX_TBT1;
+		}
+	}
+
 	switch (dig_port->aux_ch) {
 	case AUX_CH_A:
 		return POWER_DOMAIN_AUX_A;

Comments

On Tue, 2019-06-04 at 17:58 +0300, Imre Deak wrote:
> In the TypeC TBT-alt port mode we must use the TBT AUX power domain,

> fix that.

> 

> Cc: Manasi Navare <manasi.d.navare@intel.com>

> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>

> Signed-off-by: Imre Deak <imre.deak@intel.com>

> ---

>  drivers/gpu/drm/i915/intel_display.c | 19 +++++++++++++++++++

>  1 file changed, 19 insertions(+)

> 

> diff --git a/drivers/gpu/drm/i915/intel_display.c

> b/drivers/gpu/drm/i915/intel_display.c

> index 26474788b7b2..0e425a6eebf3 100644

> --- a/drivers/gpu/drm/i915/intel_display.c

> +++ b/drivers/gpu/drm/i915/intel_display.c

> @@ -6609,6 +6609,25 @@ enum intel_display_power_domain

> intel_port_to_power_domain(enum port port)

>  enum intel_display_power_domain

>  intel_aux_power_domain(struct intel_digital_port *dig_port)

>  {

> +	struct drm_i915_private *dev_priv = to_i915(dig_port-

> >base.base.dev);

> +

> +	if (intel_port_is_tc(dev_priv, dig_port->base.port) &&

> +	    dig_port->tc_mode == TC_PORT_TBT_ALT) {

> +		switch (dig_port->aux_ch) {

> +		case AUX_CH_C:

> +			return POWER_DOMAIN_AUX_TBT1;

> +		case AUX_CH_D:

> +			return POWER_DOMAIN_AUX_TBT2;

> +		case AUX_CH_E:

> +			return POWER_DOMAIN_AUX_TBT3;

> +		case AUX_CH_F:

> +			return POWER_DOMAIN_AUX_TBT4;

> +		default:

> +			MISSING_CASE(dig_port->aux_ch);

> +			return POWER_DOMAIN_AUX_TBT1;

> +		}

> +	}



I would go by:
return dig_port->aux_ch - AUX_CH_C + POWER_DOMAIN_AUX_TBT1;

but that works too.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>


> +

>  	switch (dig_port->aux_ch) {

>  	case AUX_CH_A:

>  		return POWER_DOMAIN_AUX_A;