Re: [PATCH] i915: Skip wrong TV outputs on HP laptop

Previous thread: warning at serial_write_room and serial_write by David Newall on Tuesday, April 20, 2010 - 5:46 am. (2 messages)

Next thread: Quote Price by Kelly Joe on Tuesday, April 20, 2010 - 5:16 am. (1 message)
From: Takashi Iwai
Date: Tuesday, April 20, 2010 - 5:50 am

A new HP laptop with GM45 seems detecting wrongly TV outputs
occasionally.  Most of time it detects the TV output as disconnected,
but spontaneously it detects NTSC 480i although the laptop has no TV
output at all.

A simple (but ad hoc) fix is to add a DMI check as below.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/i915/intel_tv.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 552ec11..e848a28 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -37,6 +37,7 @@
 #include "intel_drv.h"
 #include "i915_drm.h"
 #include "i915_drv.h"
+#include <linux/dmi.h>
 
 enum tv_margin {
 	TV_MARGIN_LEFT, TV_MARGIN_TOP,
@@ -1735,6 +1736,18 @@ static int tv_is_present_in_vbt(struct drm_device *dev)
 	return ret;
 }
 
+static struct dmi_system_id intel_bad_tv[] = {
+	{
+		.ident = "HP Compaq 420",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP 420"),
+		},
+	},
+
+	{ }	/* terminating entry */
+};
+
 void
 intel_tv_init(struct drm_device *dev)
 {
@@ -1757,6 +1770,10 @@ intel_tv_init(struct drm_device *dev)
 	if (!dev_priv->int_tv_support)
 		return;
 
+	/* wrongly detected TV outputs */
+	if (dmi_check_system(intel_bad_tv))
+		return;
+
 	/*
 	 * Sanity check the TV output by checking to see if the
 	 * DAC register holds a value
-- 
1.7.0.4

--

From: Eric Anholt
Date: Tuesday, April 20, 2010 - 10:13 am

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvN4LAACgkQHUdvYGzw6ve+1gCfVN48zOm20AZfEPlj/osX/LDZ
ncIAoIPhKEM2ayDsPzkS1hGYf6NNf+aP
=vbLN
-----END PGP SIGNATURE-----
From: Takashi Iwai
Date: Tuesday, April 20, 2010 - 10:58 am

At Tue, 20 Apr 2010 10:13:20 -0700,

No, it has neither TV connector nor docking-station.

If any patch that can fix the wrong detection is available, I'll
happily test it.


thanks,

Takashi
--

From: ykzhao
Date: Tuesday, April 20, 2010 - 5:46 pm

Oh. This laptop is also based on gm45. Maybe it has the similar issue
wit the laptop on https://bugzilla.kernel.org/show_bug.cgi?id=14792.

Will you please try the patch in
hhttps://bugzilla.kernel.org/show_bug.cgi?id=14792#C24 and see whether
the issue can be fixed?
 
Thanks.

--

From: Takashi Iwai
Date: Tuesday, April 20, 2010 - 10:47 pm

At Wed, 21 Apr 2010 08:46:16 +0800,


OK, I'll give it a try later.

Thanks!


Takashi
--

From: Takashi Iwai
Date: Wednesday, April 21, 2010 - 7:03 am

At Wed, 21 Apr 2010 08:46:16 +0800,

Looks positive.  Rebooted many times, and no longer wrong detection.
It'd be nice if this is merged to upstream, and also for stable kernel.

Tested-by: Takashi Iwai <tiwai@suse.de>


Thanks!

Takashi
--

From: Zhenyu Wang
Date: Wednesday, April 21, 2010 - 1:01 am

Maybe old TV quirks in UMS driver will also be helpful in case that
current BIOS check still fail. 

This is from old UMS driver, but use pci subsys ids instead of dmi info
at that time.

From 60bc20124faee4db406b856e139959f8c082830d Mon Sep 17 00:00:00 2001
From: Zhenyu Wang <zhenyuw@linux.intel.com>
Date: Wed, 21 Apr 2010 15:53:51 +0800
Subject: [PATCH] drm/i915: TV quirks for laptop with no TV connector

This picks up TV connector quirks in original UMS driver,
to disable TV encoder on laptop with no physical TV port.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_tv.c |   69 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 081cb90..a96a14f 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1612,6 +1612,71 @@ static int tv_is_present_in_vbt(struct drm_device *dev)
 	return ret;
 }
 
+struct intel_tv_quirk {
+	int pci_device;
+	int subsys_vendor;
+	int subsys_device;
+};
+
+struct intel_tv_quirk intel_tv_quirk_list[] = {
+	/* Clevo M720R has no tv output */
+	{ 0x2a02, 0x1558, 0x0721 },
+	/* Dell Latitude X1 */
+	{ 0x2592, 0x1028, 0x01a3 },
+	/* Dell Latitude X1 / D630 (LP: #197740) */
+	{ 0x2592, 0x1028, 0x01f9 },
+	/* Dell XPS 1330 */
+	{ 0x2a02, 0x1028, 0x0209 },
+	/* Dell Inspiron 1535 */
+	{ 0x2a02, 0x1028, 0x0254 },
+	/* Dell Inspiron 1735 */
+	{ 0x2a02, 0x1028, 0x0256 },
+	/* Dell Inspiron 1318 */
+	{ 0x2a02, 0x1028, 0x0286 },
+	/* Dell Vostro A840 (LP: #235155) */
+	{ 0x2a02, 0x1028, 0x0298 },
+	/* Lenovo 3000 v200 */
+	{ 0x2a02, 0x17aa, 0x3c18 },
+	/* Panasonic Toughbook CF-Y4 has no TV output */
+	{ 0x2592, 0x10f7, 0x8338 },
+	/* Panasonic Toughbook CF-Y7 has no TV output */
+	{ 0x2a02, 0x10f7, 0x8338 },
+	/* Toshiba Satellite U300 has no TV output */
+	{ 0x2a02, 0x1179, 0xff50 },
+	/* Samsung Q35 has no TV output */
+	{ 0x27a2, 0x144d, ...
Previous thread: warning at serial_write_room and serial_write by David Newall on Tuesday, April 20, 2010 - 5:46 am. (2 messages)

Next thread: Quote Price by Kelly Joe on Tuesday, April 20, 2010 - 5:16 am. (1 message)