From patchwork Thu Jul 23 17:00:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 36953 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 n6N91ksJ009970 for ; Thu, 23 Jul 2009 09:01:46 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA1A59F6BE; Thu, 23 Jul 2009 02:01:45 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fmsmga101.fm.intel.com (mga05.intel.com [192.55.52.89]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D99F9F6A9 for ; Thu, 23 Jul 2009 02:01:36 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 23 Jul 2009 02:00:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,253,1246863600"; d="scan'208";a="477305478" Received: from debian-ilk.sh.intel.com (HELO localhost.localdomain) ([10.239.36.10]) by fmsmga002.fm.intel.com with ESMTP; 23 Jul 2009 01:54:48 -0700 From: Zhenyu Wang To: intel-gfx@lists.freedesktop.org Date: Fri, 24 Jul 2009 01:00:33 +0800 Message-Id: <1248368433-3734-7-git-send-email-zhenyuw@linux.intel.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1248368433-3734-6-git-send-email-zhenyuw@linux.intel.com> References: <1248368433-3734-1-git-send-email-zhenyuw@linux.intel.com> <1248368433-3734-2-git-send-email-zhenyuw@linux.intel.com> <1248368433-3734-3-git-send-email-zhenyuw@linux.intel.com> <1248368433-3734-4-git-send-email-zhenyuw@linux.intel.com> <1248368433-3734-5-git-send-email-zhenyuw@linux.intel.com> <1248368433-3734-6-git-send-email-zhenyuw@linux.intel.com> Subject: [Intel-gfx] [PATCH 6/6] drm/i915: fix VGA detect on IGDNG 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 Check FORCE_DETECT bit to be clear for the finish of hotplug detect process. Also check possible mono monitor which should also be marked as connected. Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/intel_crt.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index d6a1a6e..4cf8e2e 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c @@ -156,6 +156,9 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector) temp = adpa = I915_READ(PCH_ADPA); + adpa &= ~ADPA_DAC_ENABLE; + I915_WRITE(PCH_ADPA, adpa); + adpa &= ~ADPA_CRT_HOTPLUG_MASK; adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 | @@ -169,13 +172,14 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector) DRM_DEBUG("pch crt adpa 0x%x", adpa); I915_WRITE(PCH_ADPA, adpa); - /* This might not be needed as not specified in spec...*/ - udelay(1000); + while ((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0) + ; /* Check the status to see if both blue and green are on now */ adpa = I915_READ(PCH_ADPA); - if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) == - ADPA_CRT_HOTPLUG_MONITOR_COLOR) + adpa &= ADPA_CRT_HOTPLUG_MONITOR_MASK; + if ((adpa == ADPA_CRT_HOTPLUG_MONITOR_COLOR) || + (adpa == ADPA_CRT_HOTPLUG_MONITOR_MONO)) ret = true; else ret = false;