summaryrefslogtreecommitdiff
path: root/src/i830_modes.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-09-23 12:00:43 +0100
committerKeith Packard <keithp@neko.keithp.com>2006-09-23 12:00:43 +0100
commitc34490bbda6604a21809d15c798607806fa6c725 (patch)
tree9cfa22244e8f86da8bf3ab7159b1ed3ae41471cd /src/i830_modes.c
parent4820caf46e050761d9b347b8a440381e1b1f4727 (diff)
Construct default monitor description for hotplug non-DDC monitor.
When detecting a monitor that doesn't support DDC, construct a default monitor with "sensible" values instead of using whatever the builtin LCD screen uses. Clearly we need a way to set the monitor parameters when we cannot detect them.
Diffstat (limited to 'src/i830_modes.c')
-rw-r--r--src/i830_modes.c38
1 files changed, 36 insertions, 2 deletions
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);