Revert "vc4: cec: Restore cec physical address on reconnect"
authorMaxime Ripard <maxime@cerno.tech>
Tue, 8 Dec 2020 16:12:19 +0000 (17:12 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Fri, 5 Feb 2021 15:25:12 +0000 (15:25 +0000)
This reverts commit 250344082a3957825d425ded325547e72a34fd65.

drivers/gpu/drm/vc4/vc4_hdmi.c

index 9335124..6ba26f9 100644 (file)
@@ -452,29 +452,20 @@ static enum drm_connector_status
 vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
 {
        struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
-       bool connected = false;
 
        if (vc4_hdmi->hpd_gpio) {
                if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^
                    vc4_hdmi->hpd_active_low)
-                       connected = true;
-       } else if (drm_probe_ddc(vc4_hdmi->ddc))
-               connected = true;
+                       return connector_status_connected;
+               cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
+               return connector_status_disconnected;
+       }
+
+       if (drm_probe_ddc(vc4_hdmi->ddc))
+               return connector_status_connected;
+
        if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED)
-               connected = true;
-       if (connected) {
-               if (connector->status != connector_status_connected) {
-                       struct edid *edid = drm_get_edid(connector, vc4_hdmi->ddc);
-
-                       if (edid) {
-                               cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid);
-                               vc4_hdmi->encoder.hdmi_monitor = drm_detect_hdmi_monitor(edid);
-                               drm_connector_update_edid_property(connector, edid);
-                               kfree(edid);
-                       }
-               }
                return connector_status_connected;
-       }
        cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
        return connector_status_disconnected;
 }