summaryrefslogtreecommitdiff
path: root/src/i830_lvds.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-12-28 16:27:22 -0800
committerKeith Packard <keithp@neko.keithp.com>2006-12-28 16:27:22 -0800
commitbb238a8fc234a8e5e86cd2f42c58c9816a15732c (patch)
tree247723448fe816dbf04c2dbc43d16784f667616a /src/i830_lvds.c
parentc87462ded20904dbc6c6cbdb9547523b75fe5471 (diff)
Configuration support: per-output mode lines, preferred mode.
Add the modelines specified in the per-output monitor and all of the default modes to the list to each output. Prune the resulting list to specified sync limits and virtual sizes. Sort the resulting mode list on preferred/size/refresh.
Diffstat (limited to 'src/i830_lvds.c')
-rw-r--r--src/i830_lvds.c45
1 files changed, 40 insertions, 5 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index b682b27f..fe964136 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -127,7 +127,19 @@ i830_lvds_restore(xf86OutputPtr output)
static int
i830_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
{
- return MODE_OK;
+ ScrnInfoPtr pScrn = output->scrn;
+ I830Ptr pI830 = I830PTR(pScrn);
+ DisplayModePtr pFixedMode = pI830->panel_fixed_mode;
+
+ if (pFixedMode)
+ {
+ if (pMode->HDisplay > pFixedMode->HDisplay)
+ return MODE_PANEL;
+ if (pMode->VDisplay > pFixedMode->VDisplay)
+ return MODE_PANEL;
+ }
+
+ return MODE_OK;
}
static Bool
@@ -236,14 +248,37 @@ i830_lvds_detect(xf86OutputPtr output)
static DisplayModePtr
i830_lvds_get_modes(xf86OutputPtr output)
{
- ScrnInfoPtr pScrn = output->scrn;
- I830Ptr pI830 = I830PTR(pScrn);
- DisplayModePtr modes;
+ I830OutputPrivatePtr intel_output = output->driver_private;
+ ScrnInfoPtr pScrn = output->scrn;
+ I830Ptr pI830 = I830PTR(pScrn);
+ xf86MonPtr edid_mon;
+ DisplayModePtr modes;
- modes = i830_ddc_get_modes(output);
+ edid_mon = i830_xf86OutputGetEDID (output, intel_output->pDDCBus);
+ i830_xf86OutputSetEDID (output, edid_mon);
+
+ modes = i830_xf86OutputGetEDIDModes (output);
if (modes != NULL)
return modes;
+ if (!output->MonInfo)
+ {
+ edid_mon = xcalloc (1, sizeof (xf86Monitor));
+ if (edid_mon)
+ {
+ /* Set wide sync ranges so we get all modes
+ * handed to valid_mode for checking
+ */
+ edid_mon->det_mon[0].type = DS_RANGES;
+ edid_mon->det_mon[0].section.ranges.min_v = 0;
+ edid_mon->det_mon[0].section.ranges.max_v = 200;
+ edid_mon->det_mon[0].section.ranges.min_h = 0;
+ edid_mon->det_mon[0].section.ranges.max_h = 200;
+
+ output->MonInfo = edid_mon;
+ }
+ }
+
if (pI830->panel_fixed_mode != NULL)
return xf86DuplicateMode(pI830->panel_fixed_mode);