diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2007-09-11 22:51:20 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2007-09-11 22:51:20 -0700 |
commit | b2db7d414400d80a5567d71eed9a7e94f1043a20 (patch) | |
tree | 138964781baff2f647879d530b886bf2916681fa | |
parent | 07fb9f0b00fafe18bd33bddff23cbb4325eb50f8 (diff) |
G80: Fix LVDS detection on some laptops.
-rw-r--r-- | src/g80_output.c | 30 | ||||
-rw-r--r-- | src/g80_type.h | 5 |
2 files changed, 27 insertions, 8 deletions
diff --git a/src/g80_output.c b/src/g80_output.c index 8bd2096..1ec6a89 100644 --- a/src/g80_output.c +++ b/src/g80_output.c @@ -66,10 +66,11 @@ static Bool G80ReadPortMapping(int scrnIndex, G80Ptr pNv) port = (b >> 4) & 0xf; or = ffs((b >> 24) & 0xf) - 1; - if(type < 4 && port != 0xf) { + if(type == 0xe) break; + + if(type < 4) { switch(type) { case 0: /* CRT */ - case 1: /* TV */ if(pNv->i2cMap[port].dac != -1) { xf86DrvMsg(scrnIndex, X_WARNING, "DDC routing table corrupt! DAC %i -> %i " @@ -78,21 +79,30 @@ static Bool G80ReadPortMapping(int scrnIndex, G80Ptr pNv) } pNv->i2cMap[port].dac = or; break; + case 1: /* TV */ + /* Ignore TVs */ + break; + case 2: /* TMDS */ - case 3: /* LVDS */ if(pNv->i2cMap[port].sor != -1) xf86DrvMsg(scrnIndex, X_WARNING, "DDC routing table corrupt! SOR %i -> %i " "for port %i\n", or, pNv->i2cMap[port].sor, port); pNv->i2cMap[port].sor = or; - pNv->i2cMap[port].panelType = (type == 2) ? TMDS : LVDS; + break; + + case 3: /* LVDS */ + pNv->lvds.present = TRUE; + pNv->lvds.or = or; break; } } } - xf86DrvMsg(scrnIndex, X_PROBED, "I2C map:\n"); + xf86DrvMsg(scrnIndex, X_PROBED, "Connector map:\n"); + if(pNv->lvds.present) + xf86DrvMsg(scrnIndex, X_PROBED, " [N/A] -> SOR%i (LVDS)\n", pNv->lvds.or); for(i = 0; i < 4; i++) { if(pNv->i2cMap[i].dac != -1) xf86DrvMsg(scrnIndex, X_PROBED, " Bus %i -> DAC%i\n", i, pNv->i2cMap[i].dac); @@ -315,8 +325,7 @@ G80CreateOutputs(ScrnInfoPtr pScrn) if(pNv->i2cMap[i].dac != -1) dac = G80CreateDac(pScrn, pNv->i2cMap[i].dac); if(pNv->i2cMap[i].sor != -1) - sor = G80CreateSor(pScrn, pNv->i2cMap[i].sor, - pNv->i2cMap[i].panelType); + sor = G80CreateSor(pScrn, pNv->i2cMap[i].sor, TMDS); if(dac) { G80OutputPrivPtr pPriv = dac->driver_private; @@ -334,6 +343,13 @@ G80CreateOutputs(ScrnInfoPtr pScrn) } } + if(pNv->lvds.present) { + xf86OutputPtr lvds = G80CreateSor(pScrn, pNv->lvds.or, LVDS); + G80OutputPrivPtr pPriv = lvds->driver_private; + + pPriv->scale = G80_SCALE_ASPECT; + } + /* For each output, set the crtc and clone masks */ for(i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; diff --git a/src/g80_type.h b/src/g80_type.h index 0830ecc..ecaedaa 100644 --- a/src/g80_type.h +++ b/src/g80_type.h @@ -48,8 +48,11 @@ typedef struct G80Rec { struct { ORNum dac; ORNum sor; - PanelType panelType; } i2cMap[4]; + struct { + Bool present; + ORNum or; + } lvds; xf86Int10InfoPtr int10; int int10Mode; /* Console mode to restore */ |