[Intel-gfx] [PATCH 1/2] drm/i915: Detect SDVO-RGB before SDVO TV
ykzhao
yakui.zhao at intel.com
Mon Feb 8 14:35:12 CET 2010
On Tue, 2010-02-02 at 10:17 +0800, Fu Michael wrote:
> Zhenyu Wang wrote:
> > On 2010.02.02 08:19:32 +0800, Fu Michael wrote:
> >
> >> This card _only_ have VGA connector from external, no way to switch to its TV
> >> capability. The motherboard design never intend to use the TV capability
> >> at all. Would using multiple connector or rename an output or not isn't
> >> the core of the issue. It is the non-existing TV connector is reported
> >> as connected bothering us...
> >>
> >
> > ok, looks like you need a quirk for that, based on SDVO vendor and device id...
> >
> >
> right. the problem is the same sdvo chip might be used to build a
> perfect SDVO card. It might be the motherboard builder's problem that
> make the sdvo chip think its TV is connected.
>
> However, this remind me that DMI might be a good way to quirk this
> case... we may try that...Thanks for the hint, zhenyu.
>
The following is the patch that uses the DMI quirk to initialize some
multi-functional SDVO card as SDVO-VGA.
>From ac5526efed8954c940a3baed0265cffcbf179556 Mon Sep 17 00:00:00 2001
From: Zhao Yakui <yakui.zhao at intel.com>
Date: Mon, 8 Feb 2010 21:07:29 +0800
Subject: [PATCH] drm/i915: Use the dmi quirk to initialize some SDVO card as SDVO-VGA
Some multi-function SDVO card will report the capability that SDVO-VGA/TV
is supported. Now the connector type of such card is initialized as SDVO-TV.
But when the external connected device is VGA monitor, we can't change the
connector type correctly from SDVO-TV to SDVO-VGA. So on some box such
multi-function SDVO card will be initialized as SDVO-VGA instead of
SDVO-TV.
https://bugs.freedesktop.org/show_bug.cgi?id=25787
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
tested-by: Vance <liangghv at sg.ibm.com>
cc: stable at kernel.org
---
drivers/gpu/drm/i915/intel_sdvo.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 82678d3..fe85dd8 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -35,6 +35,7 @@
#include "i915_drm.h"
#include "i915_drv.h"
#include "intel_sdvo_regs.h"
+#include <linux/dmi.h>
static char *tv_format_names[] = {
"NTSC_M" , "NTSC_J" , "NTSC_443",
@@ -2283,6 +2284,25 @@ intel_sdvo_get_slave_addr(struct drm_device *dev, int output_device)
return 0x72;
}
+static int intel_sdvo_is_vga(const struct dmi_system_id *id)
+{
+ DRM_DEBUG_KMS("SDVO is initialized as SDVO-VGA for %s\n", id->ident);
+ return 1;
+}
+
+static struct dmi_system_id intel_sdvo_bad_tv[] = {
+ {
+ .callback = intel_sdvo_is_vga,
+ .ident = "IntelG45/ICH10R/DME1737",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "IBM CORPORATION"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "4800784"),
+ },
+ },
+
+ { } /* terminating entry */
+};
+
static bool
intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
{
@@ -2323,7 +2343,8 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
(1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
(1 << INTEL_ANALOG_CLONE_BIT);
}
- } else if (flags & SDVO_OUTPUT_SVID0) {
+ } else if ((flags & SDVO_OUTPUT_SVID0) &&
+ !dmi_check_system(intel_sdvo_bad_tv)) {
sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
--
1.5.4.5
More information about the Intel-gfx
mailing list