From 188bfd26cbecf2c3603ae6b3fc579804e8590dd8 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Sat, 26 Oct 2019 20:48:45 +0300 Subject: [PATCH] drm/i915: Avoid HPD poll detect triggering a new detect Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_crt.c | 3 +++ drivers/gpu/drm/i915/display/intel_dp.c | 20 +++++++++++--------- drivers/gpu/drm/i915/display/intel_hdmi.c | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index ff6126ea793c..e4f8585f80cc 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -864,6 +864,9 @@ intel_crt_detect(struct drm_connector *connector, out: intel_display_power_put(dev_priv, intel_encoder->power_domain, wakeref); + + intel_display_power_flush_work(dev_priv); + return status; } diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 86989ec25bc6..cd13e50f4905 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5600,6 +5600,7 @@ intel_dp_detect(struct drm_connector *connector, struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *encoder = &dig_port->base; enum drm_connector_status status; + int err = 0; DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); @@ -5626,7 +5627,7 @@ intel_dp_detect(struct drm_connector *connector, intel_dp->is_mst); } - goto out; + goto out_update_edid; } if (intel_dp->reset_link_params) { @@ -5654,7 +5655,7 @@ intel_dp_detect(struct drm_connector *connector, * with EDID on it */ status = connector_status_disconnected; - goto out; + goto out_update_edid; } /* @@ -5662,11 +5663,9 @@ intel_dp_detect(struct drm_connector *connector, * with an IRQ_HPD, so force a link status check. */ if (!intel_dp_is_edp(intel_dp)) { - int ret; - - ret = intel_dp_retrain_link(encoder, ctx); - if (ret) - return ret; + err = intel_dp_retrain_link(encoder, ctx); + if (err) + goto out_sync_power; } /* @@ -5684,11 +5683,14 @@ intel_dp_detect(struct drm_connector *connector, intel_dp_check_service_irq(intel_dp); -out: +out_update_edid: if (status != connector_status_connected && !intel_dp->is_mst) intel_dp_unset_edid(intel_dp); - return status; +out_sync_power: + intel_display_power_flush_work(dev_priv); + + return err ? err : status; } static void diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index b54ccbb5aad5..53f817cec005 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2626,6 +2626,8 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) if (status != connector_status_connected) cec_notifier_phys_addr_invalidate(intel_hdmi->cec_notifier); + intel_display_power_flush_work(dev_priv); + return status; } -- 2.20.1