drm/i915/ehl: Make icp_digital_port_connected() use phy instead of port
authorMatt Roper <matthew.d.roper@intel.com>
Wed, 27 Nov 2019 22:13:13 +0000 (14:13 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Mon, 2 Dec 2019 16:18:50 +0000 (08:18 -0800)
When looking at SDEISR to determine the connection status of combo
outputs, we should use the phy index rather than the port index.
Although they're usually the same thing, EHL's DDI-D (port D) is
attached to PHY-A and SDEISR doesn't even have bits for a "D" output.
It's also possible that future platforms may map DDIs (the internal
display engine programming units) to PHYs (the output handling on the IO
side) in ways where port!=phy, so let's look at the PHY index by
default.

v2: Rename to intel_combo_phy_connected.  (Lucas)

Fixes: 719d24002602 ("drm/i915/ehl: Enable DDI-D")
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191127221314.575575-2-matthew.d.roper@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index dde1b252d0543af9f8fe420778a368b348e741b5..6611119b9f9bb58b84831f7ee46de5afab5a1a18 100644 (file)
@@ -5487,15 +5487,13 @@ static bool bxt_digital_port_connected(struct intel_encoder *encoder)
        return I915_READ(GEN8_DE_PORT_ISR) & bit;
 }
 
-static bool icl_combo_port_connected(struct drm_i915_private *dev_priv,
-                                    struct intel_digital_port *intel_dig_port)
+static bool intel_combo_phy_connected(struct drm_i915_private *dev_priv,
+                                     enum phy phy)
 {
-       enum port port = intel_dig_port->base.port;
-
-       if (HAS_PCH_MCC(dev_priv) && port == PORT_C)
+       if (HAS_PCH_MCC(dev_priv) && phy == PHY_C)
                return I915_READ(SDEISR) & SDE_TC_HOTPLUG_ICP(PORT_TC1);
 
-       return I915_READ(SDEISR) & SDE_DDI_HOTPLUG_ICP(port);
+       return I915_READ(SDEISR) & SDE_DDI_HOTPLUG_ICP(phy);
 }
 
 static bool icp_digital_port_connected(struct intel_encoder *encoder)
@@ -5505,7 +5503,7 @@ static bool icp_digital_port_connected(struct intel_encoder *encoder)
        enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
 
        if (intel_phy_is_combo(dev_priv, phy))
-               return icl_combo_port_connected(dev_priv, dig_port);
+               return intel_combo_phy_connected(dev_priv, phy);
        else if (intel_phy_is_tc(dev_priv, phy))
                return intel_tc_port_connected(dig_port);
        else