dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Regression] [PATCH] intel_crt_detect_ddc() seems to be broken for DVI-I
@ 2011-01-06 11:11 "David Müller (ELSOFT AG)"
  2011-01-06 12:34 ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: "David Müller (ELSOFT AG)" @ 2011-01-06 11:11 UTC (permalink / raw)
  To: dri-devel

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

Hello

Since Linux 2.6.36 the digital output on my system (855GME + DVI-I) is
not working any longer. The analog output is always activated regardless
of the type of monitor attached.

The culprit seems to be intel_crt_detect_ddc(), which returns true as
soon as an ACK from the EDID device is received. Obviously this approach
does not work with DVI-I where the analog and digital outputs share a
common DDC bus.

The patch below adds an additional check to make sure that there is
really an analog device attached (similar to the "Mac mini hack" in
intel_sdvo.c)

[-- Attachment #2: intel_crt.c.patch --]
[-- Type: text/plain, Size: 2243 bytes --]

Signed-off-by: David Müller <d.mueller@elsoft.ch>

diff -dpurN a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
--- a/drivers/gpu/drm/i915/intel_crt.c	2011-01-05 10:35:18.449000023 +0100
+++ b/drivers/gpu/drm/i915/intel_crt.c	2011-01-06 12:16:47.630998952 +0100
@@ -30,6 +30,7 @@
 #include "drm.h"
 #include "drm_crtc.h"
 #include "drm_crtc_helper.h"
+#include "drm_edid.h"
 #include "intel_drv.h"
 #include "i915_drm.h"
 #include "i915_drv.h"
@@ -287,8 +288,9 @@ static bool intel_crt_ddc_probe(struct d
 	return i2c_transfer(&dev_priv->gmbus[ddc_bus].adapter, msgs, 1) == 1;
 }
 
-static bool intel_crt_detect_ddc(struct intel_crt *crt)
+static bool intel_crt_detect_ddc(struct drm_connector *connector)
 {
+	struct intel_crt *crt = intel_attached_crt(connector);
 	struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private;
 
 	/* CRT should always be at 0, but check anyway */
@@ -301,8 +303,26 @@ static bool intel_crt_detect_ddc(struct
 	}
 
 	if (intel_ddc_probe(&crt->base, dev_priv->crt_ddc_pin)) {
-		DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
-		return true;
+		struct edid *edid;
+		bool is_digital = false;
+
+		edid = drm_get_edid(connector,
+			&dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);
+		/*
+		 * This may be a DVI-I connector with a shared DDC
+		 * link between analog and digital outputs, so we
+		 * have to check the EDID input spec of the attached device.
+		 */
+		if (edid != NULL) {
+			is_digital = edid->input & DRM_EDID_INPUT_DIGITAL;
+			connector->display_info.raw_edid = NULL;
+			kfree(edid);
+		}
+
+		if (!is_digital) {
+			DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
+			return true;
+		}
 	}
 
 	return false;
@@ -458,7 +478,7 @@ intel_crt_detect(struct drm_connector *c
 		}
 	}
 
-	if (intel_crt_detect_ddc(crt))
+	if (intel_crt_detect_ddc(connector))
 		return connector_status_connected;
 
 	if (!force)
@@ -472,7 +492,7 @@ intel_crt_detect(struct drm_connector *c
 		crtc = intel_get_load_detect_pipe(&crt->base, connector,
 						  NULL, &dpms_mode);
 		if (crtc) {
-			if (intel_crt_detect_ddc(crt))
+			if (intel_crt_detect_ddc(connector))
 				status = connector_status_connected;
 			else
 				status = intel_crt_load_detect(crtc, crt);

[-- Attachment #3: Type: text/plain, Size: 371 bytes --]

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

[-- Attachment #5: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Regression] [PATCH] intel_crt_detect_ddc() seems to be broken for DVI-I
  2011-01-06 11:11 [Regression] [PATCH] intel_crt_detect_ddc() seems to be broken for DVI-I "David Müller (ELSOFT AG)"
@ 2011-01-06 12:34 ` Chris Wilson
  2011-01-07  8:36   ` "David Müller (ELSOFT AG)"
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2011-01-06 12:34 UTC (permalink / raw)
  To: dri-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

On Thu, 06 Jan 2011 12:11:38 +0100, "David Müller (ELSOFT AG)" <d.mueller@elsoft.ch> wrote:
> The patch below adds an additional check to make sure that there is
> really an analog device attached (similar to the "Mac mini hack" in
> intel_sdvo.c)

Nice patch, thanks. I've applied this to my -fixes queue.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


[-- Attachment #2: Type: text/plain, Size: 371 bytes --]

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

[-- Attachment #4: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Regression] [PATCH] intel_crt_detect_ddc() seems to be broken for DVI-I
  2011-01-06 12:34 ` Chris Wilson
@ 2011-01-07  8:36   ` "David Müller (ELSOFT AG)"
  2011-02-01  8:27     ` [PING] " "David Müller (ELSOFT AG)"
  0 siblings, 1 reply; 4+ messages in thread
From: "David Müller (ELSOFT AG)" @ 2011-01-07  8:36 UTC (permalink / raw)
  To: Chris Wilson; +Cc: dri-devel

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

Attached the corresponding patch for kernel 2.6.36.

Chris Wilson wrote:
> Nice patch, thanks. I've applied this to my -fixes queue.

So this means that this fix will be part of a future stable 2.6.37.x
kernel or will it be only part of the upcoming 2.6.38?
If it is the latter, shall i send the patches to stable@kernel.org
myself? Do i need an ACK from you or any other DRI maintainer to do so?

[-- Attachment #2: intel_crt.c.patch --]
[-- Type: text/plain, Size: 1959 bytes --]

Signed-off-by: David Müller <d.mueller@elsoft.ch>

diff -dpurN a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
--- a/drivers/gpu/drm/i915/intel_crt.c	2010-12-08 15:09:28.777000052 +0100
+++ b/drivers/gpu/drm/i915/intel_crt.c	2011-01-06 17:59:08.071998088 +0100
@@ -30,6 +30,7 @@
 #include "drm.h"
 #include "drm_crtc.h"
 #include "drm_crtc_helper.h"
+#include "drm_edid.h"
 #include "intel_drv.h"
 #include "i915_drm.h"
 #include "i915_drv.h"
@@ -261,15 +262,40 @@ static bool intel_crt_detect_hotplug(str
 	return ret;
 }
 
-static bool intel_crt_detect_ddc(struct drm_encoder *encoder)
+static bool intel_crt_detect_ddc(struct drm_connector *connector)
 {
+	struct drm_encoder *encoder = intel_attached_encoder(connector);
 	struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
 
 	/* CRT should always be at 0, but check anyway */
 	if (intel_encoder->type != INTEL_OUTPUT_ANALOG)
 		return false;
 
-	return intel_ddc_probe(intel_encoder);
+	if (intel_ddc_probe(intel_encoder)) {
+		struct edid *edid;
+		bool is_digital = false;
+
+		intel_i2c_quirk_set(connector->dev, true);
+		edid = drm_get_edid(connector, intel_encoder->ddc_bus);
+		intel_i2c_quirk_set(connector->dev, false);
+		/*
+		 * This may be a DVI-I connector with a shared DDC
+		 * link between analog and digital outputs, so we
+		 * have to check the EDID input spec of the attached device.
+		 */
+		if (edid != NULL) {
+			is_digital = edid->input & DRM_EDID_INPUT_DIGITAL;
+			connector->display_info.raw_edid = NULL;
+			kfree(edid);
+		}
+
+		if (!is_digital) {
+			DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
+			return true;
+		}
+	}
+
+	return false;
 }
 
 static enum drm_connector_status
@@ -417,7 +443,7 @@ intel_crt_detect(struct drm_connector *c
 			return connector_status_disconnected;
 	}
 
-	if (intel_crt_detect_ddc(encoder))
+	if (intel_crt_detect_ddc(connector))
 		return connector_status_connected;
 
 	if (!force)

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PING] Re: [Regression] [PATCH] intel_crt_detect_ddc() seems to be broken for DVI-I
  2011-01-07  8:36   ` "David Müller (ELSOFT AG)"
@ 2011-02-01  8:27     ` "David Müller (ELSOFT AG)"
  0 siblings, 0 replies; 4+ messages in thread
From: "David Müller (ELSOFT AG)" @ 2011-02-01  8:27 UTC (permalink / raw)
  To: Chris Wilson; +Cc: dri-devel

Hello

Any news?

http://lists.freedesktop.org/archives/dri-devel/2011-January/006875.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-01  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06 11:11 [Regression] [PATCH] intel_crt_detect_ddc() seems to be broken for DVI-I "David Müller (ELSOFT AG)"
2011-01-06 12:34 ` Chris Wilson
2011-01-07  8:36   ` "David Müller (ELSOFT AG)"
2011-02-01  8:27     ` [PING] " "David Müller (ELSOFT AG)"

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).