drm/i915/lvds: Remove incorrect mode locking
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 12 Sep 2010 15:33:47 +0000 (16:33 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 13 Sep 2010 09:25:52 +0000 (10:25 +0100)
One doesn't need to hold the mode lock in order to duplicate a mode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_lvds.c

index bfc1bb443b057426e8c27b605ddb4ccbbb994e38..a05ca32867820a95dbdb19250052d97903a7fcd8 100644 (file)
@@ -732,7 +732,6 @@ static void intel_find_lvds_downclock(struct drm_device *dev,
        panel_fixed_mode = dev_priv->panel_fixed_mode;
        temp_downclock = panel_fixed_mode->clock;
 
-       mutex_lock(&dev->mode_config.mutex);
        list_for_each_entry(scan, &connector->probed_modes, head) {
                /*
                 * If one mode has the same resolution with the fixed_panel
@@ -758,7 +757,6 @@ static void intel_find_lvds_downclock(struct drm_device *dev,
                        }
                }
        }
-       mutex_unlock(&dev->mode_config.mutex);
        if (temp_downclock < panel_fixed_mode->clock &&
            i915_lvds_downclock) {
                /* We found the downclock for LVDS. */
@@ -929,23 +927,18 @@ void intel_lvds_init(struct drm_device *dev)
                dev_priv->lvds_edid_good = false;
 
        list_for_each_entry(scan, &connector->probed_modes, head) {
-               mutex_lock(&dev->mode_config.mutex);
                if (scan->type & DRM_MODE_TYPE_PREFERRED) {
                        dev_priv->panel_fixed_mode =
                                drm_mode_duplicate(dev, scan);
-                       mutex_unlock(&dev->mode_config.mutex);
                        intel_find_lvds_downclock(dev, connector);
                        goto out;
                }
-               mutex_unlock(&dev->mode_config.mutex);
        }
 
        /* Failed to get EDID, what about VBT? */
        if (dev_priv->lfp_lvds_vbt_mode) {
-               mutex_lock(&dev->mode_config.mutex);
                dev_priv->panel_fixed_mode =
                        drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode);
-               mutex_unlock(&dev->mode_config.mutex);
                if (dev_priv->panel_fixed_mode) {
                        dev_priv->panel_fixed_mode->type |=
                                DRM_MODE_TYPE_PREFERRED;