drm/i915: make quirks more verbose
[deliverable/linux.git] / drivers / gpu / drm / i915 / intel_crt.c
index fee0ad02c6d0f6563bc41a9fd91f6ebfdf076a18..70b0f1abf1493154fd821f3f5109cbda6cb10c94 100644 (file)
@@ -24,6 +24,7 @@
  *     Eric Anholt <eric@anholt.net>
  */
 
+#include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include "drmP.h"
@@ -277,9 +278,10 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
        if (intel_ddc_probe(&crt->base, dev_priv->crt_ddc_pin)) {
                struct edid *edid;
                bool is_digital = false;
+               struct i2c_adapter *i2c;
 
-               edid = drm_get_edid(connector,
-                       &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);
+               i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin);
+               edid = drm_get_edid(connector, i2c);
                /*
                 * This may be a DVI-I connector with a shared DDC
                 * link between analog and digital outputs, so we
@@ -482,15 +484,16 @@ static int intel_crt_get_modes(struct drm_connector *connector)
        struct drm_device *dev = connector->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        int ret;
+       struct i2c_adapter *i2c;
 
-       ret = intel_ddc_get_modes(connector,
-                                &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);
+       i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin);
+       ret = intel_ddc_get_modes(connector, i2c);
        if (ret || !IS_G4X(dev))
                return ret;
 
        /* Try to probe digital port for output in DVI-I -> VGA mode. */
-       return intel_ddc_get_modes(connector,
-                                  &dev_priv->gmbus[GMBUS_PORT_DPB].adapter);
+       i2c = intel_gmbus_get_adapter(dev_priv, GMBUS_PORT_DPB);
+       return intel_ddc_get_modes(connector, i2c);
 }
 
 static int intel_crt_set_property(struct drm_connector *connector,
@@ -540,6 +543,24 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = {
        .destroy = intel_encoder_destroy,
 };
 
+static int __init intel_no_crt_dmi_callback(const struct dmi_system_id *id)
+{
+       DRM_INFO("Skipping CRT initialization for %s\n", id->ident);
+       return 1;
+}
+
+static const struct dmi_system_id intel_no_crt[] = {
+       {
+               .callback = intel_no_crt_dmi_callback,
+               .ident = "ACER ZGB",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ZGB"),
+               },
+       },
+       { }
+};
+
 void intel_crt_init(struct drm_device *dev)
 {
        struct drm_connector *connector;
@@ -547,6 +568,10 @@ void intel_crt_init(struct drm_device *dev)
        struct intel_connector *intel_connector;
        struct drm_i915_private *dev_priv = dev->dev_private;
 
+       /* Skip machines without VGA that falsely report hotplug events */
+       if (dmi_check_system(intel_no_crt))
+               return;
+
        crt = kzalloc(sizeof(struct intel_crt), GFP_KERNEL);
        if (!crt)
                return;
@@ -571,7 +596,10 @@ void intel_crt_init(struct drm_device *dev)
                                1 << INTEL_ANALOG_CLONE_BIT |
                                1 << INTEL_SDVO_LVDS_CLONE_BIT);
        crt->base.crtc_mask = (1 << 0) | (1 << 1);
-       connector->interlace_allowed = 1;
+       if (IS_GEN2(dev))
+               connector->interlace_allowed = 0;
+       else
+               connector->interlace_allowed = 1;
        connector->doublescan_allowed = 0;
 
        drm_encoder_helper_add(&crt->base.base, &intel_crt_helper_funcs);
This page took 0.028683 seconds and 5 git commands to generate.