From patchwork Thu Oct 22 05:25:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, Yakui" X-Patchwork-Id: 55257 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9M5Rcg0001168 for ; Thu, 22 Oct 2009 05:27:38 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 012539F379; Wed, 21 Oct 2009 22:27:38 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 9356F9E7A7 for ; Wed, 21 Oct 2009 22:27:35 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 21 Oct 2009 22:27:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,602,1249282800"; d="scan'208";a="202052506" Received: from yakui_zhao.sh.intel.com (HELO localhost.localdomain) ([10.239.13.184]) by azsmga001.ch.intel.com with ESMTP; 21 Oct 2009 22:26:52 -0700 From: yakui.zhao@intel.com To: eric@anholt.net Date: Thu, 22 Oct 2009 13:25:33 +0800 Message-Id: <1256189133-1810-1-git-send-email-yakui.zhao@intel.com> X-Mailer: git-send-email 1.5.4.5 Cc: intel-gfx@lists.freedesktop.org, stable@kernel.org Subject: [Intel-gfx] [PATCH] drm/i915: Delete the strict EDID check for SDVO DVI-D monitor X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 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 diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 55b8beb..fe22112 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -1602,8 +1602,10 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) kfree(edid); intel_output->base.display_info.raw_edid = NULL; - } else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) - status = connector_status_disconnected; + } else { + status = connector_status_connected; + DRM_DEBUG_KMS("No EDID is obtained. But still connected.\n"); + } return status; } @@ -1634,7 +1636,55 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect return connector_status_unknown; sdvo_priv->attached_output = response; } - return intel_sdvo_hdmi_sink_detect(connector, response); + /* + * When the response doesn't belong to TMDS,it is unnecessary to check + * the EDID. In such case it will be detected as connected. + */ + if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) + return intel_sdvo_hdmi_sink_detect(connector, response); + else + return connector_status_connected; +} + +/* the default mode list for the DVI-D device when + * there is no EDID + */ +static struct drm_display_mode sdvo_default_modes[] = { + /* 640x480@60Hz */ + { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656, + 752, 800, 0, 480, 489, 492, 525, 0, + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, + /* 800x600@60Hz */ + { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 40000, 800, 840, + 968, 1056, 0, 600, 601, 605, 628, 0, + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, + /* 1024x768@60Hz */ + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048, + 1184, 1344, 0, 768, 771, 777, 806, 0, + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, + /* 1280x960@60Hz */ + { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 108000, 1280, 1376, + 1488, 1800, 0, 960, 961, 964, 1000, 0, + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, + /* 1680x1050@60Hz */ + { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 146250, 1680, 1784, + 1960, 2240, 0, 1050, 1053, 1059, 1089, 0, + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) }, +}; + +static void intel_sdvo_add_default_modes(struct drm_connector *connector) +{ + struct drm_device *dev = connector->dev; + struct drm_display_mode *mode, *ptr; + int i; + + for (i = 0; i < sizeof(sdvo_default_modes) / + sizeof(struct drm_display_mode); i++) { + mode = &sdvo_default_modes[i]; + ptr = drm_mode_duplicate(dev, mode); + if (ptr) + drm_mode_probed_add(connector, ptr); + } } static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) @@ -1662,10 +1712,17 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) digital_ddc_bus = intel_output->ddc_bus; intel_output->ddc_bus = sdvo_priv->analog_ddc_bus; - (void) intel_ddc_get_modes(intel_output); + num_modes = intel_ddc_get_modes(intel_output); intel_output->ddc_bus = digital_ddc_bus; } + /* + * If we can't get the EDID for DVI-D monitor, we will add some default + * modes for it. + * For example: 1680x1050@60, 1280x960@60Hz, 1024x768@60, 800x600@60Hz. + */ + if (num_modes == 0) + intel_sdvo_add_default_modes(connector); } /*