Commit 6e0fff46 authored by Jani Nikula's avatar Jani Nikula

drm/i915/hdmi: do dual mode detect only if connected

For normal connector detect, there's really no point in trying dual mode
detect if the connector is disconnected. We can simplify the detect
sequence by skipping it. Since intel_hdmi_dp_dual_mode_detect() is only
called when EDID is present, we can drop the has_edid parameter.

The functional effect is speeding up disconnected connector detection
ever so slightly, and, combined with firmware EDID, also stop logging
about assuming dual mode adaptor.

It's a bit subtle, but this will also skip dual mode detect if the
connector is force connected and a) there's no EDID of any kind, normal
or override/firmware or b) there's EDID but it does not indicate
digital. These are corner cases no matter what, and arguably forcing
should not be limited by dual mode detect.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/f8f2a4a147e1c87ba93269a607f71fc29c4b59f6.1666614699.git.jani.nikula@intel.com
parent 71bb70f8
...@@ -2355,7 +2355,7 @@ intel_hdmi_unset_edid(struct drm_connector *connector) ...@@ -2355,7 +2355,7 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
} }
static void static void
intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector, bool has_edid) intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector)
{ {
struct drm_i915_private *dev_priv = to_i915(connector->dev); struct drm_i915_private *dev_priv = to_i915(connector->dev);
struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector)); struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector));
...@@ -2371,16 +2371,13 @@ intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector, bool has_edid) ...@@ -2371,16 +2371,13 @@ intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector, bool has_edid)
* CONFIG1 pin, but no such luck on our hardware. * CONFIG1 pin, but no such luck on our hardware.
* *
* The only method left to us is to check the VBT to see * The only method left to us is to check the VBT to see
* if the port is a dual mode capable DP port. But let's * if the port is a dual mode capable DP port.
* only do that when we sucesfully read the EDID, to avoid
* confusing log messages about DP dual mode adaptors when
* there's nothing connected to the port.
*/ */
if (type == DRM_DP_DUAL_MODE_UNKNOWN) { if (type == DRM_DP_DUAL_MODE_UNKNOWN) {
/* An overridden EDID imply that we want this port for testing. /* An overridden EDID imply that we want this port for testing.
* Make sure not to set limits for that port. * Make sure not to set limits for that port.
*/ */
if (has_edid && !connector->override_edid && if (!connector->override_edid &&
intel_bios_is_port_dp_dual_mode(dev_priv, port)) { intel_bios_is_port_dp_dual_mode(dev_priv, port)) {
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"Assuming DP dual mode adaptor presence based on VBT\n"); "Assuming DP dual mode adaptor presence based on VBT\n");
...@@ -2435,18 +2432,18 @@ intel_hdmi_set_edid(struct drm_connector *connector) ...@@ -2435,18 +2432,18 @@ intel_hdmi_set_edid(struct drm_connector *connector)
intel_gmbus_force_bit(i2c, false); intel_gmbus_force_bit(i2c, false);
} }
intel_hdmi_dp_dual_mode_detect(connector, edid != NULL);
intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS, wakeref);
to_intel_connector(connector)->detect_edid = edid; to_intel_connector(connector)->detect_edid = edid;
if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) { if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) {
intel_hdmi->has_audio = drm_detect_monitor_audio(edid); intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid); intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
intel_hdmi_dp_dual_mode_detect(connector);
connected = true; connected = true;
} }
intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS, wakeref);
cec_notifier_set_phys_addr_from_edid(intel_hdmi->cec_notifier, edid); cec_notifier_set_phys_addr_from_edid(intel_hdmi->cec_notifier, edid);
return connected; return connected;
......
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