From a9eaac4b1e8491ed278b0362f1b1045fcf1e5d72 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 22 Feb 2010 16:25:56 +0800 Subject: [PATCH] drm/i915: Ignore LVDS EDID when it is unavailabe or invalid Signed-off-by: Zhao Yakui --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_lvds.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 953ad64..6889c42 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -580,6 +580,7 @@ typedef struct drm_i915_private { struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; } mm; struct sdvo_device_mapping sdvo_mappings[2]; + bool lvds_edid_ok; /* indicate whether the LVDS_BORDER should be enabled or not */ unsigned int lvds_border_bits; diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 10462ef..3c72730 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -680,10 +680,13 @@ static int intel_lvds_get_modes(struct drm_connector *connector) struct drm_i915_private *dev_priv = dev->dev_private; int ret = 0; - ret = intel_ddc_get_modes(intel_output); + if (dev_priv->lvds_edid_ok) { + ret = intel_ddc_get_modes(intel_output); + if (ret) + return ret; - if (ret) - return ret; + dev_priv->lvds_edid_ok = 0; + } /* Didn't get an EDID, so * Set wide sync ranges so we get all modes @@ -1092,11 +1095,13 @@ void intel_lvds_init(struct drm_device *dev) goto failed; } + dev_priv->lvds_edid_ok = 1; /* * Attempt to get the fixed panel mode from DDC. Assume that the * preferred mode is the right one. */ - intel_ddc_get_modes(intel_output); + if (!intel_ddc_get_modes(intel_output)) + dev_priv->lvds_edid_ok = 0; list_for_each_entry(scan, &connector->probed_modes, head) { mutex_lock(&dev->mode_config.mutex); -- 1.5.4.5