summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2023-03-23 16:20:20 +0200
committerImre Deak <imre.deak@intel.com>2023-04-03 11:35:30 +0300
commit3b7d5663702373358d58987a3684f6c59443d9d4 (patch)
tree37b9c68a13e248e9418dced279ffce1e6b4264b2
parentbd0fdd31c1023b9d94a470ed5bc301c3f9d80519 (diff)
drm/i915/tc: Fix up the legacy VBT flag only in disconnected mode
A follow-up patch simplifies the tc_cold_block()/unblock() functions, dropping the power domain parameter. For this it must be ensured that the power domain - which depends on the actual TC mode and so the VBT legacy port flag - can't change while the PHY is in a connected state and accordingly TC-cold is blocked. Make this so, by fixing up the VBT legacy flag only in the disconnected TC mode, instead of whenever the HPD state is retrieved. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230323142035.1432621-15-imre.deak@intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_tc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
index cdac808aac3c..b4e5de676816 100644
--- a/drivers/gpu/drm/i915/display/intel_tc.c
+++ b/drivers/gpu/drm/i915/display/intel_tc.c
@@ -298,6 +298,11 @@ static void tc_port_fixup_legacy_flag(struct intel_tc_port *tc,
struct drm_i915_private *i915 = tc_to_i915(tc);
u32 valid_hpd_mask;
+ drm_WARN_ON(&i915->drm, tc->mode != TC_PORT_DISCONNECTED);
+
+ if (hweight32(live_status_mask) != 1)
+ return;
+
if (tc->legacy_port)
valid_hpd_mask = BIT(TC_PORT_LEGACY);
else
@@ -625,8 +630,7 @@ static u32 tc_phy_hpd_live_status(struct intel_tc_port *tc)
mask = tc->phy_ops->hpd_live_status(tc);
/* The sink can be connected only in a single mode. */
- if (!drm_WARN_ON_ONCE(&i915->drm, hweight32(mask) > 1))
- tc_port_fixup_legacy_flag(tc, mask);
+ drm_WARN_ON_ONCE(&i915->drm, hweight32(mask) > 1);
return mask;
}
@@ -826,9 +830,12 @@ tc_phy_get_target_mode(struct intel_tc_port *tc)
static void tc_phy_connect(struct intel_tc_port *tc, int required_lanes)
{
struct drm_i915_private *i915 = tc_to_i915(tc);
+ u32 live_status_mask = tc_phy_hpd_live_status(tc);
bool connected;
- tc->mode = tc_phy_get_target_mode(tc);
+ tc_port_fixup_legacy_flag(tc, live_status_mask);
+
+ tc->mode = hpd_mask_to_target_mode(tc, live_status_mask);
connected = tc->phy_ops->connect(tc, required_lanes);
if (!connected && tc->mode != default_tc_mode(tc)) {