diff options
author | Keith Packard <keithp@guitar.keithp.com> | 2006-12-12 22:48:21 -0800 |
---|---|---|
committer | Keith Packard <keithp@guitar.keithp.com> | 2006-12-12 22:48:21 -0800 |
commit | d57a25815398ae83eae8bdcb3a1b607760aa30b6 (patch) | |
tree | 100017e7a3a1ebfda576b09b2ebba985886de630 | |
parent | 41444183b59ed84c09749ca89afbef036d42ec5f (diff) |
Elide duplicate modes in pScrn->monitor.
xf86DDCMonitorSet dumps all of the DDC-discovered modes
into the monitor mode list without checking to see if they
are already present. This provides an ever-changing list of
modes for outputs which have no DDC and which simply duplicate the monitor
mode list.
-rw-r--r-- | src/i830_xf86Crtc.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/i830_xf86Crtc.c b/src/i830_xf86Crtc.c index a222382d..6f96d448 100644 --- a/src/i830_xf86Crtc.c +++ b/src/i830_xf86Crtc.c @@ -337,6 +337,30 @@ xf86DefaultScreenLimits (ScrnInfoPtr pScrn, int *widthp, int *heightp) *heightp = height; } +/* + * XXX walk the monitor mode list and prune out duplicates that + * are inserted by xf86DDCMonitorSet. In an ideal world, that + * function would do this work by itself. + */ + +static void +xf86PruneDuplicateMonitorModes (MonPtr Monitor) +{ + DisplayModePtr master, clone, next; + + for (master = Monitor->Modes; + master && master != Monitor->Last; + master = master->next) + { + for (clone = master->next; clone && clone != Monitor->Modes; clone = next) + { + next = clone->next; + if (xf86ModesEqual (master, clone)) + xf86DeleteMode (&Monitor->Modes, clone); + } + } +} + void xf86ProbeOutputModes (ScrnInfoPtr pScrn) { @@ -344,6 +368,9 @@ xf86ProbeOutputModes (ScrnInfoPtr pScrn) Bool properties_set = FALSE; int o; + /* Elide duplicate modes before defaulting code uses them */ + xf86PruneDuplicateMonitorModes (pScrn->monitor); + /* Probe the list of modes for each output. */ for (o = 0; o < config->num_output; o++) { |