Commit d4eb4d06 authored by Keith Packard's avatar Keith Packard

Merge crtc/output-based mode selection code.

This code comes from the intel driver, so there's no history in this tree.

As the crtc/output-based mode selection code uses ddc, the ddc and i2c
modules have been merged into the server. Attempts to load them are safely
ignored now.
parent 37fe4c49
......@@ -1905,6 +1905,7 @@ hw/xfree86/fbdevhw/Makefile
hw/xfree86/i2c/Makefile
hw/xfree86/int10/Makefile
hw/xfree86/loader/Makefile
hw/xfree86/modes/Makefile
hw/xfree86/os-support/Makefile
hw/xfree86/os-support/bsd/Makefile
hw/xfree86/os-support/bus/Makefile
......
......@@ -12,7 +12,7 @@ DOC_SUBDIR = doc
SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support parser rac \
ramdac shadowfb vbe vgahw xaa xf1bpp xf4bpp xf8_16bpp \
xf8_32bpp loader scanpci dixmods exa \
xf8_32bpp loader scanpci dixmods exa modes \
$(DRI_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR)
DIST_SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support \
......@@ -47,6 +47,9 @@ XORG_LIBS = \
rac/librac.a \
parser/libxf86config.a \
dixmods/libdixmods.la \
modes/libxf86modes.a \
ddc/libddc.a \
i2c/libi2c.a \
@XORG_LIBS@
Xorg_DEPENDENCIES = \
......
sdk_HEADERS = edid.h vdif.h xf86DDC.h
module_LTLIBRARIES = libddc.la
noinst_LIBRARIES = libddc.a
libddc_la_LDFLAGS = -avoid-version
libddc_la_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \
libddc_a_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \
interpret_vdif.c print_vdif.c ddcProperty.c \
edid_modes.c
edid_modes.c
INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c
......
......@@ -31,6 +31,7 @@
#include "property.h"
#include "propertyst.h"
#include "xf86DDC.h"
#include "xf86_ansic.h"
#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
......
......@@ -15,6 +15,8 @@
static const OptionInfoRec *DDCAvailableOptions(void *unused);
#if DDC_MODULE
static MODULESETUPPROTO(ddcSetup);
static XF86ModuleVersionInfo ddcVersRec =
......@@ -57,6 +59,8 @@ ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
return (pointer)1;
}
#endif
#define RETRIES 4
static unsigned char *EDIDRead_DDC1(
......
module_LTLIBRARIES = libi2c.la
module_LIBRARIES = libi2c.a
multimediadir = $(moduledir)/multimedia
multimedia_LTLIBRARIES = \
......@@ -10,8 +10,7 @@ multimedia_LTLIBRARIES = \
tda9885_drv.la \
uda1380_drv.la
libi2c_la_LDFLAGS = -avoid-version
libi2c_la_SOURCES = xf86i2c.c xf86i2cmodule.c
libi2c_a_SOURCES = xf86i2c.c
INCLUDES = $(XORG_INCS)
......
......@@ -2,7 +2,7 @@ noinst_LIBRARIES = libloader.a
INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(srcdir)/../dixmods/extmod \
-I$(srcdir)/../vbe -I$(top_srcdir)/miext/cw -I$(srcdir)/../int10 \
-I$(srcdir)/../ddc -I$(srcdir)/../i2c
-I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes
#AM_LDFLAGS = -r
AM_CFLAGS = -DIN_LOADER $(DIX_CFLAGS) $(XORG_CFLAGS)
......
......@@ -768,7 +768,7 @@ LoadSubModule(ModuleDescPtr parent, const char *module,
submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
modreq, errmaj, errmin, LD_FLAG_GLOBAL);
if (submod) {
if (submod && submod != (ModuleDescPtr) 1) {
parent->child = AddSibling(parent->child, submod);
submod->parent = parent;
}
......@@ -799,7 +799,7 @@ LoadSubModuleLocal(ModuleDescPtr parent, const char *module,
submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
modreq, errmaj, errmin, 0);
if (submod) {
if (submod && submod != (ModuleDescPtr) 1) {
parent->child = AddSibling(parent->child, submod);
submod->parent = parent;
}
......@@ -838,6 +838,11 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
return ret;
}
static const char *compiled_in_modules[] = {
"ddc",
"i2c",
NULL
};
static ModuleDescPtr
doLoadModule(const char *module, const char *path, const char **subdirlist,
......@@ -856,9 +861,17 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
PatternPtr patterns = NULL;
int noncanonical = 0;
char *m = NULL;
char **cim;
xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
for (cim = compiled_in_modules; *cim; cim++)
if (!strcmp (module, *cim))
{
xf86MsgVerb(X_INFO, 3, "Module alread ybuilt-in");
return (ModuleDescPtr) 1;
}
patterns = InitPatterns(patternlist);
name = LoaderGetCanonicalName(module, patterns);
noncanonical = (name && strcmp(module, name) != 0);
......@@ -1108,6 +1121,9 @@ UnloadDriver(ModuleDescPtr mod)
static void
UnloadModuleOrDriver(ModuleDescPtr mod)
{
if (mod == (ModuleDescPtr) 1)
return;
if (mod == NULL || mod->name == NULL)
return;
......@@ -1156,6 +1172,8 @@ FreeModuleDesc(ModuleDescPtr head)
{
ModuleDescPtr sibs, prev;
if (head == (ModuleDescPtr) 1)
return;
/*
* only free it if it's not marked as in use. In use means that it may
* be unloaded someday, and UnloadModule or UnloadDriver will free it
......@@ -1338,7 +1356,7 @@ LoaderGetCanonicalName(const char *modname, PatternPtr patterns)
unsigned long
LoaderGetModuleVersion(ModuleDescPtr mod)
{
if (!mod || !mod->VersionInfo)
if (!mod || mod == (ModuleDescPtr) 1 || !mod->VersionInfo)
return 0;
return MODULE_VERSION_NUMERIC(mod->VersionInfo->majorversion,
......
......@@ -89,6 +89,13 @@
#include "xf86sbusBus.h"
#endif
#include "compiler.h"
#include "xf86Crtc.h"
#include "xf86Modes.h"
#ifdef RANDR
#include "xf86RandR12.h"
#endif
#include "xf86DDC.h"
#include "edid.h"
#ifndef HAS_GLIBC_SIGSETJMP
#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
......@@ -1161,4 +1168,85 @@ _X_HIDDEN void *xfree86LookupTab[] = {
/* Pci.c */
SYMVAR(pciNumBuses)
/* modes */
SYMFUNC(xf86CrtcConfigInit)
SYMFUNC(xf86CrtcConfigPrivateIndex)
SYMFUNC(xf86CrtcCreate)
SYMFUNC(xf86CrtcDestroy)
SYMFUNC(xf86CrtcInUse)
SYMFUNC(xf86CrtcRotate)
SYMFUNC(xf86CrtcSetMode)
SYMFUNC(xf86CrtcSetSizeRange)
SYMFUNC(xf86CVTMode)
SYMFUNC(xf86DisableUnusedFunctions)
SYMFUNC(xf86DPMSSet)
SYMFUNC(xf86DuplicateMode)
SYMFUNC(xf86DuplicateModes)
SYMFUNC(xf86GetDefaultModes)
SYMFUNC(xf86GetMonitorModes)
SYMFUNC(xf86InitialConfiguration)
SYMFUNC(xf86ModeHSync)
SYMFUNC(xf86ModesAdd)
SYMFUNC(xf86ModesEqual)
SYMFUNC(xf86ModeVRefresh)
SYMFUNC(xf86OutputCreate)
SYMFUNC(xf86OutputDestroy)
SYMFUNC(xf86OutputGetEDID)
SYMFUNC(xf86OutputGetEDIDModes)
SYMFUNC(xf86OutputRename)
SYMFUNC(xf86OutputSetEDID)
SYMFUNC(xf86PrintModeline)
SYMFUNC(xf86ProbeOutputModes)
SYMFUNC(xf86PruneInvalidModes)
SYMFUNC(xf86SetModeCrtc)
SYMFUNC(xf86SetModeDefaultName)
SYMFUNC(xf86SetScrnInfoModes)
SYMFUNC(xf86ValidateModesClocks)
SYMFUNC(xf86ValidateModesFlags)
SYMFUNC(xf86ValidateModesSize)
SYMFUNC(xf86ValidateModesSync)
SYMFUNC(xf86ValidateModesUserConfig)
SYMFUNC(xf86DiDGAInit)
SYMFUNC(xf86DiDGAReInit)
SYMFUNC(xf86DDCGetModes)
SYMFUNC(xf86SaveScreen)
#ifdef RANDR
SYMFUNC(xf86RandR12CreateScreenResources)
SYMFUNC(xf86RandR12GetOriginalVirtualSize)
SYMFUNC(xf86RandR12GetRotation)
SYMFUNC(xf86RandR12Init)
SYMFUNC(xf86RandR12PreInit)
SYMFUNC(xf86RandR12SetConfig)
SYMFUNC(xf86RandR12SetRotations)
#endif
SYMFUNC(xf86DoEDID_DDC1)
SYMFUNC(xf86DoEDID_DDC2)
SYMFUNC(xf86InterpretEDID)
SYMFUNC(xf86PrintEDID)
SYMFUNC(xf86InterpretVdif)
SYMFUNC(xf86print_vdif)
SYMFUNC(xf86DDCMonitorSet)
SYMFUNC(xf86SetDDCproperties)
SYMFUNC(xf86CreateI2CBusRec)
SYMFUNC(xf86CreateI2CDevRec)
SYMFUNC(xf86DestroyI2CBusRec)
SYMFUNC(xf86DestroyI2CDevRec)
SYMFUNC(xf86I2CBusInit)
SYMFUNC(xf86I2CDevInit)
SYMFUNC(xf86I2CFindBus)
SYMFUNC(xf86I2CFindDev)
SYMFUNC(xf86I2CGetScreenBuses)
SYMFUNC(xf86I2CProbeAddress)
SYMFUNC(xf86I2CReadByte)
SYMFUNC(xf86I2CReadBytes)
SYMFUNC(xf86I2CReadStatus)
SYMFUNC(xf86I2CReadWord)
SYMFUNC(xf86I2CWriteByte)
SYMFUNC(xf86I2CWriteBytes)
SYMFUNC(xf86I2CWriteRead)
SYMFUNC(xf86I2CWriteVec)
SYMFUNC(xf86I2CWriteWord)
};
noinst_LIBRARIES = libxf86modes.a
libxf86modes_a_SOURCES = \
xf86Crtc.c \
xf86Crtc.h \
xf86cvt.c \
xf86DiDGA.c \
xf86EdidModes.c \
xf86Modes.c \
xf86Modes.h \
xf86RandR12.c \
xf86RandR12.h \
xf86Rename.h \
xf86Rotate.c
INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
-I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \
-I$(srcdir)/../scanpci -I$(srcdir)/../vbe -I$(srcdir)/../int10 \
-I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod
sdk_HEADERS = \
xf86Crtc.h \
xf86Modes.h \
xf86RandR12.h \
xf86Rename.h
AM_CFLAGS = $(XORG_CFLAGS)
This diff is collapsed.
This diff is collapsed.
/*
* Copyright © 2006 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "xf86.h"
#include "xf86DDC.h"
#include "xf86_OSproc.h"
#include "dgaproc.h"
#include "xf86Crtc.h"
#include "xf86Modes.h"
#include "gcstruct.h"
static Bool
xf86_dga_get_modes (ScreenPtr pScreen)
{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
DGAModePtr modes, mode;
DisplayModePtr display_mode;
int bpp = scrn->bitsPerPixel >> 3;
int num;
num = 0;
display_mode = scrn->modes;
while (display_mode)
{
num++;
display_mode = display_mode->next;
if (display_mode == scrn->modes)
break;
}
if (!num)
return FALSE;
modes = xalloc(num * sizeof(DGAModeRec));
if (!modes)
return FALSE;
num = 0;
display_mode = scrn->modes;
while (display_mode)
{
mode = modes + num++;
mode->mode = display_mode;
mode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE;
mode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT;
if (display_mode->Flags & V_DBLSCAN)
mode->flags |= DGA_DOUBLESCAN;
if (display_mode->Flags & V_INTERLACE)
mode->flags |= DGA_INTERLACED;
mode->byteOrder = scrn->imageByteOrder;
mode->depth = scrn->depth;
mode->bitsPerPixel = scrn->bitsPerPixel;
mode->red_mask = scrn->mask.red;
mode->green_mask = scrn->mask.green;
mode->blue_mask = scrn->mask.blue;
mode->visualClass = (bpp == 1) ? PseudoColor : TrueColor;
mode->viewportWidth = display_mode->HDisplay;
mode->viewportHeight = display_mode->VDisplay;
mode->xViewportStep = (bpp == 3) ? 2 : 1;
mode->yViewportStep = 1;
mode->viewportFlags = DGA_FLIP_RETRACE;
mode->offset = 0;
mode->address = (unsigned char *) xf86_config->dga_address;
mode->bytesPerScanline = xf86_config->dga_stride;
mode->imageWidth = xf86_config->dga_width;
mode->imageHeight = xf86_config->dga_height;
mode->pixmapWidth = mode->imageWidth;
mode->pixmapHeight = mode->imageHeight;
mode->maxViewportX = mode->imageWidth - mode->viewportWidth;
mode->maxViewportY = mode->imageHeight - mode->viewportHeight;
display_mode = display_mode->next;
if (display_mode == scrn->modes)
break;
}
if (xf86_config->dga_modes)
xfree (xf86_config->dga_modes);
xf86_config->dga_nmode = num;
xf86_config->dga_modes = modes;
return TRUE;
}
static Bool
xf86_dga_set_mode(ScrnInfoPtr scrn, DGAModePtr display_mode)
{
ScreenPtr pScreen = scrn->pScreen;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
if (!display_mode)
{
if (xf86_config->dga_save_mode)
{
xf86SwitchMode(pScreen, xf86_config->dga_save_mode);
xf86_config->dga_save_mode = NULL;
}
}
else
{
if (!xf86_config->dga_save_mode)
{
xf86_config->dga_save_mode = scrn->currentMode;
xf86SwitchMode(pScreen, display_mode->mode);
}
}
return TRUE;
}
static int
xf86_dga_get_viewport(ScrnInfoPtr scrn)
{
return 0;
}
static void
xf86_dga_set_viewport(ScrnInfoPtr scrn, int x, int y, int flags)
{
scrn->AdjustFrame(scrn->pScreen->myNum, x, y, flags);
}
static Bool
xf86_dga_get_drawable_and_gc (ScrnInfoPtr scrn, DrawablePtr *ppDrawable, GCPtr *ppGC)
{
ScreenPtr pScreen = scrn->pScreen;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
PixmapPtr pPixmap;
GCPtr pGC;
pPixmap = GetScratchPixmapHeader (pScreen, xf86_config->dga_width, xf86_config->dga_height,
scrn->depth, scrn->bitsPerPixel, xf86_config->dga_stride,
(char *) scrn->memPhysBase + scrn->fbOffset);
if (!pPixmap)
return FALSE;
pGC = GetScratchGC (scrn->depth, pScreen);
if (!pGC)
{
FreeScratchPixmapHeader (pPixmap);
return FALSE;
}
*ppDrawable = &pPixmap->drawable;
*ppGC = pGC;
return TRUE;
}
static void
xf86_dga_release_drawable_and_gc (ScrnInfoPtr scrn, DrawablePtr pDrawable, GCPtr pGC)
{
FreeScratchGC (pGC);
FreeScratchPixmapHeader ((PixmapPtr) pDrawable);
}
static void
xf86_dga_fill_rect(ScrnInfoPtr scrn, int x, int y, int w, int h, unsigned long color)
{
GCPtr pGC;
DrawablePtr pDrawable;
XID vals[1];
xRectangle r;
if (!xf86_dga_get_drawable_and_gc (scrn, &pDrawable, &pGC))
return;
vals[0] = color;
ChangeGC (pGC, GCForeground, vals);
ValidateGC (pDrawable, pGC);
r.x = x;
r.y = y;
r.width = w;
r.height = h;
pGC->ops->PolyFillRect (pDrawable, pGC, 1, &r);
xf86_dga_release_drawable_and_gc (scrn, pDrawable, pGC);
}
static void
xf86_dga_sync(ScrnInfoPtr scrn)
{
ScreenPtr pScreen = scrn->pScreen;
WindowPtr pRoot = WindowTable [pScreen->myNum];
char buffer[4];
pScreen->GetImage (&pRoot->drawable, 0, 0, 1, 1, ZPixmap, ~0L, buffer);
}
static void
xf86_dga_blit_rect(ScrnInfoPtr scrn, int srcx, int srcy, int w, int h, int dstx, int dsty)
{
DrawablePtr pDrawable;
GCPtr pGC;
if (!xf86_dga_get_drawable_and_gc (scrn, &pDrawable, &pGC))
return;
ValidateGC (pDrawable, pGC);
pGC->ops->CopyArea (pDrawable, pDrawable, pGC, srcx, srcy, w, h, dstx, dsty);
xf86_dga_release_drawable_and_gc (scrn, pDrawable, pGC);
}
static Bool
xf86_dga_open_framebuffer(ScrnInfoPtr scrn,
char **name,
unsigned char **mem, int *size, int *offset, int *flags)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
*size = xf86_config->dga_stride * xf86_config->dga_height;
*mem = (unsigned char *) (xf86_config->dga_address);
*offset = 0;
*flags = DGA_NEED_ROOT;
return TRUE;
}
static void
xf86_dga_close_framebuffer(ScrnInfoPtr scrn)
{
}
static DGAFunctionRec xf86_dga_funcs = {
xf86_dga_open_framebuffer,
xf86_dga_close_framebuffer,
xf86_dga_set_mode,
xf86_dga_set_viewport,
xf86_dga_get_viewport,
xf86_dga_sync,
xf86_dga_fill_rect,
xf86_dga_blit_rect,
NULL
};
Bool
xf86DiDGAReInit (ScreenPtr pScreen)
{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
if (!xf86_dga_get_modes (pScreen))
return FALSE;
return DGAReInitModes (pScreen, xf86_config->dga_modes, xf86_config->dga_nmode);
}
Bool
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address)
{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86_config->dga_flags = 0;
xf86_config->dga_address = dga_address;
xf86_config->dga_width = scrn->virtualX;
xf86_config->dga_height = scrn->virtualY;
xf86_config->dga_stride = scrn->displayWidth * scrn->bitsPerPixel >> 3;
if (!xf86_dga_get_modes (pScreen))
return FALSE;
return DGAInit(pScreen, &xf86_dga_funcs, xf86_config->dga_modes, xf86_config->dga_nmode);
}
This diff is collapsed.
This diff is collapsed.
/*
* Copyright 2006 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#ifndef _I830_XF86MODES_H_
#define _I830_XF86MODES_H_
#include "xorgVersion.h"
#include "xf86Parser.h"
#include "edid.h"
#if XF86_MODES_RENAME
#include "xf86Rename.h"
#endif
double xf86ModeHSync(DisplayModePtr mode);
double xf86ModeVRefresh(DisplayModePtr mode);
DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode);
DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn,
DisplayModePtr modeList);
void xf86SetModeDefaultName(DisplayModePtr mode);
void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2);
void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh,
Bool Reduced, Bool Interlaced);
void
xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList,
int flags);
void
xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList,
int *min,