From 77239e85a47e97239a8fe7cf12f039372949d659 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 27 Jun 2011 12:50:32 -0400 Subject: [PATCH 06/15] modes: Combine xf86DefaultModes and DMTModes DMTModes is what xf86DefaultModes was always meant to be. Smash the two together, leaving aliases in place for the old names to make it easy on external modules. Signed-off-by: Adam Jackson --- hw/xfree86/common/Makefile.am | 10 +--------- hw/xfree86/common/xf86Config.c | 3 ++- hw/xfree86/common/xf86Priv.h | 2 +- hw/xfree86/modes/xf86EdidModes.c | 5 ++++- hw/xfree86/modes/xf86Modes.c | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index f8fcde9..3f6d223 100644 --- a/hw/xfree86/common/Makefile.am +++ b/hw/xfree86/common/Makefile.am @@ -31,14 +31,6 @@ RANDRSOURCES = xf86RandR.c BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES) $(PLATSOURCES) -MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes - -xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) - $(AM_V_GEN)cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@ - $(AM_V_GEN)echo >> $@ - -BUILT_SOURCES = xf86DefModeSet.c - AM_LDFLAGS = -r libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Cursor.c $(DGASOURCES) xf86DPMS.c \ @@ -49,7 +41,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Mode.c xorgHelper.c xf86Extensions.h \ xf86Extensions.c xf86vmode.c \ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) -nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h +nodist_libcommon_la_SOURCES = xf86Build.h libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 486752b..c98b799 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2286,7 +2286,8 @@ addDefaultModes(MonPtr monitorp) int i = 0; for (i = 0; i < xf86NumDefaultModes; i++) { - mode = xf86DuplicateMode(&xf86DefaultModes[i]); + mode = xf86DuplicateMode(&DMTModes[i]); + mode->type = M_T_DEFAULT; if (!modeIsPresent(mode, monitorp)) { monitorp->Modes = xf86ModesAdd(monitorp->Modes, mode); last = mode; diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index c9f2e7e..2a97d2f 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -126,7 +126,7 @@ extern _X_EXPORT Bool xf86PathIsSafe(const char *path); /* xf86DefaultModes */ -extern _X_EXPORT const DisplayModeRec xf86DefaultModes[]; +extern _X_EXPORT const DisplayModeRec DMTModes[]; extern _X_EXPORT const int xf86NumDefaultModes; /* xf86Configure.c */ diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 258ada5..efc6809 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -390,6 +390,9 @@ const DisplayModeRec DMTModes[] = { {MODEPREFIX, 505250, 2560, 2768, 3048, 3536, 0, 1600, 1603, 1609, 1682, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 2560x1600@85Hz */ {MODEPREFIX, 552750, 2560, 2608, 2640, 2720, 0, 1600, 1603, 1609, 1694, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 2560x1600@120Hz RB */ }; +/* name compat */ +extern _X_EXPORT const DisplayModeRec xf86DefaultModes[] __attribute__((alias("DMTModes"))); +const int xf86NumDefaultModes = sizeof(DMTModes) / sizeof(DisplayModeRec); #define LEVEL_DMT 0 #define LEVEL_GTF 1 @@ -424,7 +427,7 @@ FindDMTMode(int hsize, int vsize, int refresh, Bool rb) int i; const DisplayModeRec *ret; - for (i = 0; i < sizeof(DMTModes) / sizeof(DisplayModeRec); i++) { + for (i = 0; i < xf86NumDefaultModes; i++) { ret = &DMTModes[i]; if (!rb && xf86ModeIsReduced(ret)) diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index c4a3eb0..40b226e 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -753,7 +753,7 @@ xf86GetDefaultModes(void) int i; for (i = 0; i < xf86NumDefaultModes; i++) { - const DisplayModeRec *defMode = &xf86DefaultModes[i]; + const DisplayModeRec *defMode = &DMTModes[i]; mode = xf86DuplicateMode(defMode); head = xf86ModesAdd(head, mode); -- 1.7.7.6