summaryrefslogtreecommitdiff
path: root/hw/xfree86/modes/xf86Modes.c
diff options
context:
space:
mode:
authorPeter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au>2008-04-07 07:56:41 +0930
committerPeter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au>2008-04-07 07:56:41 +0930
commitfd06e8f8c1d82a9d91931e8532bee0fd9c9ca9ab (patch)
treefda1a9d90f4a3e99af9da656939ff8c112cfeb33 /hw/xfree86/modes/xf86Modes.c
parentb46a00918691cbd5ca80b6d3acae7614f93e073b (diff)
parent6c0cfe3d43b177c4cfaf7e228f32c655f9a98459 (diff)
Merge branch 'master' into dcdc_rework
Conflicts: Xext/xevie.c dix/dispatch.c
Diffstat (limited to 'hw/xfree86/modes/xf86Modes.c')
-rw-r--r--hw/xfree86/modes/xf86Modes.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 3d222cc73..2dff31b3a 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -214,10 +214,11 @@ xf86DuplicateMode(DisplayModePtr pMode)
*pNew = *pMode;
pNew->next = NULL;
pNew->prev = NULL;
- if (pNew->name == NULL) {
- xf86SetModeDefaultName(pMode);
- }
- pNew->name = xnfstrdup(pMode->name);
+
+ if (pMode->name == NULL)
+ xf86SetModeDefaultName(pNew);
+ else
+ pNew->name = xnfstrdup(pMode->name);
return pNew;
}
@@ -508,7 +509,12 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
for (mode = modeList; mode != NULL; mode = mode->next) {
if (xf86ModeBandwidth(mode, depth) > bandwidth)
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
mode->status = MODE_BANDWIDTH;
+#else
+ /* MODE_BANDWIDTH didn't exist in xserver 1.2 */
+ mode->status = MODE_BAD;
+#endif
}
}
@@ -657,7 +663,7 @@ xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed)
DisplayModePtr head = NULL, prev = NULL, mode;
int i;
- for (i = 0; xf86DefaultModes[i].name != NULL; i++)
+ for (i = 0; i < xf86NumDefaultModes; i++)
{
DisplayModePtr defMode = &xf86DefaultModes[i];
@@ -666,23 +672,9 @@ xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed)
if (!doubleScanAllowed && (defMode->Flags & V_DBLSCAN))
continue;
- mode = xalloc(sizeof(DisplayModeRec));
- if (!mode)
- continue;
- memcpy(mode,&xf86DefaultModes[i],sizeof(DisplayModeRec));
- mode->name = xstrdup(xf86DefaultModes[i].name);
- if (!mode->name)
- {
- xfree (mode);
- continue;
- }
- mode->prev = prev;
- mode->next = NULL;
- if (prev)
- prev->next = mode;
- else
- head = mode;
- prev = mode;
+ mode = xf86DuplicateMode(defMode);
+
+ head = xf86ModesAdd(head, mode);
}
return head;
}