Merge tag 'drm-intel-next-2014-03-21' of git://anongit.freedesktop.org/drm-intel...
[linux-2.6-block.git] / drivers / gpu / drm / i915 / intel_lvds.c
index fecff3c2b9e18aecc13435262def62312cb60037..f1ecf916474a93e3a18dd604991a8915309d83cb 100644 (file)
@@ -963,7 +963,7 @@ void intel_lvds_init(struct drm_device *dev)
        intel_connector_attach_encoder(intel_connector, intel_encoder);
        intel_encoder->type = INTEL_OUTPUT_LVDS;
 
-       intel_encoder->cloneable = false;
+       intel_encoder->cloneable = 0;
        if (HAS_PCH_SPLIT(dev))
                intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
        else if (IS_GEN4(dev))
@@ -1002,6 +1002,7 @@ void intel_lvds_init(struct drm_device *dev)
         * Attempt to get the fixed panel mode from DDC.  Assume that the
         * preferred mode is the right one.
         */
+       mutex_lock(&dev->mode_config.mutex);
        edid = drm_get_edid(connector, intel_gmbus_get_adapter(dev_priv, pin));
        if (edid) {
                if (drm_add_edid_modes(connector, edid)) {
@@ -1095,6 +1096,8 @@ void intel_lvds_init(struct drm_device *dev)
                goto failed;
 
 out:
+       mutex_unlock(&dev->mode_config.mutex);
+
        lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
        DRM_DEBUG_KMS("detected %s-link lvds configuration\n",
                      lvds_encoder->is_dual_link ? "dual" : "single");
@@ -1123,6 +1126,8 @@ out:
        return;
 
 failed:
+       mutex_unlock(&dev->mode_config.mutex);
+
        DRM_DEBUG_KMS("No LVDS modes found, disabling.\n");
        drm_connector_cleanup(connector);
        drm_encoder_cleanup(encoder);