xserver: Branch 'master' - 2 commits
Eric Anholt
anholt at kemper.freedesktop.org
Tue Nov 28 02:30:33 EET 2006
configure.ac | 2
hw/xfree86/common/xf86.h | 1
hw/xfree86/common/xf86Mode.c | 24 ++++++++++
hw/xfree86/ddc/ddcProperty.c | 99 +------------------------------------------
4 files changed, 30 insertions(+), 96 deletions(-)
New commits:
diff-tree 5dbcd34a0a6c0d10dbfea8fdc9d7dfe7a0261b19 (from 16f8f10dc2106bc6253b2d89a1f8efee8d80e2ba)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Nov 27 16:26:14 2006 -0800
Register dependency on new RandR protocol.
diff --git a/configure.ac b/configure.ac
index e3221ed..db2234f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -545,7 +545,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.l
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
dnl Core modules for most extensions, et al.
-REQUIRED_MODULES="randrproto renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4] [kbproto >= 1.0.3]"
+REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4] [kbproto >= 1.0.3]"
REQUIRED_LIBS="xfont xau fontenc"
if test "x$DBUS" = xauto; then
diff-tree 16f8f10dc2106bc6253b2d89a1f8efee8d80e2ba (from b4b0d901d98371a8aa7b17d195e18e83e2a6a618)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Nov 27 16:21:31 2006 -0800
Move mode handling helpers from ddcProperty.c to xf86Mode.c.
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 41ad08a..aa73e7d 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -426,6 +426,7 @@ DisplayModePtr xf86DuplicateMode(Display
DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2);
void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
+DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
/* xf86Option.c */
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 5a51be0..3cebac7 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -2178,3 +2178,27 @@ xf86PrintModes(ScrnInfoPtr scrp)
p = p->next;
} while (p != NULL && p != scrp->modes);
}
+
+/**
+ * Adds the new mode into the mode list, and returns the new list
+ *
+ * \param modes doubly-linked mode list.
+ */
+_X_EXPORT DisplayModePtr
+xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new)
+{
+ if (modes == NULL)
+ return new;
+
+ if (new) {
+ DisplayModePtr mode = modes;
+
+ while (mode->next)
+ mode = mode->next;
+
+ mode->next = new;
+ new->prev = mode;
+ }
+
+ return modes;
+}
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
index a1650bc..87c91b8 100644
--- a/hw/xfree86/ddc/ddcProperty.c
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -33,98 +33,6 @@
#include "xf86DDC.h"
/*
- * xf86Mode.c should have a some more DisplayModePtr list handling.
- */
-static DisplayModePtr
-xf86ModesAdd(DisplayModePtr Modes, DisplayModePtr Additions)
-{
- if (!Modes) {
- if (Additions)
- return Additions;
- else
- return NULL;
- }
-
- if (Additions) {
- DisplayModePtr Mode = Modes;
-
- while (Mode->next)
- Mode = Mode->next;
-
- Mode->next = Additions;
- Additions->prev = Mode;
- }
-
- return Modes;
-}
-
-static DisplayModePtr
-xf86ModeCopy(DisplayModePtr Mode)
-{
- DisplayModePtr New;
-
- if (!Mode)
- return NULL;
-
- New = xnfalloc(sizeof(DisplayModeRec));
-
- memcpy(New, Mode, sizeof(DisplayModeRec));
-
- New->name = xnfalloc(strlen(Mode->name) + 1);
- memcpy(New->name, Mode->name, strlen(Mode->name) + 1);
-
- /* We ignore privates as DDC code doesn't use it currently */
- return New;
-}
-
-/*
- * Temporary.
- */
-static void
-add(char **p, char *new)
-{
- *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2);
- strcat(*p, " ");
- strcat(*p, new);
-}
-
-static void
-PrintModeline(int scrnIndex,DisplayModePtr mode)
-{
- char tmp[256];
- char *flags = xnfcalloc(1, 1);
-
- if (mode->HSkew) {
- snprintf(tmp, 256, "hskew %i", mode->HSkew);
- add(&flags, tmp);
- }
- if (mode->VScan) {
- snprintf(tmp, 256, "vscan %i", mode->VScan);
- add(&flags, tmp);
- }
- if (mode->Flags & V_INTERLACE) add(&flags, "interlace");
- if (mode->Flags & V_CSYNC) add(&flags, "composite");
- if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan");
- if (mode->Flags & V_BCAST) add(&flags, "bcast");
- if (mode->Flags & V_PHSYNC) add(&flags, "+hsync");
- if (mode->Flags & V_NHSYNC) add(&flags, "-hsync");
- if (mode->Flags & V_PVSYNC) add(&flags, "+vsync");
- if (mode->Flags & V_NVSYNC) add(&flags, "-vsync");
- if (mode->Flags & V_PCSYNC) add(&flags, "+csync");
- if (mode->Flags & V_NCSYNC) add(&flags, "-csync");
-#if 0
- if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2");
-#endif
- xf86DrvMsgVerb(scrnIndex, X_INFO, 3,
- "Modeline \"%s\" %6.2f %i %i %i %i %i %i %i %i%s\n",
- mode->name, mode->Clock/1000., mode->HDisplay,
- mode->HSyncStart, mode->HSyncEnd, mode->HTotal,
- mode->VDisplay, mode->VSyncStart, mode->VSyncEnd,
- mode->VTotal, flags);
- xfree(flags);
-}
-
-/*
* TODO:
* - for those with access to the VESA DMT standard; review please.
*/
@@ -159,11 +67,12 @@ DDCModesFromEstablished(int scrnIndex, s
((timing->t_manu & 0x80) << 9);
int i;
- for (i = 0; i < 17; i++)
+ for (i = 0; i < 17; i++) {
if (bits & (0x01 << i)) {
- Mode = xf86ModeCopy(&(DDCEstablishedModes[i]));
+ Mode = xf86DusplicateMode(&DDCEstablishedModes[i]);
Modes = xf86ModesAdd(Modes, Mode);
}
+ }
return Modes;
}
@@ -392,7 +301,7 @@ xf86DDCMonitorSet(int scrnIndex, MonPtr
Mode = Modes;
while (Mode) {
- PrintModeline(scrnIndex, Mode);
+ xf86PrintModeline(scrnIndex, Mode);
Mode = Mode->next;
}
More information about the xorg-commit
mailing list