]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.10/drm-i915-use-a-dmi-quirk-to-skip-a-broken-sdvo-tv-output.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.10 / drm-i915-use-a-dmi-quirk-to-skip-a-broken-sdvo-tv-output.patch
CommitLineData
620f17b9
GKH
1From 6070a4a928f8c92b9fae7d6717ebbb05f425d6b2 Mon Sep 17 00:00:00 2001
2From: Zhao Yakui <yakui.zhao@intel.com>
3Date: Mon, 8 Feb 2010 21:35:12 +0800
4Subject: drm/i915: Use a dmi quirk to skip a broken SDVO TV output.
5
6From: Zhao Yakui <yakui.zhao@intel.com>
7
8commit 6070a4a928f8c92b9fae7d6717ebbb05f425d6b2 upstream.
9
10This IBM system has a multi-function SDVO card that reports both VGA
11and TV, but the system has no TV connector. The TV connector always
12reported as connected, which would lead to poor modesetting choices.
13
14https://bugs.freedesktop.org/show_bug.cgi?id=25787
15
16Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
17Tested-by: Vance <liangghv@sg.ibm.com>
18Signed-off-by: Eric Anholt <eric@anholt.net>
19Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21---
22 drivers/gpu/drm/i915/intel_sdvo.c | 23 ++++++++++++++++++++++-
23 1 file changed, 22 insertions(+), 1 deletion(-)
24
25--- a/drivers/gpu/drm/i915/intel_sdvo.c
26+++ b/drivers/gpu/drm/i915/intel_sdvo.c
27@@ -35,6 +35,7 @@
28 #include "i915_drm.h"
29 #include "i915_drv.h"
30 #include "intel_sdvo_regs.h"
31+#include <linux/dmi.h>
32
33 #undef SDVO_DEBUG
34
35@@ -2289,6 +2290,25 @@ intel_sdvo_get_slave_addr(struct drm_dev
36 return 0x72;
37 }
38
39+static int intel_sdvo_bad_tv_callback(const struct dmi_system_id *id)
40+{
41+ DRM_DEBUG_KMS("Ignoring bad SDVO TV connector for %s\n", id->ident);
42+ return 1;
43+}
44+
45+static struct dmi_system_id intel_sdvo_bad_tv[] = {
46+ {
47+ .callback = intel_sdvo_bad_tv_callback,
48+ .ident = "IntelG45/ICH10R/DME1737",
49+ .matches = {
50+ DMI_MATCH(DMI_SYS_VENDOR, "IBM CORPORATION"),
51+ DMI_MATCH(DMI_PRODUCT_NAME, "4800784"),
52+ },
53+ },
54+
55+ { } /* terminating entry */
56+};
57+
58 static bool
59 intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
60 {
61@@ -2329,7 +2349,8 @@ intel_sdvo_output_setup(struct intel_out
62 (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
63 (1 << INTEL_ANALOG_CLONE_BIT);
64 }
65- } else if (flags & SDVO_OUTPUT_SVID0) {
66+ } else if ((flags & SDVO_OUTPUT_SVID0) &&
67+ !dmi_check_system(intel_sdvo_bad_tv)) {
68
69 sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
70 encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;