summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2006-03-11 01:00:09 +0000
committerLuc Verhaegen <libv@skynet.be>2006-03-11 01:00:09 +0000
commitc60d9966f4596db0fcc85684b7fb4555761a74a9 (patch)
tree3ddf13cf7ad8457b5799b1f79b2c899098c5104f
parent16f8aa36e736b61a51496020ced1884e26d10787 (diff)
Unify ati and atimisc under ati.
-rw-r--r--ChangeLog11
-rw-r--r--src/Makefile.am26
-rw-r--r--src/atiload.c136
-rw-r--r--src/atimisc.c149
-rw-r--r--src/atimodule.c203
-rw-r--r--src/atimodule.h29
-rw-r--r--src/atiprobe.c15
7 files changed, 194 insertions, 375 deletions
diff --git a/ChangeLog b/ChangeLog
index 38eee17..e69e63a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2006-03-11 Luc Verhaegen <libv@skynet.be>
+ * src/Makefile.am:
+ * src/atiload.c:
+ * src/atimisc.c:
+ * src/atimodule.c: (ATISetup):
+ * src/atimodule.h:
+ * src/atiprobe.c: (ATIProbe):
+
+ Unify ati and atimisc under ati.
+
+2006-03-11 Luc Verhaegen <libv@skynet.be>
+
* configure.ac:
* src/atiprobe.c: (ATIProbe):
diff --git a/src/Makefile.am b/src/Makefile.am
index f25b761..b93270d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,8 +31,7 @@ ATIMISC_DRI_SRCS = atidri.c
endif
if ATIMISC_CPIO
-ATI_CPIO_SOURCES = ativgaio.c
-ATIMISC_CPIO_SOURCES = ativga.c atibank.c atiwonder.c atiwonderio.c
+ATI_CPIO_SOURCES = ativgaio.c ativga.c atibank.c atiwonder.c atiwonderio.c
endif
if ATIMISC_DGA
@@ -46,19 +45,14 @@ ati_drv_la_LDFLAGS = -module -avoid-version
ati_drv_ladir = @moduledir@/drivers
ati_drv_la_SOURCES = \
ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \
- atiprobe.c atividmem.c atimodule.c $(ATI_CPIO_SOURCES)
-
-atimisc_drv_la_LTLIBRARIES = atimisc_drv.la
-atimisc_drv_la_LDFLAGS = -module -avoid-version
-atimisc_drv_ladir = @moduledir@/drivers
-atimisc_drv_la_SOURCES = \
- atiaccel.c atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \
- aticursor.c atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \
- atilock.c atimach64.c atimach64accel.c atimach64cursor.c \
- atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \
- atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \
- atixv.c atiload.c atimisc.c $(ATIMISC_DRI_SRCS) $(ATIMISC_DGA_SOURCES) \
- $(ATIMISC_CPIO_SOURCES)
+ atiprobe.c atividmem.c atiaccel.c atiadjust.c atiaudio.c \
+ aticlock.c aticonfig.c aticonsole.c aticursor.c atidac.c \
+ atidecoder.c atidsp.c atifillin.c atii2c.c atilock.c \
+ atimach64.c atimach64accel.c atimach64cursor.c atimach64i2c.c \
+ atimach64io.c atimach64xv.c atimode.c atipreinit.c atiprint.c \
+ atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \
+ atixv.c atiload.c atimodule.c $(ATIMISC_DRI_SRCS) \
+ $(ATIMISC_DGA_SOURCES) $(ATI_CPIO_SOURCES)
EXTRA_DIST = \
atiaccel.h \
@@ -93,7 +87,6 @@ EXTRA_DIST = \
atimach64io.h \
atimach64xv.h \
atimode.h \
- atimodule.h \
atimono.h \
atioption.h \
atipreinit.h \
@@ -114,7 +107,6 @@ EXTRA_DIST = \
atiwonder.h \
atiwonderio.h \
atixv.h \
- generic_bus.h \
mach64_common.h \
mach64_dri.h \
mach64_sarea.h
diff --git a/src/atiload.c b/src/atiload.c
index 7c901f6..bd1a403 100644
--- a/src/atiload.c
+++ b/src/atiload.c
@@ -36,142 +36,6 @@
#include "atistruct.h"
/*
- * All symbol lists belong here. They are externalised so that they can be
- * referenced elsewhere. Note the naming convention for these things...
- */
-
-const char *ATIint10Symbols[] =
-{
- "xf86FreeInt10",
- "xf86InitInt10",
- "xf86int10Addr",
- NULL
-};
-
-const char *ATIddcSymbols[] =
-{
- "xf86PrintEDID",
- "xf86SetDDCproperties",
- NULL
-};
-
-const char *ATIvbeSymbols[] =
-{
- "VBEInit",
- "vbeDoEDID",
- "vbeFree",
- NULL
-};
-
-#ifndef AVOID_CPIO
-
-const char *ATIxf1bppSymbols[] =
-{
- "xf1bppScreenInit",
- NULL
-};
-
-const char *ATIxf4bppSymbols[] =
-{
- "xf4bppScreenInit",
- NULL
-};
-
-#endif /* AVOID_CPIO */
-
-#ifdef XF86DRI_DEVEL
-
-const char *ATIdrmSymbols[] = {
- "drmAddBufs",
- "drmAddMap",
- "drmAgpAcquire",
- "drmAgpAlloc",
- "drmAgpBase",
- "drmAgpBind",
- "drmAgpDeviceId",
- "drmAgpEnable",
- "drmAgpFree",
- "drmAgpGetMode",
- "drmAgpRelease",
- "drmAgpUnbind",
- "drmAgpVendorId",
- "drmAvailable",
- "drmCommandNone",
- "drmCommandRead",
- "drmCommandWrite",
- "drmCommandWriteRead",
- "drmCtlInstHandler",
- "drmCtlUninstHandler",
- "drmFreeVersion",
- "drmGetInterruptFromBusID",
- "drmGetLibVersion",
- "drmGetVersion",
- "drmMap",
- "drmMapBufs",
- "drmDMA",
- "drmUnmap",
- "drmUnmapBufs",
- NULL
-};
-
-const char *ATIdriSymbols[] = {
- "DRICloseScreen",
- "DRICreateInfoRec",
- "DRIDestroyInfoRec",
- "DRIFinishScreenInit",
- "DRIGetSAREAPrivate",
- "DRILock",
- "DRIQueryVersion",
- "DRIScreenInit",
- "DRIUnlock",
- "GlxSetVisualConfigs",
- "DRICreatePCIBusID",
- NULL
-};
-
-#endif /* XF86DRI_DEVEL */
-
-const char *ATIfbSymbols[] =
-{
- "fbPictureInit",
- "fbScreenInit",
- NULL
-};
-
-const char *ATIshadowfbSymbols[] =
-{
- "ShadowFBInit",
- NULL
-};
-
-const char *ATIxaaSymbols[] =
-{
- "XAACreateInfoRec",
- "XAADestroyInfoRec",
- "XAAInit",
- NULL
-};
-
-const char *ATIramdacSymbols[] =
-{
- "xf86CreateCursorInfoRec",
- "xf86DestroyCursorInfoRec",
- "xf86InitCursor",
- NULL
-};
-
-const char *ATIi2cSymbols[] =
-{
- "xf86CreateI2CBusRec",
- "xf86DestroyI2CBusRec",
- "xf86I2CBusInit",
- "xf86I2CDevInit",
- "xf86I2CFindDev",
- "xf86I2CGetScreenBuses",
- NULL
-};
-
-/*
* ATILoadModule --
*
* Load a specific module and register with the loader those of its entry
diff --git a/src/atimisc.c b/src/atimisc.c
deleted file mode 100644
index de118c0..0000000
--- a/src/atimisc.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c,v 1.8tsi Exp $ */
-/*
- * Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * 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 Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE 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.
- *
- * DRI support by:
- * Leif Delgass <ldelgass@retinalburn.net>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef XFree86LOADER
-
-#include "ati.h"
-#include "atiload.h"
-#include "ativersion.h"
-
-/* Module loader interface for subsidiary driver module */
-
-static XF86ModuleVersionInfo ATIVersionRec =
-{
- "atimisc",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- ATI_VERSION_MAJOR, ATI_VERSION_MINOR, ATI_VERSION_PATCH,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_VIDEODRV,
- {0, 0, 0, 0}
-};
-
-/*
- * ATISetup --
- *
- * This function is called every time the module is loaded.
- */
-static pointer
-ATISetup
-(
- pointer Module,
- pointer Options,
- int *ErrorMajor,
- int *ErrorMinor
-)
-{
- static Bool Inited = FALSE;
-
- if (!Inited)
- {
- /* Ensure main driver module is loaded, but not as a submodule */
- if (!xf86ServerIsOnlyDetecting())
- {
- if (!LoaderSymbol(ATI_NAME))
- xf86LoadOneModule(ATI_DRIVER_NAME, Options);
-
- /* ati & atimisc module versions must match */
- do
- {
- XF86ModuleData *pModuleData = LoaderSymbol("atiModuleData");
-
- if (pModuleData)
- {
- XF86ModuleVersionInfo *pModuleInfo = pModuleData->vers;
-
- if ((pModuleInfo->majorversion == ATI_VERSION_MAJOR) &&
- (pModuleInfo->minorversion == ATI_VERSION_MINOR) &&
- (pModuleInfo->patchlevel == ATI_VERSION_PATCH))
- break;
- }
-
- xf86Msg(X_ERROR,
- "\"ati\" and \"atimisc\" module versions must"
- " match.\n");
-
- if (ErrorMajor)
- *ErrorMajor = (int)LDR_MISMATCH;
- if (ErrorMinor)
- *ErrorMinor = (int)LDR_MISMATCH;
-
- return NULL;
- } while (0);
- }
-
- /*
- * Tell loader about symbols from other modules that this module might
- * refer to.
- */
- xf86LoaderRefSymLists(
- ATIint10Symbols,
- ATIddcSymbols,
- ATIvbeSymbols,
-
-#ifndef AVOID_CPIO
-
- ATIxf1bppSymbols,
- ATIxf4bppSymbols,
-
-#endif /* AVOID_CPIO */
-
-#ifdef XF86DRI_DEVEL
-
- ATIdrmSymbols,
- ATIdriSymbols,
-
-#endif /* XF86DRI_DEVEL */
-
- ATIfbSymbols,
- ATIshadowfbSymbols,
- ATIxaaSymbols,
- ATIramdacSymbols,
- ATIi2cSymbols,
- NULL);
-
- Inited = TRUE;
- }
-
- return (pointer)TRUE;
-}
-
-/* The following record must be called atimiscModuleData */
-_X_EXPORT XF86ModuleData atimiscModuleData =
-{
- &ATIVersionRec,
- ATISetup,
- NULL
-};
-
-#endif /* XFree86LOADER */
diff --git a/src/atimodule.c b/src/atimodule.c
index e86101f..c434efa 100644
--- a/src/atimodule.c
+++ b/src/atimodule.c
@@ -28,24 +28,11 @@
#ifdef XFree86LOADER
#include "ati.h"
-#include "atimodule.h"
#include "ativersion.h"
-/* Module loader interface */
-
-const char *ATISymbols[] =
-{
- "ATIPreInit",
- "ATIScreenInit",
- "ATISwitchMode",
- "ATIAdjustFrame",
- "ATIEnterVT",
- "ATILeaveVT",
- "ATIFreeScreen",
- "ATIValidMode",
- "ATIFillInScreenInfo",
- NULL
-};
+/*
+ * Module loader interface
+ */
static XF86ModuleVersionInfo ATIVersionRec =
{
@@ -62,33 +49,191 @@ static XF86ModuleVersionInfo ATIVersionRec =
};
/*
+ * All symbol lists belong here. They are externalised so that they can be
+ * referenced elsewhere. Note the naming convention for these things...
+ */
+
+const char *ATIint10Symbols[] =
+{
+ "xf86FreeInt10",
+ "xf86InitInt10",
+ "xf86int10Addr",
+ NULL
+};
+
+const char *ATIddcSymbols[] =
+{
+ "xf86PrintEDID",
+ "xf86SetDDCproperties",
+ NULL
+};
+
+const char *ATIvbeSymbols[] =
+{
+ "VBEInit",
+ "vbeDoEDID",
+ "vbeFree",
+ NULL
+};
+
+#ifndef AVOID_CPIO
+
+const char *ATIxf1bppSymbols[] =
+{
+ "xf1bppScreenInit",
+ NULL
+};
+
+const char *ATIxf4bppSymbols[] =
+{
+ "xf4bppScreenInit",
+ NULL
+};
+
+#endif /* AVOID_CPIO */
+
+#ifdef XF86DRI_DEVEL
+
+const char *ATIdrmSymbols[] = {
+ "drmAddBufs",
+ "drmAddMap",
+ "drmAgpAcquire",
+ "drmAgpAlloc",
+ "drmAgpBase",
+ "drmAgpBind",
+ "drmAgpDeviceId",
+ "drmAgpEnable",
+ "drmAgpFree",
+ "drmAgpGetMode",
+ "drmAgpRelease",
+ "drmAgpUnbind",
+ "drmAgpVendorId",
+ "drmAvailable",
+ "drmCommandNone",
+ "drmCommandRead",
+ "drmCommandWrite",
+ "drmCommandWriteRead",
+ "drmCtlInstHandler",
+ "drmCtlUninstHandler",
+ "drmFreeVersion",
+ "drmGetInterruptFromBusID",
+ "drmGetLibVersion",
+ "drmGetVersion",
+ "drmMap",
+ "drmMapBufs",
+ "drmDMA",
+ "drmUnmap",
+ "drmUnmapBufs",
+ NULL
+};
+
+const char *ATIdriSymbols[] = {
+ "DRICloseScreen",
+ "DRICreateInfoRec",
+ "DRIDestroyInfoRec",
+ "DRIFinishScreenInit",
+ "DRIGetSAREAPrivate",
+ "DRILock",
+ "DRIQueryVersion",
+ "DRIScreenInit",
+ "DRIUnlock",
+ "GlxSetVisualConfigs",
+ "DRICreatePCIBusID",
+ NULL
+};
+
+#endif /* XF86DRI_DEVEL */
+
+const char *ATIfbSymbols[] =
+{
+ "fbPictureInit",
+ "fbScreenInit",
+ NULL
+};
+
+const char *ATIshadowfbSymbols[] =
+{
+ "ShadowFBInit",
+ NULL
+};
+
+const char *ATIxaaSymbols[] =
+{
+ "XAACreateInfoRec",
+ "XAADestroyInfoRec",
+ "XAAInit",
+ NULL
+};
+
+const char *ATIramdacSymbols[] =
+{
+ "xf86CreateCursorInfoRec",
+ "xf86DestroyCursorInfoRec",
+ "xf86InitCursor",
+ NULL
+};
+
+const char *ATIi2cSymbols[] =
+{
+ "xf86CreateI2CBusRec",
+ "xf86DestroyI2CBusRec",
+ "xf86I2CBusInit",
+ "xf86I2CDevInit",
+ "xf86I2CFindDev",
+ "xf86I2CGetScreenBuses",
+ NULL
+};
+
+/*
* ATISetup --
*
* This function is called every time the module is loaded.
*/
static pointer
-ATISetup
-(
- pointer Module,
- pointer Options,
- int *ErrorMajor,
- int *ErrorMinor
-)
+ATISetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
{
static Bool Inited = FALSE;
- if (!Inited)
- {
+ if (!Inited) {
Inited = TRUE;
+
xf86AddDriver(&ATI, Module, 0);
+
+ /*
+ * Tell loader about symbols from other modules that this module might
+ * refer to.
+ */
+ xf86LoaderRefSymLists(ATIint10Symbols,
+ ATIddcSymbols,
+ ATIvbeSymbols,
+#ifndef AVOID_CPIO
+ ATIxf1bppSymbols,
+ ATIxf4bppSymbols,
+#endif /* AVOID_CPIO */
- xf86LoaderRefSymLists(ATISymbols, NULL);
- }
+#ifdef XF86DRI_DEVEL
+ ATIdrmSymbols,
+ ATIdriSymbols,
+#endif /* XF86DRI_DEVEL */
+ ATIfbSymbols,
+ ATIshadowfbSymbols,
+ ATIxaaSymbols,
+ ATIramdacSymbols,
+ ATIi2cSymbols,
+ NULL );
- return (pointer)1;
+ return (pointer) TRUE;
+ } else {
+ if (ErrorMajor)
+ *ErrorMajor = LDR_ONCEONLY;
+ return NULL;
+ }
}
-/* The following record must be called atiModuleData */
+
+/*
+ * The following record must be called atiModuleData
+ */
_X_EXPORT XF86ModuleData atiModuleData =
{
&ATIVersionRec,
diff --git a/src/atimodule.h b/src/atimodule.h
deleted file mode 100644
index e1b1f84..0000000
--- a/src/atimodule.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.9 2003/01/01 19:16:32 tsi Exp $ */
-/*
- * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * 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 Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE 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.
- */
-
-#if defined(XFree86LOADER) && !defined(___ATIMODULE_H___)
-#define ___ATIMODULE_H___ 1
-
-extern const char *ATISymbols[];
-
-#endif /* ___ATIMODULE_H___ */
diff --git a/src/atiprobe.c b/src/atiprobe.c
index 6dce63d..3ad397f 100644
--- a/src/atiprobe.c
+++ b/src/atiprobe.c
@@ -34,7 +34,6 @@
#include "atifillin.h"
#include "atiident.h"
#include "atimach64io.h"
-#include "atimodule.h"
#include "atipreinit.h"
#include "atiprobe.h"
#include "atiscreen.h"
@@ -1926,20 +1925,6 @@ NoVGAWonder:;
/* Allocate screen */
pScreenInfo = xf86AllocateScreen(pDriver, 0);
-#ifdef XFree86LOADER
-
- if (!xf86LoadSubModule(pScreenInfo, "atimisc"))
- {
- xf86Msg(X_ERROR,
- ATI_NAME ": Failed to load \"atimisc\" module.\n");
- xf86DeleteScreen(pScreenInfo->scrnIndex, 0);
- continue;
- }
-
- xf86LoaderReqSymLists(ATISymbols, NULL);
-
-#endif
-
/* Attach device to screen */
xf86AddEntityToScreen(pScreenInfo, pATI->iEntity);