diff options
-rw-r--r-- | src/i830_display.c | 2 | ||||
-rw-r--r-- | src/i830_modes.c | 38 | ||||
-rw-r--r-- | src/i830_randr.c | 8 |
3 files changed, 45 insertions, 3 deletions
diff --git a/src/i830_display.c b/src/i830_display.c index 24ce50f7..88280bb3 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -1081,7 +1081,7 @@ i830DetectCRT(ScrnInfoPtr pScrn, Bool allow_disturb) * pipe, as it seems having other outputs on that pipe will result in a * false positive. */ - if (0 && (allow_disturb || !(INREG(ADPA) & !ADPA_DAC_ENABLE))) { + if (1 && (allow_disturb || !(INREG(ADPA) & !ADPA_DAC_ENABLE))) { return i830LoadDetectCRT(pScrn); } diff --git a/src/i830_modes.c b/src/i830_modes.c index 3b70d5d4..3d2b8f31 100644 --- a/src/i830_modes.c +++ b/src/i830_modes.c @@ -685,6 +685,36 @@ i830GetConfiguredMonitor(ScrnInfoPtr pScrn) return mon; } +static MonPtr +i830GetDefaultMonitor(ScrnInfoPtr pScrn) +{ + MonPtr mon; + + mon = xnfcalloc(1, sizeof(*mon)); + + mon->id = xnfstrdup("Unknown Id"); + mon->vendor = xnfstrdup("Unknown Vendor"); + mon->model = xnfstrdup("Unknown Model"); + + mon->nHsync = 1; + mon->hsync[0].lo = 31.0; + mon->hsync[0].hi = 100.0; + mon->nVrefresh = 1; + mon->vrefresh[0].lo = 50.0; + mon->vrefresh[0].hi = 70.0; + mon->widthmm = 400; + mon->heightmm = 300; + /* Use VESA standard and user modelines, and do additional validation + * on them beyond what pipe config will do (x/y/pitch, clocks, flags) + */ + mon->Modes = i830DuplicateModes(pScrn, pScrn->monitor->Modes); + i830xf86ValidateModesSync(pScrn, mon->Modes, mon); + i830xf86PruneInvalidModes(pScrn, &mon->Modes, TRUE); + mon->Last = i830GetModeListTail(mon->Modes); + + return mon; +} + static void i830FreeMonitor(ScrnInfoPtr pScrn, MonPtr mon) { @@ -771,8 +801,12 @@ I830ReprobePipeModeList(ScrnInfoPtr pScrn, int pipe) * know if a monitor is attached, and this detect process should be * infrequent. */ - if (i830DetectCRT(pScrn, TRUE)) - pI830->pipeMon[pipe] = i830GetConfiguredMonitor(pScrn); + if (i830DetectCRT(pScrn, TRUE)) { +/* if (pipe == pI830->pipe) + pI830->pipeMon[pipe] = i830GetConfiguredMonitor(pScrn); + else */ + pI830->pipeMon[pipe] = i830GetDefaultMonitor(pScrn); + } break; default: pI830->pipeMon[pipe] = i830GetConfiguredMonitor(pScrn); diff --git a/src/i830_randr.c b/src/i830_randr.c index 7c67aea2..d86911ce 100644 --- a/src/i830_randr.c +++ b/src/i830_randr.c @@ -773,7 +773,15 @@ static Bool I830RandRGetInfo12 (ScreenPtr pScreen, Rotation *rotations) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + int found_crt; + /* Re-probe the outputs for new monitors or modes */ + pI830->operatingDevices = pI830->operatingDevices & ~PIPE_CRT; + found_crt = i830DetectCRT(pScrn, FALSE); + if (found_crt) + pI830->operatingDevices = pI830->operatingDevices | PIPE_CRT; + I830ValidateXF86ModeList(pScrn, FALSE); return I830RandRSetInfo12 (pScreen); } |