Skip to contentSkip to conversation

drm/i915/ddi: fix intel_display_port_aux_power_domain() after HDMI detect

PATCH In review Imre Deak 3 participants 5 messages Nov 18, 2015

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/2 drm/i915/ddi: fix intel_display_port_aux_power_domain() after HDMI detect

Due to the current sharing of the DDI encoder between DP and HDMI connectors we can run the DP detection after the HDMI detection has already set the shared encoder's type. For now solve this keeping the current behavior and running the detection in this case too. For a proper solution Ville suggested to split the encoder into an HDMI and DP one, that can be done as a follow-up.

This issue triggers the WARN in intel_display_port_aux_power_domain() and was introduced in:
commit 25f78f58e5bfb46a270ce4d690fb49dc104558b1

Author: Ville Syrjälä <[email protected]>
Date:   Mon Nov 16 15:01:04 2015 +0100

drm/i915: Clean up AUX power domain handling

CC Patrik Jakobsson <[email protected]>
CC Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +8 -1
index 688d484..cdc1761 100644
@@ -5230,7 +5230,14 @@ intel_display_port_aux_power_domain(struct intel_encoder *intel_encoder)
 
 	switch (intel_encoder->type) {
 	case INTEL_OUTPUT_UNKNOWN:
-		/* Only DDI platforms should ever use this output type */
+	case INTEL_OUTPUT_HDMI:
+		/*
+		 * Only DDI platforms should ever use these output types.
+		 * We can get here after the HDMI detect code has already set
+		 * the type of the shared encoder. Since we can't be sure
+		 * what's the status of the given connectors, play safe and
+		 * run the DP detection too.
+		 */
 		WARN_ON_ONCE(!HAS_DDI(dev));
 	case INTEL_OUTPUT_DISPLAYPORT:
 	case INTEL_OUTPUT_EDP:
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#1 lore raw

PATCH 2/2 drm/i915: add MISSING_CASE to a few port/aux power domain helpers

MISSING_CASE() would have been useful to track down a recent problem in intel_display_port_aux_power_domain(), so add it there and a few related helpers. This was also suggested by Ville in his review of the latest DMC/DC changes, we forgot to address that.

---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -3
index cdc1761..b3d0557 100644
@@ -5166,7 +5166,7 @@ static enum intel_display_power_domain port_to_power_domain(enum port port)
 	case PORT_E:
 		return POWER_DOMAIN_PORT_DDI_E_LANES;
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);
 		return POWER_DOMAIN_PORT_OTHER;
 	}
 }
@@ -5186,7 +5186,7 @@ static enum intel_display_power_domain port_to_aux_power_domain(enum port port)
 		/* FIXME: Check VBT for actual wiring of PORT E */
 		return POWER_DOMAIN_AUX_D;
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);
 		return POWER_DOMAIN_AUX_A;
 	}
 }
@@ -5247,7 +5247,7 @@ intel_display_port_aux_power_domain(struct intel_encoder *intel_encoder)
 		intel_dig_port = enc_to_mst(&intel_encoder->base)->primary;
 		return port_to_aux_power_domain(intel_dig_port->port);
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(intel_encoder->type);
 		return POWER_DOMAIN_AUX_A;
 	}
 }
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/i915: add MISSING_CASE to a few port/aux power domain helpers

Quoted 6 lines · Imre Deak

MISSING_CASE() would have been useful to track down a recent problem in intel_display_port_aux_power_domain(), so add it there and a few related helpers. This was also suggested by Ville in his review of the latest DMC/DC changes, we forgot to address that.

Quoted 37 lines
---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -3
index cdc1761..b3d0557 100644
@@ -5166,7 +5166,7 @@ static enum intel_display_power_domain port_to_power_domain(enum port port)
 	case PORT_E:
 		return POWER_DOMAIN_PORT_DDI_E_LANES;
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);
 		return POWER_DOMAIN_PORT_OTHER;
 	}
 }
@@ -5186,7 +5186,7 @@ static enum intel_display_power_domain port_to_aux_power_domain(enum port port)
 		/* FIXME: Check VBT for actual wiring of PORT E */
 		return POWER_DOMAIN_AUX_D;
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);
 		return POWER_DOMAIN_AUX_A;
 	}
 }
@@ -5247,7 +5247,7 @@ intel_display_port_aux_power_domain(struct intel_encoder *intel_encoder)
 		intel_dig_port = enc_to_mst(&intel_encoder->base)->primary;
 		return port_to_aux_power_domain(intel_dig_port->port);
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(intel_encoder->type);
 		return POWER_DOMAIN_AUX_A;
 	}
 }
Signature · 1 line
2.5.0
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] drm/i915: add MISSING_CASE to a few port/aux power domain helpers

In reply to Imre Deak
Quoted 6 lines · Imre Deak

MISSING_CASE() would have been useful to track down a recent problem in intel_display_port_aux_power_domain(), so add it there and a few related helpers. This was also suggested by Ville in his review of the latest DMC/DC changes, we forgot to address that.

Quoted 38 lines
---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -3
index cdc1761..b3d0557 100644
@@ -5166,7 +5166,7 @@ static enum intel_display_power_domain port_to_power_domain(enum port port)
 	case PORT_E:
 		return POWER_DOMAIN_PORT_DDI_E_LANES;
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);
 		return POWER_DOMAIN_PORT_OTHER;
 	}
 }
@@ -5186,7 +5186,7 @@ static enum intel_display_power_domain port_to_aux_power_domain(enum port port)
 		/* FIXME: Check VBT for actual wiring of PORT E */
 		return POWER_DOMAIN_AUX_D;
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);
 		return POWER_DOMAIN_AUX_A;
 	}
 }
@@ -5247,7 +5247,7 @@ intel_display_port_aux_power_domain(struct intel_encoder *intel_encoder)
 		intel_dig_port = enc_to_mst(&intel_encoder->base)->primary;
 		return port_to_aux_power_domain(intel_dig_port->port);
 	default:
-		WARN_ON_ONCE(1);
+		MISSING_CASE(intel_encoder->type);
 		return POWER_DOMAIN_AUX_A;
 	}
 }
Signature · 1 line
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

author
#4 lore raw

Re: [PATCH 2/2] drm/i915: add MISSING_CASE to a few port/aux power domain helpers

Quoted 9 lines · Patrik Jakobsson
Quoted 8 lines · Imre Deak

MISSING_CASE() would have been useful to track down a recent problem in
intel_display_port_aux_power_domain(), so add it there and a few related
helpers. This was also suggested by Ville in his review of the latest
DMC/DC changes, we forgot to address that.

Quoted 3 lines
Quoted 1 line

Pushed both patches to dinq, thanks for the review.

Quoted 33 lines
Quoted 33 lines

---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---

 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index cdc1761..b3d0557 100644
@@ -5166,7 +5166,7 @@ static enum intel_display_power_domain
 port_to_power_domain(enum port port)

  case PORT_E:
  return POWER_DOMAIN_PORT_DDI_E_LANES; default:

drivers/gpu/drm/i915/intel_display.c +1 -1
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);

  return POWER_DOMAIN_PORT_OTHER;
  }
 }

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -5186,7 +5186,7 @@ static enum intel_display_power_domain
 port_to_aux_power_domain(enum port port)
  		/* FIXME: Check VBT for actual wiring of PORT E */
  		return POWER_DOMAIN_AUX_D;

  default:

drivers/gpu/drm/i915/intel_display.c +1 -1
-		WARN_ON_ONCE(1);
+		MISSING_CASE(port);

  return POWER_DOMAIN_AUX_A;
  }
 }

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -5247,7 +5247,7 @@ intel_display_port_aux_power_domain(struct
 intel_encoder *intel_encoder)

  intel_dig_port = enc_to_mst(&intel_encoder->base)-

Quoted 1 line

primary;

Quoted 8 lines
Quoted 8 lines

  return port_to_aux_power_domain(intel_dig_port-

Quoted 1 line

port);

  default:

drivers/gpu/drm/i915/intel_display.c +1 -1
-		WARN_ON_ONCE(1);
+		MISSING_CASE(intel_encoder->type);

  return POWER_DOMAIN_AUX_A;
  }
 }

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx