[Intel-gfx] [PATCH 6/6] drm/i915: fix VGA detect on IGDNG

Zhenyu Wang zhenyuw at linux.intel.com
Tue Jul 28 09:11:59 CEST 2009


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 <zhenyuw at linux.intel.com>
> ---
>  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 <zhenyuw at linux.intel.com>
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 <zhenyuw at linux.intel.com>
---
 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;
-- 
1.6.3.3


-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090728/14402291/attachment.sig>


More information about the Intel-gfx mailing list