[PATCH] drm/i915/icl+: Prevent using non-TypeC AUX channels on TypeC ports
Imre Deak
imre.deak at intel.com
Thu Apr 23 16:40:09 UTC 2020
Using an AUX channel which by default belongs to a non-TypeC PHY won't
work on a TypeC PHY, since - as a side-effect besides providing an AUX
channel - the AUX channel power well affects power manangement specific
to the TypeC subsystem. Using a TypeC AUX channel on a non-TypeC PHY
would probably also cause problems, so for simplicity prevent both.
This fixes at least an ICL-Y machine in CI, which has a buggy VBT
setting AUX-B as an alternative channel for port C.
Signed-off-by: Imre Deak <imre.deak at intel.com>
---
drivers/gpu/drm/i915/display/intel_bios.c | 30 +++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 839124647202..ab360e31e351 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -1543,6 +1543,8 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
{
struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
enum port p;
+ bool aux_is_tc;
+ bool phy_is_tc;
if (!info->alternate_aux_channel)
return;
@@ -1571,6 +1573,34 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
info->supports_dp = false;
info->alternate_aux_channel = 0;
+
+ return;
+ }
+
+ p = (enum port)info->alternate_aux_channel;
+ aux_is_tc = intel_phy_is_tc(dev_priv,
+ intel_port_to_phy(dev_priv, p));
+ phy_is_tc = intel_phy_is_tc(dev_priv,
+ intel_port_to_phy(dev_priv, port));
+ if (aux_is_tc != phy_is_tc) {
+ /*
+ * Using an AUX channel which by default belongs to a TypeC
+ * PHY can't be used for non-TypeC PHYs and vice-versa. The
+ * reason is that TypeC AUX power wells can only be enabled in
+ * the current TypeC mode of the PHY and have an effect on power
+ * management specific to the TypeC subsystem.
+ */
+ drm_dbg_kms(&dev_priv->drm,
+ "port %c on a %s PHY trying to use the %s AUX CH 0x%x, "
+ "disabling port %c DP support\n",
+ port_name(port),
+ phy_is_tc ? "TypeC" : "non-TypeC",
+ aux_is_tc ? "TypeC" : "non-TypeC",
+ info->alternate_aux_channel,
+ port_name(port));
+
+ info->supports_dp = false;
+ info->alternate_aux_channel = 0;
}
}
--
2.20.1
More information about the Intel-gfx-trybot
mailing list