Merge tag 'drm-intel-next-2018-07-19' of git://anongit.freedesktop.org/drm/drm-intel...
[platform/kernel/linux-rpi.git] / drivers / gpu / drm / i915 / intel_dp.c
index fee23cf..cd0f649 100644 (file)
@@ -4333,6 +4333,9 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)
                        DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n");
        }
 
+       /* Handle CEC interrupts, if any */
+       drm_dp_cec_irq(&intel_dp->aux);
+
        /* defer to the hotplug work for link retraining if needed */
        if (intel_dp_needs_link_retrain(intel_dp))
                return false;
@@ -4642,6 +4645,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp)
        intel_connector->detect_edid = edid;
 
        intel_dp->has_audio = drm_detect_monitor_audio(edid);
+       drm_dp_cec_set_edid(&intel_dp->aux, edid);
 }
 
 static void
@@ -4649,6 +4653,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
 {
        struct intel_connector *intel_connector = intel_dp->attached_connector;
 
+       drm_dp_cec_unset_edid(&intel_dp->aux);
        kfree(intel_connector->detect_edid);
        intel_connector->detect_edid = NULL;
 
@@ -4837,6 +4842,7 @@ static int
 intel_dp_connector_register(struct drm_connector *connector)
 {
        struct intel_dp *intel_dp = intel_attached_dp(connector);
+       struct drm_device *dev = connector->dev;
        int ret;
 
        ret = intel_connector_register(connector);
@@ -4849,13 +4855,20 @@ intel_dp_connector_register(struct drm_connector *connector)
                      intel_dp->aux.name, connector->kdev->kobj.name);
 
        intel_dp->aux.dev = connector->kdev;
-       return drm_dp_aux_register(&intel_dp->aux);
+       ret = drm_dp_aux_register(&intel_dp->aux);
+       if (!ret)
+               drm_dp_cec_register_connector(&intel_dp->aux,
+                                             connector->name, dev->dev);
+       return ret;
 }
 
 static void
 intel_dp_connector_unregister(struct drm_connector *connector)
 {
-       drm_dp_aux_unregister(&intel_attached_dp(connector)->aux);
+       struct intel_dp *intel_dp = intel_attached_dp(connector);
+
+       drm_dp_cec_unregister_connector(&intel_dp->aux);
+       drm_dp_aux_unregister(&intel_dp->aux);
        intel_connector_unregister(connector);
 }
 
@@ -6051,7 +6064,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
        edid = drm_get_edid(connector, &intel_dp->aux.ddc);
        if (edid) {
                if (drm_add_edid_modes(connector, edid)) {
-                       drm_mode_connector_update_edid_property(connector,
+                       drm_connector_update_edid_property(connector,
                                                                edid);
                } else {
                        kfree(edid);
@@ -6140,8 +6153,8 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
        /* Set connector link status to BAD and send a Uevent to notify
         * userspace to do a modeset.
         */
-       drm_mode_connector_set_link_status_property(connector,
-                                                   DRM_MODE_LINK_STATUS_BAD);
+       drm_connector_set_link_status_property(connector,
+                                              DRM_MODE_LINK_STATUS_BAD);
        mutex_unlock(&connector->dev->mode_config.mutex);
        /* Send Hotplug uevent so userspace can reprobe */
        drm_kms_helper_hotplug_event(connector->dev);