From 9fc4ea5c00dfb91ebff893fb5092e768155cc2e2 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 23 May 2008 18:42:47 -0700 Subject: i915: do a better job of parsing VBIOS data Add code to get panel modes from the VBIOS if present and check whether certain outputs exist. Should make our display detection code a little more robust. --- linux-core/intel_lvds.c | 48 +++++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) (limited to 'linux-core/intel_lvds.c') diff --git a/linux-core/intel_lvds.c b/linux-core/intel_lvds.c index 1da95e18..6b6d3162 100644 --- a/linux-core/intel_lvds.c +++ b/linux-core/intel_lvds.c @@ -380,6 +380,17 @@ void intel_lvds_init(struct drm_device *dev) output->interlace_allowed = FALSE; output->doublescan_allowed = FALSE; + + /* + * LVDS discovery: + * 1) check for EDID on DDC + * 2) check for VBT data + * 3) check to see if LVDS is already on + * if none of the above, no panel + * 4) make sure lid is open + * if closed, act like it's not there for now + */ + /* Set up the DDC bus. */ intel_output->ddc_bus = intel_i2c_create(dev, GPIOC, "LVDSDDC_C"); if (!intel_output->ddc_bus) { @@ -402,6 +413,11 @@ void intel_lvds_init(struct drm_device *dev) } } + /* Failed to get EDID, what about VBT? */ + if (dev_priv->vbt_mode) + dev_priv->panel_fixed_mode = + drm_mode_duplicate(dev, dev_priv->vbt_mode); + /* * If we didn't get EDID, try checking if the panel is already turned * on. If so, assume that whatever is currently programmed is the @@ -424,38 +440,8 @@ void intel_lvds_init(struct drm_device *dev) if (!dev_priv->panel_fixed_mode) goto failed; - /* FIXME: probe the BIOS for modes and check for LVDS quirks */ #if 0 - /* Get the LVDS fixed mode out of the BIOS. We should support LVDS - * with the BIOS being unavailable or broken, but lack the - * configuration options for now. - */ - bios_mode = intel_bios_get_panel_mode(pScrn); - if (bios_mode != NULL) { - if (dev_priv->panel_fixed_mode != NULL) { - if (dev_priv->debug_modes && - !xf86ModesEqual(dev_priv->panel_fixed_mode, - bios_mode)) - { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "BIOS panel mode data doesn't match probed data, " - "continuing with probed.\n"); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BIOS mode:\n"); - xf86PrintModeline(pScrn->scrnIndex, bios_mode); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "probed mode:\n"); - xf86PrintModeline(pScrn->scrnIndex, dev_priv->panel_fixed_mode); - xfree(bios_mode->name); - xfree(bios_mode); - } - } else { - dev_priv->panel_fixed_mode = bios_mode; - } - } else { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Couldn't detect panel mode. Disabling panel\n"); - goto disable_exit; - } - + /* FIXME: detect aopen & mac mini type stuff automatically? */ /* * Blacklist machines with BIOSes that list an LVDS panel without * actually having one. -- cgit v1.2.3