summaryrefslogtreecommitdiff
path: root/hw/xfree86/loader
diff options
context:
space:
mode:
authorKeith Packard <keithp@guitar.keithp.com>2007-02-15 20:36:20 -0800
committerKeith Packard <keithp@guitar.keithp.com>2007-02-15 20:36:20 -0800
commitd4eb4d065032112a38444e36f791cb468a5ca8f4 (patch)
tree7414d13721f1009f92460f7967ea4bec3d015915 /hw/xfree86/loader
parent37fe4c49dc3a5faf2d3d56112b6bd78453045f6a (diff)
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.
Diffstat (limited to 'hw/xfree86/loader')
-rw-r--r--hw/xfree86/loader/Makefile.am2
-rw-r--r--hw/xfree86/loader/loadmod.c24
-rw-r--r--hw/xfree86/loader/xf86sym.c88
3 files changed, 110 insertions, 4 deletions
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 206600214..ceb66a231 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -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)
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index ec0f181db..e4892123b 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -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,
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 1cb7dae08..6337265a8 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -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)
};