Subject: [Patch] drm/i915: Add the quirk to detect whether the DVI-D monitor is attached From: Zhao Yakui Add the DMI quirk to detect whether the DVI-D monitor is attached or not. Signed-off-by: Zhao Yakui --- Subject: [Patch] drm/i915: Add the quirk to detect whether the DVI-D monitor is attached From: Zhao Yakui Add the DMI quirk to detect whether the DVI-D monitor is attached or not. Signed-off-by: Zhao Yakui --- drivers/gpu/drm/i915/intel_sdvo.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) Index: linux-2.6.32-rc4/drivers/gpu/drm/i915/intel_sdvo.c =================================================================== --- linux-2.6.32-rc4.orig/drivers/gpu/drm/i915/intel_sdvo.c 2009-10-16 10:56:40.000000000 +0800 +++ linux-2.6.32-rc4/drivers/gpu/drm/i915/intel_sdvo.c 2009-10-16 11:01:40.000000000 +0800 @@ -27,6 +27,7 @@ */ #include #include +#include #include "drmP.h" #include "drm.h" #include "drm_crtc.h" @@ -159,6 +160,9 @@ u32 cur_contrast, max_contrast; u32 cur_saturation, max_saturation; u32 cur_hue, max_hue; + /* Indicates whether the EDID is used to check the external monitor + * is connected or not */ + u32 sdvo_edid_detection; }; static bool @@ -1644,6 +1648,11 @@ return connector_status_unknown; sdvo_priv->attached_output = response; } + if (sdvo_priv->sdvo_edid_detection && + (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))) { + /* skips the checking of EDID for the DVI-D connectors */ + return connector_status_connected; + } return intel_sdvo_hdmi_sink_detect(connector, response); } @@ -2666,6 +2675,24 @@ return; } +static int __init intel_sdvo_dmi_callback(const struct dmi_system_id *id) +{ + DRM_DEBUG_KMS("Skipping the checking of EDID for %s\n", id->ident); + return 1; +} + +/* Don't use the EDID to check whether the external monitor is attached */ +static const struct dmi_system_id intel_sdvo_edid[] = { + { + .callback = intel_sdvo_dmi_callback, + .ident = "ThinkCentre M55p", + .matches = { + DMI_MATCH(DMI_BIOS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "8808VNA"), + }, + }, +}; + bool intel_sdvo_init(struct drm_device *dev, int output_device) { struct drm_connector *connector; @@ -2735,8 +2762,6 @@ output_device == SDVOB ? 'B' : 'C'); goto err_i2c; } - - connector = &intel_output->base; drm_connector_init(dev, connector, &intel_sdvo_connector_funcs, connector->connector_type); @@ -2768,7 +2793,13 @@ intel_sdvo_get_input_pixel_clock_range(intel_output, &sdvo_priv->pixel_clock_min, &sdvo_priv->pixel_clock_max); - + if (dmi_check_system(intel_sdvo_edid)) { + /* When the box falls into the DMI check table, the EDID is + * not used to check whether the external monitor is detected + * or not. + */ + sdvo_priv->sdvo_edid_detection = 1; + } DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, " "clock range %dMHz - %dMHz, "