drm/i915: Treat SDVO LVDS as digital when parsing EDID (#729882)

This commit is contained in:
Adam Jackson 2011-10-13 10:49:31 -04:00
parent a2975f8e0c
commit 91087d1d01
2 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,83 @@
From 64015d6d16d7ed5b6ffcec95dc13e8694bd2a4d6 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon, 20 Jun 2011 22:35:24 +0100
Subject: [PATCH] drm/i915/sdvo: Include LVDS panels for the IS_DIGITAL check
We were checking whether the supplied edid matched the connector it was
read from. We do this in case a DDC read returns an EDID for another
device on a multifunction or otherwise interesting card. However, we
failed to include LVDS as a digital device and so rejecting an otherwise
valid EDID.
Fixes the detection of the secondary SDVO LVDS panel on the Libretto
W105.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/intel_sdvo.c | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index f96975c..26eff9f 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -49,6 +49,7 @@
#define IS_TMDS(c) (c->output_flag & SDVO_TMDS_MASK)
#define IS_LVDS(c) (c->output_flag & SDVO_LVDS_MASK)
#define IS_TV_OR_LVDS(c) (c->output_flag & (SDVO_TV_MASK | SDVO_LVDS_MASK))
+#define IS_DIGITAL(c) (c->output_flag & (SDVO_TMDS_MASK | SDVO_LVDS_MASK))
static const char *tv_format_names[] = {
@@ -1363,6 +1364,18 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector)
return status;
}
+static bool
+intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *sdvo,
+ struct edid *edid)
+{
+ bool monitor_is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL);
+ bool connector_is_digital = !!IS_DIGITAL(sdvo);
+
+ DRM_DEBUG_KMS("connector_is_digital? %d, monitor_is_digital? %d\n",
+ connector_is_digital, monitor_is_digital);
+ return connector_is_digital == monitor_is_digital;
+}
+
static enum drm_connector_status
intel_sdvo_detect(struct drm_connector *connector, bool force)
{
@@ -1407,10 +1420,12 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
if (edid == NULL)
edid = intel_sdvo_get_analog_edid(connector);
if (edid != NULL) {
- if (edid->input & DRM_EDID_INPUT_DIGITAL)
- ret = connector_status_disconnected;
- else
+ if (intel_sdvo_connector_matches_edid(intel_sdvo_connector,
+ edid))
ret = connector_status_connected;
+ else
+ ret = connector_status_disconnected;
+
connector->display_info.raw_edid = NULL;
kfree(edid);
} else
@@ -1451,11 +1466,8 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)
edid = intel_sdvo_get_analog_edid(connector);
if (edid != NULL) {
- struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
- bool monitor_is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL);
- bool connector_is_digital = !!IS_TMDS(intel_sdvo_connector);
-
- if (connector_is_digital == monitor_is_digital) {
+ if (intel_sdvo_connector_matches_edid(to_intel_sdvo_connector(connector),
+ edid)) {
drm_mode_connector_update_edid_property(connector, edid);
drm_add_edid_modes(connector, edid);
}
--
1.7.5.4

View File

@ -686,6 +686,8 @@ Patch1824: drm-intel-next.patch
Patch1825: drm-intel-make-lvds-work.patch
# hush the i915 fbc noise
Patch1826: drm-i915-fbc-stfu.patch
# rhbz#729882, https://bugs.freedesktop.org/attachment.cgi?id=49069
Patch1827: drm-i915-sdvo-lvds-is-digital.patch
Patch1900: linux-2.6-intel-iommu-igfx.patch
@ -1315,6 +1317,7 @@ ApplyOptionalPatch drm-nouveau-updates.patch
ApplyOptionalPatch drm-intel-next.patch
ApplyPatch drm-intel-make-lvds-work.patch
ApplyPatch drm-i915-fbc-stfu.patch
ApplyPatch drm-i915-sdvo-lvds-is-digital.patch
ApplyPatch linux-2.6-intel-iommu-igfx.patch
# silence the ACPI blacklist code
@ -2064,6 +2067,9 @@ fi
# and build.
%changelog
* Thu Oct 13 2011 Adam Jackson <ajax@redhat.com>
- drm/i915: Treat SDVO LVDS as digital when parsing EDID (#729882)
* Thu Oct 13 2011 Josh Boyer <jwboyer@redhat.com>
- Add patch from Stanislaw Gruszka to fix iwlagn NULL dereference (rhbz 744155)