Subject: [Patch] drm/i915: Use the dmi quirk to initialize some SDVO card as SDVO-VGA From: Zhao Yakui --- drivers/gpu/drm/i915/intel_sdvo.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) Index: linux-2.6/drivers/gpu/drm/i915/intel_sdvo.c =================================================================== --- linux-2.6.orig/drivers/gpu/drm/i915/intel_sdvo.c 2010-02-03 14:23:13.000000000 +0800 +++ linux-2.6/drivers/gpu/drm/i915/intel_sdvo.c 2010-02-03 15:10:59.000000000 +0800 @@ -35,6 +35,7 @@ #include "i915_drm.h" #include "i915_drv.h" #include "intel_sdvo_regs.h" +#include static char *tv_format_names[] = { "NTSC_M" , "NTSC_J" , "NTSC_443", @@ -100,6 +101,8 @@ */ bool is_lvds; + bool is_quirked; + /** * This is sdvo flags for input timing. */ @@ -2283,6 +2286,25 @@ return 0x72; } +static int __init 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_vga[] = { + { + .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) { @@ -2295,6 +2317,22 @@ intel_output->needs_tv_clock = false; sdvo_priv->is_lvds = false; + + if (!sdvo_priv->is_quirked && dmi_check_system(intel_sdvo_vga)) { + sdvo_priv->is_quirked = true; + + if (flags & SDVO_OUTPUT_RGB0) + sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0; + else if (flags & SDVO_OUTPUT_RGB1) + sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1; + + encoder->encoder_type = DRM_MODE_ENCODER_DAC; + connector->connector_type = DRM_MODE_CONNECTOR_VGA; + intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | + (1 << INTEL_ANALOG_CLONE_BIT); + return ret; + } + if (device_is_registered(&connector->kdev)) { drm_sysfs_connector_remove(connector); registered = true;