From patchwork Thu Mar 4 08:17:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 83556 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o248KtB3002789 for ; Thu, 4 Mar 2010 08:21:30 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09BDE9ED67; Thu, 4 Mar 2010 00:20:55 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fmsmga102.fm.intel.com (mga10.intel.com [192.55.52.92]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B11C9E79E for ; Thu, 4 Mar 2010 00:20:53 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 04 Mar 2010 00:18:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.49,580,1262592000"; d="scan'208";a="545962898" Received: from ubuntu-hp.sh.intel.com (HELO localhost.localdomain) ([10.239.36.152]) by fmsmga002.fm.intel.com with ESMTP; 04 Mar 2010 00:19:56 -0800 From: Zhenyu Wang To: eric@anholt.net Date: Thu, 4 Mar 2010 16:17:31 +0800 Message-Id: <1267690651-9015-3-git-send-email-zhenyuw@linux.intel.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1267690651-9015-2-git-send-email-zhenyuw@linux.intel.com> References: <1267690651-9015-1-git-send-email-zhenyuw@linux.intel.com> <1267690651-9015-2-git-send-email-zhenyuw@linux.intel.com> Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Ignore LVDS EDID when it is unavailabe or invalid X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Mar 2010 08:21:30 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index f975926..d8dd7b2 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -610,6 +610,8 @@ typedef struct drm_i915_private { /* Reclocking support */ bool render_reclock_avail; bool lvds_downclock_avail; + /* indicate whether the LVDS EDID is OK */ + bool lvds_edid_ok; /* indicates the reduced downclock for LVDS*/ int lvds_downclock; struct work_struct idle_work; diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index caf0306..87c75bc 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -702,10 +702,14 @@ 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_connector); + if (dev_priv->lvds_edid_ok) { + ret = intel_ddc_get_modes(intel_connector); - if (ret) - return ret; + if (ret) + return ret; + + dev_priv->lvds_edid_ok = false; + } /* Didn't get an EDID, so * Set wide sync ranges so we get all modes @@ -1124,7 +1128,9 @@ 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. */ - intel_ddc_get_modes(intel_connector); + dev_priv->lvds_edid_ok = true; + if (!intel_ddc_get_modes(intel_connector)) + dev_priv->lvds_edid_ok = false; list_for_each_entry(scan, &connector->probed_modes, head) { mutex_lock(&dev->mode_config.mutex);