Commit ab7bc4e1 authored by Imre Deak's avatar Imre Deak

drm/i915: Unify the TypeC port notation in debug/error messages

Unify the TypeC port notation in log messages, so that it matches the
spec. For instance the first ICL TypeC port will read as 'Port C/TC#1'.

v2:
- Format print the name only once. (José)

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190628143635.22066-9-imre.deak@intel.com
parent dd7239c5
...@@ -4265,9 +4265,12 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) ...@@ -4265,9 +4265,12 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
intel_dig_port->max_lanes = intel_ddi_max_lanes(intel_dig_port); intel_dig_port->max_lanes = intel_ddi_max_lanes(intel_dig_port);
intel_dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port); intel_dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
intel_dig_port->tc_legacy_port = intel_port_is_tc(dev_priv, port) && if (intel_port_is_tc(dev_priv, port)) {
!port_info->supports_typec_usb && bool is_legacy = !port_info->supports_typec_usb &&
!port_info->supports_tbt; !port_info->supports_tbt;
intel_tc_port_init(intel_dig_port, is_legacy);
}
switch (port) { switch (port) {
case PORT_A: case PORT_A:
......
...@@ -86,7 +86,8 @@ static bool icl_tc_phy_connect(struct intel_digital_port *dig_port) ...@@ -86,7 +86,8 @@ static bool icl_tc_phy_connect(struct intel_digital_port *dig_port)
val = I915_READ(PORT_TX_DFLEXDPPMS); val = I915_READ(PORT_TX_DFLEXDPPMS);
if (!(val & DP_PHY_MODE_STATUS_COMPLETED(tc_port))) { if (!(val & DP_PHY_MODE_STATUS_COMPLETED(tc_port))) {
DRM_DEBUG_KMS("DP PHY for TC port %d not ready\n", tc_port); DRM_DEBUG_KMS("Port %s: PHY not ready\n",
dig_port->tc_port_name);
WARN_ON(dig_port->tc_legacy_port); WARN_ON(dig_port->tc_legacy_port);
return false; return false;
} }
...@@ -107,7 +108,8 @@ static bool icl_tc_phy_connect(struct intel_digital_port *dig_port) ...@@ -107,7 +108,8 @@ static bool icl_tc_phy_connect(struct intel_digital_port *dig_port)
*/ */
if (dig_port->tc_mode == TC_PORT_DP_ALT && if (dig_port->tc_mode == TC_PORT_DP_ALT &&
!(I915_READ(PORT_TX_DFLEXDPSP) & TC_LIVE_STATE_TC(tc_port))) { !(I915_READ(PORT_TX_DFLEXDPSP) & TC_LIVE_STATE_TC(tc_port))) {
DRM_DEBUG_KMS("TC PHY %d sudden disconnect.\n", tc_port); DRM_DEBUG_KMS("Port %s: PHY sudden disconnect\n",
dig_port->tc_port_name);
icl_tc_phy_disconnect(dig_port); icl_tc_phy_disconnect(dig_port);
return false; return false;
} }
...@@ -137,8 +139,8 @@ void icl_tc_phy_disconnect(struct intel_digital_port *dig_port) ...@@ -137,8 +139,8 @@ void icl_tc_phy_disconnect(struct intel_digital_port *dig_port)
I915_WRITE(PORT_TX_DFLEXDPCSSS, val); I915_WRITE(PORT_TX_DFLEXDPCSSS, val);
} }
DRM_DEBUG_KMS("Port %c TC type %s disconnected\n", DRM_DEBUG_KMS("Port %s: mode %s disconnected\n",
port_name(dig_port->base.port), dig_port->tc_port_name,
tc_port_mode_name(dig_port->tc_mode)); tc_port_mode_name(dig_port->tc_mode));
dig_port->tc_mode = TC_PORT_TBT_ALT; dig_port->tc_mode = TC_PORT_TBT_ALT;
...@@ -148,7 +150,6 @@ static void icl_update_tc_port_type(struct drm_i915_private *dev_priv, ...@@ -148,7 +150,6 @@ static void icl_update_tc_port_type(struct drm_i915_private *dev_priv,
struct intel_digital_port *intel_dig_port, struct intel_digital_port *intel_dig_port,
bool is_legacy, bool is_typec, bool is_tbt) bool is_legacy, bool is_typec, bool is_tbt)
{ {
enum port port = intel_dig_port->base.port;
enum tc_port_mode old_mode = intel_dig_port->tc_mode; enum tc_port_mode old_mode = intel_dig_port->tc_mode;
WARN_ON(is_legacy + is_typec + is_tbt != 1); WARN_ON(is_legacy + is_typec + is_tbt != 1);
...@@ -163,7 +164,8 @@ static void icl_update_tc_port_type(struct drm_i915_private *dev_priv, ...@@ -163,7 +164,8 @@ static void icl_update_tc_port_type(struct drm_i915_private *dev_priv,
return; return;
if (old_mode != intel_dig_port->tc_mode) if (old_mode != intel_dig_port->tc_mode)
DRM_DEBUG_KMS("Port %c has TC type %s\n", port_name(port), DRM_DEBUG_KMS("Port %s: port has mode %s\n",
intel_dig_port->tc_port_name,
tc_port_mode_name(intel_dig_port->tc_mode)); tc_port_mode_name(intel_dig_port->tc_mode));
} }
...@@ -191,8 +193,8 @@ bool intel_tc_port_connected(struct intel_digital_port *dig_port) ...@@ -191,8 +193,8 @@ bool intel_tc_port_connected(struct intel_digital_port *dig_port)
*/ */
if (!dig_port->tc_legacy_port && if (!dig_port->tc_legacy_port &&
I915_READ(SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port)) { I915_READ(SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port)) {
DRM_ERROR("VBT incorrectly claims port %c is not TypeC legacy\n", DRM_ERROR("Port %s: VBT incorrectly claims port is not TypeC legacy\n",
port_name(port)); dig_port->tc_port_name);
dig_port->tc_legacy_port = true; dig_port->tc_legacy_port = true;
} }
is_legacy = dig_port->tc_legacy_port; is_legacy = dig_port->tc_legacy_port;
...@@ -220,3 +222,17 @@ bool intel_tc_port_connected(struct intel_digital_port *dig_port) ...@@ -220,3 +222,17 @@ bool intel_tc_port_connected(struct intel_digital_port *dig_port)
return true; return true;
} }
void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
{
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
enum port port = dig_port->base.port;
enum tc_port tc_port = intel_port_to_tc(i915, port);
if (WARN_ON(tc_port == PORT_TC_NONE))
return;
snprintf(dig_port->tc_port_name, sizeof(dig_port->tc_port_name),
"%c/TC#%d", port_name(port), tc_port + 1);
dig_port->tc_legacy_port = is_legacy;
}
...@@ -15,4 +15,6 @@ void icl_tc_phy_disconnect(struct intel_digital_port *dig_port); ...@@ -15,4 +15,6 @@ void icl_tc_phy_disconnect(struct intel_digital_port *dig_port);
bool intel_tc_port_connected(struct intel_digital_port *dig_port); bool intel_tc_port_connected(struct intel_digital_port *dig_port);
int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port); int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port);
void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy);
#endif /* __INTEL_TC_H__ */ #endif /* __INTEL_TC_H__ */
...@@ -1225,6 +1225,7 @@ struct intel_digital_port { ...@@ -1225,6 +1225,7 @@ struct intel_digital_port {
enum aux_ch aux_ch; enum aux_ch aux_ch;
enum intel_display_power_domain ddi_io_power_domain; enum intel_display_power_domain ddi_io_power_domain;
bool tc_legacy_port:1; bool tc_legacy_port:1;
char tc_port_name[8];
enum tc_port_mode tc_mode; enum tc_port_mode tc_mode;
void (*write_infoframe)(struct intel_encoder *encoder, void (*write_infoframe)(struct intel_encoder *encoder,
......
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