diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2007-03-27 17:12:21 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2007-03-27 17:12:21 -0700 |
commit | 2d8d5bd597d760968b683d41ced6a0a76518ec26 (patch) | |
tree | 9476bfa3e635c4c73a557aafdd36c86f5d5799c1 /src/g80_dac.c | |
parent | 4b8ed8497a9ab6ef1316bfcce9f31d96dd4b3540 (diff) |
G80: Improve output detection.
Detect output status for paired outputs together and cache status until the
BlockHandler to avoid redundantly probing for EDIDs or performing load
detection.
Diffstat (limited to 'src/g80_dac.c')
-rw-r--r-- | src/g80_dac.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/g80_dac.c b/src/g80_dac.c index bb86748..ac82616 100644 --- a/src/g80_dac.c +++ b/src/g80_dac.c @@ -76,6 +76,19 @@ G80DacModeSet(xf86OutputPtr output, DisplayModePtr mode, static xf86OutputStatus G80DacDetect(xf86OutputPtr output) { + G80OutputPrivPtr pPriv = output->driver_private; + + /* Assume physical status isn't going to change before the BlockHandler */ + if(pPriv->cached_status != XF86OutputStatusUnknown) + return pPriv->cached_status; + + G80OutputPartnersDetect(output, pPriv->partner, pPriv->i2c); + return pPriv->cached_status; +} + +Bool +G80DacLoadDetect(xf86OutputPtr output) +{ ScrnInfoPtr pScrn = output->scrn; G80Ptr pNv = G80PTR(pScrn); G80OutputPrivPtr pPriv = output->driver_private; @@ -99,11 +112,11 @@ G80DacDetect(xf86OutputPtr output) // Use this DAC if all three channels show load. if((load & 0x38000000) == 0x38000000) { xf86ErrorF("found one!\n"); - return XF86OutputStatusConnected; + return TRUE; } xf86ErrorF("nothing.\n"); - return XF86OutputStatusDisconnected; + return FALSE; } static void @@ -144,6 +157,7 @@ G80CreateDac(ScrnInfoPtr pScrn, ORNum or) pPriv->type = DAC; pPriv->or = or; + pPriv->cached_status = XF86OutputStatusUnknown; pPriv->set_pclk = G80DacSetPClk; output->driver_private = pPriv; output->interlaceAllowed = TRUE; |