From e3f4caf40708478ef327b029d0a75944c51ea905 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 15 Sep 2006 13:51:18 -0400 Subject: Add model-specific tweaks for some funky 945GM boards. For the Aopen Mini-PC, ignore the claimed attached 800x600 LVDS panel. Likewise for the Apple Mac Mini, but done slightly differently since it shares PCI IDs with the Macbook Pro. --- src/i830_driver.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/i830_driver.c b/src/i830_driver.c index 8464b39f..75ea480c 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -1231,7 +1231,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) int i, n; char *s; pointer pVBEModule = NULL; - Bool enable, has_lvds; + Bool enable, has_lvds, is_apple_945gm = FALSE; const char *chipname; unsigned int ver; char v[5]; @@ -1672,16 +1672,15 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) if (!i830GetLVDSInfoFromBIOS(pScrn)) has_lvds = FALSE; - /* If the panel sequencing, status, and control registers are all zero, - * assume there's no panel attached. This is the case on the Mac mini, - * which is an i945GM but has no LVDS. If we tried to power something on - * with zeroed panel sequencing registers, it probably wouldn't be a good - * thing anyway. - */ - if (INREG(PP_STATUS) == 0 && INREG(PP_CONTROL) == 0 && - INREG(LVDSPP_ON) == 0 && INREG(LVDSPP_OFF) == 0) - { - has_lvds = FALSE; + /* Blacklist machines with known broken BIOSes */ + if (pI830->PciInfo->chipType == PCI_CHIP_I945_GM) { + if ((pI830->PciInfo->subsysVendor == 0xa0a0) && + (pI830->PciInfo->subsysCard == 0x0589)) /* aopen mini pc */ + has_lvds = FALSE; + + if ((pI830->PciInfo->subsysVendor == 0x8086) && + (pI830->PciInfo->subsysCard == 0x7270)) /* mini, macbook pro... */ + is_apple_945gm = TRUE; } if ((s = xf86GetOptValString(pI830->Options, OPTION_MONITOR_LAYOUT)) && @@ -1772,6 +1771,20 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) pI830->specifiedMonitor = TRUE; } else if (I830IsPrimary(pScrn)) { /* Choose a default set of outputs to use based on what we've detected. */ + + /* + * Apple hardware is out to get us. The macbook pro has a real LVDS + * panel, but the mac mini does not, and they have the same device IDs. + * We'll distinguish by panel size, on the assumption that Apple isn't + * about to make any machines with an 800x600 display. + */ + if (is_apple_945gm && pI830->PanelXRes == 800 && pI830->PanelYRes == 600) + { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Suspected Mac Mini, ignoring the LFP\n"); + has_lvds = FALSE; + } + if (has_lvds) { pI830->MonType2 |= PIPE_LFP; } -- cgit v1.2.3