diff options
author | Keith Packard <keithp@neko.keithp.com> | 2006-12-30 21:57:42 -0800 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2006-12-30 21:57:42 -0800 |
commit | 8b6c456e16c81f719bb68178e3e4d26f4108a9c2 (patch) | |
tree | 2292e9534fa1daa34c8615ae98e641516c651003 | |
parent | b8692e646227e56c9ae4f72b9aaa75457b4c0f5f (diff) |
Detect in ProbeModes. Let get_modes set edid. Prune interlace/dblscan.
Move output connection status detection from RandR code up to ProbeModes so
it is done before mode sets are built. Otherwise, the mode building code
will elide all modes the first time through as it ignores outputs that are
disconnected.
Most get_modes functions fetch EDID data; make sure that any
EDID changes are used in the ProbeModes filtering of default modes.
Otherwise, stale EDID data will be used.
Allow outputs to advertise support for interlaced and double scan modes;
prune such modes from the default mode list when outputs do not support them.
-rw-r--r-- | src/i830_crt.c | 2 | ||||
-rw-r--r-- | src/i830_dvo.c | 2 | ||||
-rw-r--r-- | src/i830_lvds.c | 2 | ||||
-rw-r--r-- | src/i830_randr.c | 2 | ||||
-rw-r--r-- | src/i830_sdvo.c | 2 | ||||
-rw-r--r-- | src/i830_tv.c | 2 | ||||
-rw-r--r-- | src/i830_xf86Crtc.c | 26 | ||||
-rw-r--r-- | src/i830_xf86Crtc.h | 16 | ||||
-rw-r--r-- | src/i830_xf86Modes.c | 9 | ||||
-rw-r--r-- | src/i830_xf86Modes.h | 2 |
10 files changed, 55 insertions, 10 deletions
diff --git a/src/i830_crt.c b/src/i830_crt.c index 85c25de1..4e9e3706 100644 --- a/src/i830_crt.c +++ b/src/i830_crt.c @@ -365,6 +365,8 @@ i830_crt_init(ScrnInfoPtr pScrn) i830_output->type = I830_OUTPUT_ANALOG; output->driver_private = i830_output; + output->interlaceAllowed = FALSE; + output->doubleScanAllowed = FALSE; /* Set up the DDC bus. */ I830I2CInit(pScrn, &i830_output->pDDCBus, GPIOA, "CRTDDC_A"); diff --git a/src/i830_dvo.c b/src/i830_dvo.c index d1010545..37caf000 100644 --- a/src/i830_dvo.c +++ b/src/i830_dvo.c @@ -257,6 +257,8 @@ i830_dvo_init(ScrnInfoPtr pScrn) intel_output->type = I830_OUTPUT_DVO; output->driver_private = intel_output; output->subpixel_order = SubPixelHorizontalRGB; + output->interlaceAllowed = FALSE; + output->doubleScanAllowed = FALSE; /* Set up the DDC bus */ ret = I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOD, "DVODDC_D"); diff --git a/src/i830_lvds.c b/src/i830_lvds.c index fe964136..18ac76bf 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -361,6 +361,8 @@ i830_lvds_init(ScrnInfoPtr pScrn) intel_output->type = I830_OUTPUT_LVDS; output->driver_private = intel_output; output->subpixel_order = SubPixelHorizontalRGB; + output->interlaceAllowed = FALSE; + output->doubleScanAllowed = FALSE; /* Set up the LVDS DDC channel. Most panels won't support it, but it can * be useful if available. diff --git a/src/i830_randr.c b/src/i830_randr.c index 3d6febc1..64d7d1fa 100644 --- a/src/i830_randr.c +++ b/src/i830_randr.c @@ -740,7 +740,7 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) output->mm_height); xf86RROutputSetModes (output->randr_output, output->probed_modes); - switch (output->status = (*output->funcs->detect)(output)) { + switch (output->status) { case XF86OutputStatusConnected: RROutputSetConnection (output->randr_output, RR_Connected); break; diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c index cb68802a..b5116be0 100644 --- a/src/i830_sdvo.c +++ b/src/i830_sdvo.c @@ -1091,6 +1091,8 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device) return; } output->driver_private = intel_output; + output->interlaceAllowed = FALSE; + output->doubleScanAllowed = FALSE; dev_priv = (struct i830_sdvo_priv *) (intel_output + 1); intel_output->type = I830_OUTPUT_SDVO; diff --git a/src/i830_tv.c b/src/i830_tv.c index 62318911..f17a3532 100644 --- a/src/i830_tv.c +++ b/src/i830_tv.c @@ -1035,4 +1035,6 @@ i830_tv_init(ScrnInfoPtr pScrn) dev_priv->type = TV_TYPE_UNKNOWN; output->driver_private = intel_output; + output->interlaceAllowed = FALSE; + output->doubleScanAllowed = FALSE; } diff --git a/src/i830_xf86Crtc.c b/src/i830_xf86Crtc.c index f2d60268..6e9e52ac 100644 --- a/src/i830_xf86Crtc.c +++ b/src/i830_xf86Crtc.c @@ -542,19 +542,27 @@ xf86ProbeOutputModes (ScrnInfoPtr pScrn) { xf86OutputPtr output = config->output[o]; DisplayModePtr mode; - DisplayModePtr config_modes, output_modes, default_modes; - XF86ConfMonitorPtr conf_monitor = output->conf_monitor; - xf86MonPtr edid_monitor = output->MonInfo; + DisplayModePtr config_modes = NULL, output_modes, default_modes; + XF86ConfMonitorPtr conf_monitor; + xf86MonPtr edid_monitor; MonRec mon_rec; enum { sync_config, sync_edid, sync_default } sync_source = sync_default; while (output->probed_modes != NULL) xf86DeleteMode(&output->probed_modes, output->probed_modes); + /* + * Check connection status + */ + output->status = (*output->funcs->detect)(output); + if (output->status == XF86OutputStatusDisconnected) continue; memset (&mon_rec, '\0', sizeof (mon_rec)); + + conf_monitor = output->conf_monitor; + if (conf_monitor) { int i; @@ -573,7 +581,13 @@ xf86ProbeOutputModes (ScrnInfoPtr pScrn) mon_rec.nVrefresh++; sync_source = sync_config; } + config_modes = i830xf86GetMonitorModes (pScrn, conf_monitor); } + + output_modes = (*output->funcs->get_modes) (output); + + edid_monitor = output->MonInfo; + if (edid_monitor) { int i; @@ -621,10 +635,8 @@ xf86ProbeOutputModes (ScrnInfoPtr pScrn) mon_rec.vrefresh[0].hi = 62.0; mon_rec.nVrefresh = 1; } - - config_modes = i830xf86GetMonitorModes (pScrn, conf_monitor); - output_modes = (*output->funcs->get_modes) (output); - default_modes = i830xf86GetDefaultModes (); + default_modes = i830xf86GetDefaultModes (output->interlaceAllowed, + output->doubleScanAllowed); if (sync_source == sync_config) { diff --git a/src/i830_xf86Crtc.h b/src/i830_xf86Crtc.h index 168d89d8..3e705632 100644 --- a/src/i830_xf86Crtc.h +++ b/src/i830_xf86Crtc.h @@ -261,6 +261,17 @@ struct _xf86Output { * Possible outputs to share the same CRTC as a mask of output indices */ CARD32 possible_clones; + + /** + * Whether this output can support interlaced modes + */ + Bool interlaceAllowed; + + /** + * Whether this output can support double scan modes + */ + Bool doubleScanAllowed; + /** * List of available modes on this output. * @@ -270,6 +281,11 @@ struct _xf86Output { DisplayModePtr probed_modes; /** + * Desired initial position + */ + int initial_x, initial_y; + + /** * Current connection status * * This indicates whether a monitor is known to be connected diff --git a/src/i830_xf86Modes.c b/src/i830_xf86Modes.c index 3a272cbc..482a3320 100644 --- a/src/i830_xf86Modes.c +++ b/src/i830_xf86Modes.c @@ -636,13 +636,20 @@ i830xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor) * Build a mode list containing all of the default modes */ DisplayModePtr -i830xf86GetDefaultModes (void) +i830xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed) { DisplayModePtr head = NULL, prev = NULL, mode; int i; for (i = 0; xf86DefaultModes[i].name != NULL; i++) { + DisplayModePtr defMode = &xf86DefaultModes[i]; + + if (!interlaceAllowed && (defMode->Flags & V_INTERLACE)) + continue; + if (!doubleScanAllowed && (defMode->Flags & V_DBLSCAN)) + continue; + mode = xalloc(sizeof(DisplayModeRec)); if (!mode) continue; diff --git a/src/i830_xf86Modes.h b/src/i830_xf86Modes.h index 280743bd..a7d0839d 100644 --- a/src/i830_xf86Modes.h +++ b/src/i830_xf86Modes.h @@ -90,6 +90,6 @@ DisplayModePtr i830xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor); DisplayModePtr -i830xf86GetDefaultModes (void); +i830xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed); #endif /* _I830_XF86MODES_H_ */ |