[Intel-gfx] [PATCH 1/7] drm/i915: Detect SDVO/HDMI output always based on SDVO_B detection bit

yakui.zhao at intel.com yakui.zhao at intel.com
Mon Aug 24 07:50:23 CEST 2009


From: Ma Ling <ling.ma at intel.com>

After the following commit is shipped, the SDVO C detection will depend on
the SDVO_C/DP detion bit. 
commit 13520b051e8888dd3af9bda639d83e7df76613d1
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Fri Mar 13 15:42:14 2009 -0400

    drm/i915: Read the right SDVO register when detecting SVDO/HDMI.

In fact it is incorrect. According to the spec we should continue to
detect the SDVO_B/C based on the SDVO_B detection bit.
Of course the detection bit is defined in G4X platform. But it is for
the HDMI_C detection rather than SDVO_C detection.

https://bugs.freedesktop.org/show_bug.cgi?id=20639

Signed-off-by: Ma Ling <ling.ma at intel.com>
Acked-by: Zhao Yakui <yakui.zhao at intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: linux-2.6/drivers/gpu/drm/i915/intel_display.c
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_display.c	2009-08-21 16:30:34.000000000 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_display.c	2009-08-21 16:31:41.000000000 +0800
@@ -3218,30 +3218,30 @@
 			intel_dp_init(dev, PCH_DP_D);
 
 	} else if (IS_I9XX(dev)) {
-		int found;
-		u32 reg;
+		bool found = false;
 
 		if (I915_READ(SDVOB) & SDVO_DETECTED) {
 			found = intel_sdvo_init(dev, SDVOB);
 			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
 				intel_hdmi_init(dev, SDVOB);
+
 			if (!found && SUPPORTS_INTEGRATED_DP(dev))
 				intel_dp_init(dev, DP_B);
 		}
 
 		/* Before G4X SDVOC doesn't have its own detect register */
-		if (IS_G4X(dev))
-			reg = SDVOC;
-		else
-			reg = SDVOB;
 
-		if (I915_READ(reg) & SDVO_DETECTED) {
+		if (I915_READ(SDVOB) & SDVO_DETECTED)
 			found = intel_sdvo_init(dev, SDVOC);
-			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
+
+		if (!found && (I915_READ(SDVOC) & SDVO_DETECTED)) {
+
+			if (SUPPORTS_INTEGRATED_HDMI(dev))
 				intel_hdmi_init(dev, SDVOC);
-			if (!found && SUPPORTS_INTEGRATED_DP(dev))
+			if (SUPPORTS_INTEGRATED_DP(dev))
 				intel_dp_init(dev, DP_C);
 		}
+
 		if (SUPPORTS_INTEGRATED_DP(dev) && (I915_READ(DP_D) & DP_DETECTED))
 			intel_dp_init(dev, DP_D);
 	} else



More information about the Intel-gfx mailing list