dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "\"David Müller (ELSOFT AG)\"" <d.mueller@elsoft.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Regression] [PATCH] intel_crt_detect_ddc() seems to be broken for DVI-I
Date: Fri, 07 Jan 2011 09:36:43 +0100	[thread overview]
Message-ID: <4D26D09B.2020509@elsoft.ch> (raw)
In-Reply-To: <0d30dc$km0b3q@orsmga001.jf.intel.com>

[-- 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

  reply	other threads:[~2011-01-07 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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)" [this message]
2011-02-01  8:27     ` [PING] " "David Müller (ELSOFT AG)"

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D26D09B.2020509@elsoft.ch \
    --to=d.mueller@elsoft.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).