Commit e0b1ef58 authored by Imre Deak's avatar Imre Deak

drm/i915/tc: Check TC mode instead of the VBT legacy flag

After the previous patch the TC mode in the connect/disconnect functions
is always in sync with the VBT legacy port flag, so for consistency with
the rest of the function check the TC mode instead of the VBT flag.
Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230323142035.1432621-16-imre.deak@intel.com
parent 3b7d5663
...@@ -449,7 +449,7 @@ static bool tc_phy_verify_legacy_or_dp_alt_mode(struct intel_tc_port *tc, ...@@ -449,7 +449,7 @@ static bool tc_phy_verify_legacy_or_dp_alt_mode(struct intel_tc_port *tc,
int max_lanes; int max_lanes;
max_lanes = intel_tc_port_fia_max_lane_count(dig_port); max_lanes = intel_tc_port_fia_max_lane_count(dig_port);
if (tc->legacy_port) { if (tc->mode == TC_PORT_LEGACY) {
drm_WARN_ON(&i915->drm, max_lanes != 4); drm_WARN_ON(&i915->drm, max_lanes != 4);
return true; return true;
} }
...@@ -485,16 +485,15 @@ static bool icl_tc_phy_connect(struct intel_tc_port *tc, ...@@ -485,16 +485,15 @@ static bool icl_tc_phy_connect(struct intel_tc_port *tc,
if (tc->mode == TC_PORT_TBT_ALT) if (tc->mode == TC_PORT_TBT_ALT)
return true; return true;
if (!tc_phy_is_ready(tc) && if ((!tc_phy_is_ready(tc) ||
!drm_WARN_ON(&i915->drm, tc->legacy_port)) { !tc_phy_take_ownership(tc, true)) &&
drm_dbg_kms(&i915->drm, "Port %s: PHY not ready\n", !drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY)) {
tc->port_name); drm_dbg_kms(&i915->drm, "Port %s: can't take PHY ownership (ready %s)\n",
tc->port_name,
str_yes_no(tc_phy_is_ready(tc)));
return false; return false;
} }
if (!tc_phy_take_ownership(tc, true) &&
!drm_WARN_ON(&i915->drm, tc->legacy_port))
return false;
if (!tc_phy_verify_legacy_or_dp_alt_mode(tc, required_lanes)) if (!tc_phy_verify_legacy_or_dp_alt_mode(tc, required_lanes))
goto out_release_phy; goto out_release_phy;
......
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