From patchwork Tue Jul 28 07:11:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 37677 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 n6S7CAVU016470 for ; Tue, 28 Jul 2009 07:12:10 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07FA19F394; Tue, 28 Jul 2009 00:12:10 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from azsmga102.ch.intel.com (mga12.intel.com [143.182.124.36]) by gabe.freedesktop.org (Postfix) with ESMTP id 92F8B9E778 for ; Tue, 28 Jul 2009 00:12:01 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 28 Jul 2009 00:12:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,281,1246863600"; d="asc'?scan'208";a="169605287" Received: from zhen-devel.sh.intel.com (HELO zhen-devel) ([10.239.13.48]) by azsmga001.ch.intel.com with ESMTP; 28 Jul 2009 00:12:00 -0700 Date: Tue, 28 Jul 2009 15:11:59 +0800 From: Zhenyu Wang To: Zhenyu Wang Message-ID: <20090728071159.GA19204@zhen-devel.sh.intel.com> Mail-Followup-To: Zhenyu Wang , intel-gfx@lists.freedesktop.org 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> <1248368433-3734-7-git-send-email-zhenyuw@linux.intel.com> MIME-Version: 1.0 In-Reply-To: <1248368433-3734-7-git-send-email-zhenyuw@linux.intel.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: intel-gfx@lists.freedesktop.org Subject: Re: [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 Reply-To: Zhenyu Wang 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 On 2009.07.24 01:00:33 +0800, Zhenyu Wang wrote: > 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 | This introduces screen flicker which is bad, more testing takes me to below patch. Force detection on IGDNG desktop chip seems doesn't require disable DAC first, but mobile chip has trouble with that, so I just fallback to DDC probe instead. Any comment? From e8c8ea7822a2fe64328192e0ea025a7b88025d61 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Tue, 28 Jul 2009 22:59:11 +0800 Subject: [PATCH] drm/i915: fix VGA detect on IGDNG Testing on IGDNG mobile chip showed that disable DAC is required before VGA force detection, which will cause screen flicker, so just use DDC probe in that case. 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 | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index d6a1a6e..6bc9500 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c @@ -156,6 +156,13 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector) temp = adpa = I915_READ(PCH_ADPA); + if (IS_IGDNG_M(dev)) { + /* mobile chip seems sensible to disable dac first for + force detect, which causes flicker, so just fall to + ddc probe. */ + return intel_ddc_probe(to_intel_output(connector)); + } + adpa &= ~ADPA_CRT_HOTPLUG_MASK; adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 | @@ -169,13 +176,13 @@ 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_NONE) ret = true; else ret = false;