drm/i915: Add fixed panel mode parsed from EDID for eDP without fixed mode in VBT
authorZhao Yakui <yakui.zhao@intel.com>
Mon, 19 Jul 2010 08:43:11 +0000 (09:43 +0100)
committerEric Anholt <eric@anholt.net>
Mon, 2 Aug 2010 02:40:00 +0000 (19:40 -0700)
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_dp.c

index f7410cffa8c90015bea54cbb0d3812d3d92931e8..2b99ab23dc8a38d26e8b50b14bae0013ad631526 100644 (file)
@@ -1374,8 +1374,22 @@ static int intel_dp_get_modes(struct drm_connector *connector)
         */
 
        ret = intel_ddc_get_modes(connector, intel_encoder->ddc_bus);
-       if (ret)
+       if (ret) {
+               if ((IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) &&
+                   !dev_priv->panel_fixed_mode) {
+                       struct drm_display_mode *newmode;
+                       list_for_each_entry(newmode, &connector->probed_modes,
+                                           head) {
+                               if (newmode->type & DRM_MODE_TYPE_PREFERRED) {
+                                       dev_priv->panel_fixed_mode =
+                                               drm_mode_duplicate(dev, newmode);
+                                       break;
+                               }
+                       }
+               }
+
                return ret;
+       }
 
        /* if eDP has no EDID, try to use fixed panel mode from VBT */
        if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) {