Commit 5b6a9ba9 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Don't check tc_mode unless dealing with a TC PHY

We shouldn't really trust tc_mode on non-TC PHYs since we never
initialize it explicitly. So let's check for the PHY type first.
Fortunately TC_PORT_TBT_ALT happens to be zero so I don't think
there's an actual bug here, just a possibility for a future one
if someone rearranges the enum values.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210128155948.13678-5-ville.syrjala@linux.intel.comReviewed-by: default avatarImre Deak <imre.deak@intel.com>
parent c9b69041
...@@ -3443,10 +3443,12 @@ icl_program_mg_dp_mode(struct intel_digital_port *dig_port, ...@@ -3443,10 +3443,12 @@ icl_program_mg_dp_mode(struct intel_digital_port *dig_port,
{ {
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port); enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port);
enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port);
u32 ln0, ln1, pin_assignment; u32 ln0, ln1, pin_assignment;
u8 width; u8 width;
if (dig_port->tc_mode == TC_PORT_TBT_ALT) if (!intel_phy_is_tc(dev_priv, phy) ||
dig_port->tc_mode == TC_PORT_TBT_ALT)
return; return;
if (INTEL_GEN(dev_priv) >= 12) { if (INTEL_GEN(dev_priv) >= 12) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment