aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Helper.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/hw/xfree86/common/xf86Helper.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Helper.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Helper.c426
1 files changed, 143 insertions, 283 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c
index 00df10574..9a2468dd3 100644
--- a/xorg-server/hw/xfree86/common/xf86Helper.c
+++ b/xorg-server/hw/xfree86/common/xf86Helper.c
@@ -53,13 +53,12 @@
#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "micmap.h"
-#include "xf86PciInfo.h"
#include "xf86DDC.h"
#include "xf86Xinput.h"
#include "xf86InPriv.h"
#include "mivalidate.h"
-#include "xf86RAC.h"
#include "xf86Bus.h"
+#include "xf86Crtc.h"
/* For xf86GetClocks */
#if defined(CSRG_BASED) || defined(__GNU__)
@@ -72,7 +71,7 @@ static int xf86ScrnInfoPrivateCount = 0;
/* Add a pointer to a new DriverRec to xf86DriverList */
-_X_EXPORT void
+void
xf86AddDriver(DriverPtr driver, pointer module, int flags)
{
/* Don't add null entries */
@@ -99,7 +98,7 @@ xf86AddDriver(DriverPtr driver, pointer module, int flags)
xf86DriverList[xf86NumDrivers - 1]->refCount = 0;
}
-_X_EXPORT void
+void
xf86DeleteDriver(int drvIndex)
{
if (xf86DriverList[drvIndex]
@@ -113,7 +112,7 @@ xf86DeleteDriver(int drvIndex)
/* Add a pointer to a new InputDriverRec to xf86InputDriverList */
-_X_EXPORT void
+void
xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags)
{
/* Don't add null entries */
@@ -168,20 +167,9 @@ xf86LookupInput(const char *name)
return NULL;
}
-/* ABI stubs of despair */
-_X_EXPORT void
-xf86AddModuleInfo(pointer info, pointer module)
-{
-}
-
-_X_EXPORT void
-xf86DeleteModuleInfo(int idx)
-{
-}
-
/* Allocate a new ScrnInfoRec in xf86Screens */
-_X_EXPORT ScrnInfoPtr
+ScrnInfoPtr
xf86AllocateScreen(DriverPtr drv, int flags)
{
int i;
@@ -204,22 +192,6 @@ xf86AllocateScreen(DriverPtr drv, int flags)
xf86Screens[i]->drv = drv;
drv->refCount++;
xf86Screens[i]->module = DuplicateModule(drv->module, NULL);
- /*
- * set the initial access state. This will be modified after PreInit.
- * XXX Or should we do it some other place?
- */
- xf86Screens[i]->CurrentAccess = &xf86CurrentAccess;
- xf86Screens[i]->resourceType = MEM_IO;
-
-#ifdef DEBUG
- /* OOps -- What's this ? */
- ErrorF("xf86AllocateScreen - xf86Screens[%d]->pScreen = %p\n",
- i, xf86Screens[i]->pScreen );
- if ( NULL != xf86Screens[i]->pScreen ) {
- ErrorF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
- i, xf86Screens[i]->pScreen->CreateWindow );
- }
-#endif
xf86Screens[i]->DriverFunc = drv->driverFunc;
@@ -232,7 +204,7 @@ xf86AllocateScreen(DriverPtr drv, int flags)
* data. To do this properly may require a driver hook.
*/
-_X_EXPORT void
+void
xf86DeleteScreen(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn;
@@ -288,7 +260,7 @@ xf86DeleteScreen(int scrnIndex, int flags)
* Allocate a private in ScrnInfoRec.
*/
-_X_EXPORT int
+int
xf86AllocateScrnInfoPrivateIndex(void)
{
int idx, i;
@@ -308,7 +280,7 @@ xf86AllocateScrnInfoPrivateIndex(void)
}
/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
-_X_EXPORT InputInfoPtr
+InputInfoPtr
xf86AllocateInput(InputDriverPtr drv, int flags)
{
InputInfoPtr new, *prev = NULL;
@@ -335,7 +307,7 @@ xf86AllocateInput(InputDriverPtr drv, int flags)
* data. To do this properly may require a driver hook.
*/
-_X_EXPORT void
+void
xf86DeleteInput(InputInfoPtr pInp, int flags)
{
InputInfoPtr p;
@@ -376,7 +348,7 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
xfree(pInp);
}
-_X_EXPORT Bool
+Bool
xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
{
int i;
@@ -447,7 +419,7 @@ xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
#define GLOBAL_DEFAULT_DEPTH 24
#endif
-_X_EXPORT Bool
+Bool
xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
int depth24flags)
{
@@ -764,7 +736,7 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
/*
* Print out the selected depth and bpp.
*/
-_X_EXPORT void
+void
xf86PrintDepthBpp(ScrnInfoPtr scrp)
{
xf86DrvMsg(scrp->scrnIndex, scrp->depthFrom, "Depth %d, ", scrp->depth);
@@ -775,7 +747,7 @@ xf86PrintDepthBpp(ScrnInfoPtr scrp)
* xf86SetWeight sets scrp->weight, scrp->mask, scrp->offset, and for depths
* greater than MAX_PSEUDO_DEPTH also scrp->rgbBits.
*/
-_X_EXPORT Bool
+Bool
xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
{
MessageType weightFrom = X_DEFAULT;
@@ -867,7 +839,7 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
return TRUE;
}
-_X_EXPORT Bool
+Bool
xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)
{
MessageType visualFrom = X_DEFAULT;
@@ -914,7 +886,7 @@ xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)
#define SET_GAMMA(g) \
(g) > GAMMA_ZERO ? (g) : 1.0
-_X_EXPORT Bool
+Bool
xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
{
MessageType from = X_DEFAULT;
@@ -949,6 +921,11 @@ xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
scrp->gamma.green = 1.0;
scrp->gamma.blue = 1.0;
}
+ /* Pretend we succeeded if we support better a gamma system.
+ * This avoids a confusing message.
+ */
+ if (xf86_crtc_supports_gamma(scrp))
+ return TRUE;
xf86DrvMsg(scrp->scrnIndex, from,
"Using gamma correction (%.1f, %.1f, %.1f)\n",
scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue);
@@ -968,7 +945,7 @@ xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
#undef MMPERINCH
#define MMPERINCH 25.4
-_X_EXPORT void
+void
xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
{
MessageType from = X_DEFAULT;
@@ -1065,7 +1042,7 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
#undef MMPERINCH
-_X_EXPORT void
+void
xf86SetBlackWhitePixels(ScreenPtr pScreen)
{
if (xf86FlipPixels) {
@@ -1196,7 +1173,7 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
* whether they are switched in or out by keeping track of the root pixmap's
* private data, and therefore don't need to access pScrnInfo->vtSema.
*/
-_X_EXPORT void
+void
xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
{
ScrnInfoPtr pScrnInfo = xf86Screens[scrnIndex];
@@ -1238,7 +1215,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
#undef PREFIX_SIZE
#define PREFIX_SIZE 14
-_X_EXPORT void
+void
xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
va_list args)
{
@@ -1265,7 +1242,7 @@ xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
#undef PREFIX_SIZE
/* Print driver messages, with verbose level specified directly */
-_X_EXPORT void
+void
xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
...)
{
@@ -1277,7 +1254,7 @@ xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
}
/* Print driver messages, with verbose level of 1 (default) */
-_X_EXPORT void
+void
xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
{
va_list ap;
@@ -1288,7 +1265,7 @@ xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
}
/* Print non-driver messages with verbose level specified directly */
-_X_EXPORT void
+void
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
{
va_list ap;
@@ -1299,7 +1276,7 @@ xf86MsgVerb(MessageType type, int verb, const char *format, ...)
}
/* Print non-driver messages with verbose level of 1 (default) */
-_X_EXPORT void
+void
xf86Msg(MessageType type, const char *format, ...)
{
va_list ap;
@@ -1310,7 +1287,7 @@ xf86Msg(MessageType type, const char *format, ...)
}
/* Just like ErrorF, but with the verbose level checked */
-_X_EXPORT void
+void
xf86ErrorFVerb(int verb, const char *format, ...)
{
va_list ap;
@@ -1322,7 +1299,7 @@ xf86ErrorFVerb(int verb, const char *format, ...)
}
/* Like xf86ErrorFVerb, but with an implied verbose level of 1 */
-_X_EXPORT void
+void
xf86ErrorF(const char *format, ...)
{
va_list ap;
@@ -1335,7 +1312,7 @@ xf86ErrorF(const char *format, ...)
void
-xf86LogInit()
+xf86LogInit(void)
{
char *lf = NULL;
@@ -1366,7 +1343,7 @@ xf86LogInit()
}
void
-xf86CloseLog()
+xf86CloseLog(void)
{
LogClose();
}
@@ -1376,7 +1353,7 @@ xf86CloseLog()
* Drivers can use these for using their own SymTabRecs.
*/
-_X_EXPORT const char *
+const char *
xf86TokenToString(SymTabPtr table, int token)
{
int i;
@@ -1390,7 +1367,7 @@ xf86TokenToString(SymTabPtr table, int token)
return(table[i].name);
}
-_X_EXPORT int
+int
xf86StringToToken(SymTabPtr table, const char *string)
{
int i;
@@ -1407,7 +1384,7 @@ xf86StringToToken(SymTabPtr table, const char *string)
/*
* helper to display the clocks found on a card
*/
-_X_EXPORT void
+void
xf86ShowClocks(ScrnInfoPtr scrp, MessageType from)
{
int j;
@@ -1431,7 +1408,7 @@ xf86ShowClocks(ScrnInfoPtr scrp, MessageType from)
* XXX This makes assumptions about the line width, etc. Maybe we could
* use a more general "pretty print" function for messages.
*/
-_X_EXPORT void
+void
xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips)
{
int len, i;
@@ -1457,7 +1434,7 @@ xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips)
}
-_X_EXPORT int
+int
xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
{
GDevPtr gdp, *pgdp = NULL;
@@ -1467,10 +1444,6 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
if (sectlist)
*sectlist = NULL;
- if (xf86DoModalias) return 0;
-
- if (xf86DoProbe) return 1;
-
if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
/*
@@ -1590,7 +1563,7 @@ struct Inst {
* \c DriverRec::driverName. In a future version of this function, remove
* that parameter.
*/
-_X_EXPORT int
+int
xf86MatchPciInstances(const char *driverName, int vendorID,
SymTabPtr chipsets, PciChipsets *PCIchipsets,
GDevPtr *devList, int numDevs, DriverPtr drvp,
@@ -1616,7 +1589,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
* Do this calculation and memory allocation once now to eliminate the
* need for realloc calls inside the loop.
*/
- if ( !xf86DoProbe && !(xf86DoConfigure && xf86DoConfigurePass1) ) {
+ if (!(xf86DoConfigure && xf86DoConfigurePass1)) {
unsigned max_entries = numDevs;
iter = pci_slot_match_iterator_create(NULL);
@@ -1729,9 +1702,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
}
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
-#endif
+ DebugF("%s instances found: %d\n", driverName, allocatedInstances);
/*
* Check for devices that need duplicated instances. This is required
@@ -1814,9 +1785,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
instances[i].dev = dev;
}
}
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
-#endif
+ DebugF("%s instances found: %d\n", driverName, numClaimedInstances);
/*
* Now check that a chipset or chipID override in the device section
* is valid. Chipset has precedence over chipID.
@@ -1920,11 +1889,9 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (instances[i].screen == 0 && !xf86CheckPciSlot( pPci ))
continue;
-#ifdef DEBUG
- ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
+ DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
driverName, pPci->bus, pPci->dev, pPci->func);
-#endif
-
+
/* Allocate an entry in the lists to be returned */
numFound++;
retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
@@ -1956,7 +1923,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
/*
* xf86GetClocks -- get the dot-clocks via a BIG BAD hack ...
*/
-_X_EXPORT void
+void
xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
void (*ProtectRegs)(ScrnInfoPtr, Bool),
void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
@@ -1968,8 +1935,6 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
/* First save registers that get written on */
(*ClockFunc)(pScrn, CLK_REG_SAVE);
- xf86SetPriority(TRUE);
-
if (num > MAXCLOCKS)
num = MAXCLOCKS;
@@ -2017,8 +1982,6 @@ finish:
(*BlankScreen)(pScrn, TRUE);
}
- xf86SetPriority(FALSE);
-
for (i = 0; i < num; i++)
{
if (i != knownclkindex)
@@ -2047,31 +2010,7 @@ finish:
(*ClockFunc)(pScrn, CLK_REG_RESTORE);
}
-_X_EXPORT void
-xf86SetPriority(Bool up)
-{
- static int saved_nice;
-
- if (up) {
-#ifdef HAS_SETPRIORITY
- saved_nice = getpriority(PRIO_PROCESS, 0);
- setpriority(PRIO_PROCESS, 0, -20);
-#endif
-#if defined(SYSV) || defined(SVR4) || defined(linux)
- saved_nice = nice(0);
- nice(-20 - saved_nice);
-#endif
- } else {
-#ifdef HAS_SETPRIORITY
- setpriority(PRIO_PROCESS, 0, saved_nice);
-#endif
-#if defined(SYSV) || defined(SVR4) || defined(linux)
- nice(20 + saved_nice);
-#endif
- }
-}
-
-_X_EXPORT const char *
+const char *
xf86GetVisualName(int visual)
{
if (visual < 0 || visual > DirectColor)
@@ -2081,132 +2020,125 @@ xf86GetVisualName(int visual)
}
-_X_EXPORT int
-xf86GetVerbosity()
+int
+xf86GetVerbosity(void)
{
return max(xf86Verbose, xf86LogVerbose);
}
-_X_EXPORT Pix24Flags
-xf86GetPix24()
+Pix24Flags
+xf86GetPix24(void)
{
return xf86Info.pixmap24;
}
-_X_EXPORT int
-xf86GetDepth()
+int
+xf86GetDepth(void)
{
return xf86Depth;
}
-_X_EXPORT rgb
-xf86GetWeight()
+rgb
+xf86GetWeight(void)
{
return xf86Weight;
}
-_X_EXPORT Gamma
-xf86GetGamma()
+Gamma
+xf86GetGamma(void)
{
return xf86Gamma;
}
-_X_EXPORT Bool
-xf86GetFlipPixels()
+Bool
+xf86GetFlipPixels(void)
{
return xf86FlipPixels;
}
-_X_EXPORT const char *
-xf86GetServerName()
+const char *
+xf86GetServerName(void)
{
return xf86ServerName;
}
-_X_EXPORT Bool
-xf86ServerIsExiting()
+Bool
+xf86ServerIsExiting(void)
{
return (dispatchException & DE_TERMINATE) == DE_TERMINATE;
}
-_X_EXPORT Bool
-xf86ServerIsResetting()
+Bool
+xf86ServerIsResetting(void)
{
return xf86Resetting;
}
Bool
-xf86ServerIsInitialising()
+xf86ServerIsInitialising(void)
{
return xf86Initialising;
}
-_X_EXPORT Bool
+Bool
xf86ServerIsOnlyDetecting(void)
{
- return xf86DoProbe || xf86DoConfigure;
-}
-
-
-_X_EXPORT Bool
-xf86ServerIsOnlyProbing(void)
-{
- return xf86ProbeOnly;
+ return xf86DoConfigure;
}
-_X_EXPORT Bool
-xf86CaughtSignal()
+Bool
+xf86CaughtSignal(void)
{
return xf86Info.caughtSignal;
}
-_X_EXPORT Bool
-xf86GetVidModeAllowNonLocal()
+Bool
+xf86GetVidModeAllowNonLocal(void)
{
return xf86Info.vidModeAllowNonLocal;
}
-_X_EXPORT Bool
-xf86GetVidModeEnabled()
+Bool
+xf86GetVidModeEnabled(void)
{
return xf86Info.vidModeEnabled;
}
-_X_EXPORT Bool
-xf86GetModInDevAllowNonLocal()
+Bool
+xf86GetModInDevAllowNonLocal(void)
{
return xf86Info.miscModInDevAllowNonLocal;
}
-_X_EXPORT Bool
-xf86GetModInDevEnabled()
+Bool
+xf86GetModInDevEnabled(void)
{
return xf86Info.miscModInDevEnabled;
}
-_X_EXPORT Bool
-xf86GetAllowMouseOpenFail()
+Bool
+xf86GetAllowMouseOpenFail(void)
{
return xf86Info.allowMouseOpenFail;
}
-_X_EXPORT Bool
-xf86IsPc98()
+Bool
+xf86IsPc98(void)
{
#ifdef __i386__
return xf86Info.pc98;
@@ -2215,20 +2147,20 @@ xf86IsPc98()
#endif
}
-_X_EXPORT void
-xf86DisableRandR()
+void
+xf86DisableRandR(void)
{
xf86Info.disableRandR = TRUE;
xf86Info.randRFrom = X_PROBED;
}
-_X_EXPORT CARD32
+CARD32
xf86GetModuleVersion(pointer module)
{
return (CARD32)LoaderGetModuleVersion(module);
}
-_X_EXPORT pointer
+pointer
xf86LoadDrvSubModule(DriverPtr drv, const char *name)
{
pointer ret;
@@ -2241,7 +2173,7 @@ xf86LoadDrvSubModule(DriverPtr drv, const char *name)
return ret;
}
-_X_EXPORT pointer
+pointer
xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)
{
pointer ret;
@@ -2257,7 +2189,7 @@ xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)
/*
* xf86LoadOneModule loads a single module.
*/
-_X_EXPORT pointer
+pointer
xf86LoadOneModule(char *name, pointer opt)
{
int errmaj, errmin;
@@ -2285,7 +2217,7 @@ xf86LoadOneModule(char *name, pointer opt)
return mod;
}
-_X_EXPORT void
+void
xf86UnloadSubModule(pointer mod)
{
/*
@@ -2297,34 +2229,12 @@ xf86UnloadSubModule(pointer mod)
#endif
}
-_X_EXPORT Bool
+Bool
xf86LoaderCheckSymbol(const char *name)
{
return LoaderSymbol(name) != NULL;
}
-/* These two are just ABI stubs, they don't do anything in dlloader world */
-_X_EXPORT void
-xf86LoaderReqSymLists(const char **list0, ...)
-{
-}
-
-_X_EXPORT void
-xf86LoaderReqSymbols(const char *sym0, ...)
-{
-}
-
-_X_EXPORT void
-xf86LoaderRefSymLists(const char **list0, ...)
-{
-}
-
-_X_EXPORT void
-xf86LoaderRefSymbols(const char *sym0, ...)
-{
-}
-
-
typedef enum {
OPTION_BACKING_STORE
} BSOpts;
@@ -2334,7 +2244,7 @@ static const OptionInfoRec BSOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-_X_EXPORT void
+void
xf86SetBackingStore(ScreenPtr pScreen)
{
Bool useBS = FALSE;
@@ -2374,7 +2284,7 @@ static const OptionInfoRec SMOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-_X_EXPORT void
+void
xf86SetSilkenMouse (ScreenPtr pScreen)
{
Bool useSM = TRUE;
@@ -2388,13 +2298,8 @@ xf86SetSilkenMouse (ScreenPtr pScreen)
/* check for commandline option here */
/* disable if screen shares resources */
- if (((pScrn->racMemFlags & RAC_CURSOR) &&
- !xf86NoSharedResources(pScrn->scrnIndex,MEM)) ||
- ((pScrn->racIoFlags & RAC_CURSOR) &&
- !xf86NoSharedResources(pScrn->scrnIndex,IO))) {
- useSM = FALSE;
- from = X_PROBED;
- } else if (xf86silkenMouseDisableFlag) {
+ /* TODO VGA arb disable silken mouse */
+ if (xf86silkenMouseDisableFlag) {
from = X_CMDLINE;
useSM = FALSE;
} else {
@@ -2415,7 +2320,7 @@ xf86SetSilkenMouse (ScreenPtr pScreen)
/* Wrote this function for the PM2 Xv driver, preliminary. */
-_X_EXPORT pointer
+pointer
xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name,
char **adaptor_name, pointer *adaptor_options)
{
@@ -2445,13 +2350,43 @@ xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name,
#include "loader/os.c"
/* new RAC */
+/*
+ * xf86ConfigPciEntityInactive() -- This function can be used
+ * to configure an inactive entity as well as to reconfigure an
+ * previously active entity inactive. If the entity has been
+ * assigned to a screen before it will be removed. If p_chip is
+ * non-NULL all static resources listed there will be registered.
+ */
+static void
+xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
+ EntityProc init, EntityProc enter,
+ EntityProc leave, pointer private)
+{
+ ScrnInfoPtr pScrn;
+
+ if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
+ xf86RemoveEntityFromScreen(pScrn,pEnt->index);
-_X_EXPORT ScrnInfoPtr
+ /* shared resources are only needed when entity is active: remove */
+ xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
+}
+
+static void
+xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer private)
+{
+ ScrnInfoPtr pScrn;
+
+ if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
+ xf86RemoveEntityFromScreen(pScrn,pEnt->index);
+ xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
+}
+
+ScrnInfoPtr
xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
- PciChipsets *p_chip, resList res, EntityProc init,
+ PciChipsets *p_chip, void *dummy, EntityProc init,
EntityProc enter, EntityProc leave, pointer private)
{
- PciChipsets *p_id;
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
if (!pEnt) return pScrn;
@@ -2461,7 +2396,7 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
return pScrn;
}
if (!pEnt->active) {
- xf86ConfigPciEntityInactive(pEnt, p_chip, res, init, enter,
+ xf86ConfigPciEntityInactive(pEnt, p_chip, init, enter,
leave, private);
xfree(pEnt);
return pScrn;
@@ -2476,21 +2411,14 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
if (xf86IsEntityShared(entityIndex)) {
return pScrn;
}
- if (p_chip) {
- for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
- if (pEnt->chipset == p_id->numChipset) break;
- }
- xf86ClaimFixedResources(p_id->resList,entityIndex);
- }
xfree(pEnt);
- xf86ClaimFixedResources(res,entityIndex);
xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
return pScrn;
}
-_X_EXPORT ScrnInfoPtr
+ScrnInfoPtr
xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
EntityProc init, EntityProc enter, EntityProc leave,
pointer private)
@@ -2520,16 +2448,15 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
/*
*
- * OBSOLETE ! xf86ConfigActivePciEntity() is an obsolete functions.
- * They the are likely to be removed. Don't use!
+ * OBSOLETE ! xf86ConfigActivePciEntity() is an obsolete function.
+ * It is likely to be removed. Don't use!
*/
-_X_EXPORT Bool
+Bool
xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
- PciChipsets *p_chip, resList res, EntityProc init,
+ PciChipsets *p_chip, void *dummy, EntityProc init,
EntityProc enter, EntityProc leave, pointer private)
{
- PciChipsets *p_id;
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
if (!pEnt) return FALSE;
@@ -2539,62 +2466,14 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
}
xf86AddEntityToScreen(pScrn,entityIndex);
- if (p_chip) {
- for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
- if (pEnt->chipset == p_id->numChipset) break;
- }
- xf86ClaimFixedResources(p_id->resList,entityIndex);
- }
xfree(pEnt);
-
- xf86ClaimFixedResources(res,entityIndex);
if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
return FALSE;
return TRUE;
}
-/*
- * xf86ConfigPciEntityInactive() -- This functions can be used
- * to configure an inactive entity as well as to reconfigure an
- * previously active entity inactive. If the entity has been
- * assigned to a screen before it will be removed. If p_pci is
- * non-NULL all static resources listed there will be registered.
- */
-_X_EXPORT void
-xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
- resList res, EntityProc init, EntityProc enter,
- EntityProc leave, pointer private)
-{
- PciChipsets *p_id;
- ScrnInfoPtr pScrn;
-
- if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
- xf86RemoveEntityFromScreen(pScrn,pEnt->index);
- else if (p_chip) {
- for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
- if (pEnt->chipset == p_id->numChipset) break;
- }
- xf86ClaimFixedResources(p_id->resList,pEnt->index);
- }
- xf86ClaimFixedResources(res,pEnt->index);
- /* shared resources are only needed when entity is active: remove */
- xf86DeallocateResourcesForEntity(pEnt->index, ResShared);
- xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
-}
-
-void
-xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- ScrnInfoPtr pScrn;
-
- if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
- xf86RemoveEntityFromScreen(pScrn,pEnt->index);
- xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
-}
-
-_X_EXPORT Bool
+Bool
xf86IsScreenPrimary(int scrnIndex)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
@@ -2607,7 +2486,7 @@ xf86IsScreenPrimary(int scrnIndex)
return FALSE;
}
-_X_EXPORT int
+int
xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
int format, unsigned long len, pointer value )
{
@@ -2615,10 +2494,8 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
int i;
Bool existing = FALSE;
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
+ DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
ScrnIndex, property, type, format, len, value);
-#endif
if (ScrnIndex<0 || ScrnIndex>=xf86NumScreens) {
return(BadMatch);
@@ -2654,15 +2531,11 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
pNewProp->size = len;
pNewProp->data = value;
-#ifdef DEBUG
- ErrorF("new property filled\n");
-#endif
+ DebugF("new property filled\n");
if (NULL==xf86RegisteredPropertiesTable) {
-#ifdef DEBUG
- ErrorF("creating xf86RegisteredPropertiesTable[] size %d\n",
+ DebugF("creating xf86RegisteredPropertiesTable[] size %d\n",
xf86NumScreens);
-#endif
if ( NULL==(xf86RegisteredPropertiesTable=(RootWinPropPtr*)xnfcalloc(sizeof(RootWinProp),xf86NumScreens) )) {
return(BadAlloc);
}
@@ -2671,12 +2544,10 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
}
}
-#ifdef DEBUG
- ErrorF("xf86RegisteredPropertiesTable %p\n",
+ DebugF("xf86RegisteredPropertiesTable %p\n",
(void *)xf86RegisteredPropertiesTable);
- ErrorF("xf86RegisteredPropertiesTable[%d] %p\n",
+ DebugF("xf86RegisteredPropertiesTable[%d] %p\n",
ScrnIndex, (void *)xf86RegisteredPropertiesTable[ScrnIndex]);
-#endif
if (!existing) {
if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) {
@@ -2684,21 +2555,17 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
} else {
pRegProp = xf86RegisteredPropertiesTable[ScrnIndex];
while (pRegProp->next != NULL) {
-#ifdef DEBUG
- ErrorF("- next %p\n", (void *)pRegProp);
-#endif
+ DebugF("- next %p\n", (void *)pRegProp);
pRegProp = pRegProp->next;
}
pRegProp->next = pNewProp;
}
}
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty succeeded\n");
-#endif
+ DebugF("xf86RegisterRootWindowProperty succeeded\n");
return(Success);
}
-_X_EXPORT Bool
+Bool
xf86IsUnblank(int mode)
{
switch(mode) {
@@ -2714,15 +2581,8 @@ xf86IsUnblank(int mode)
}
}
-_X_EXPORT void
+void
xf86MotionHistoryAllocate(LocalDevicePtr local)
{
AllocateMotionHistory(local->dev);
}
-
-_X_EXPORT int
-xf86GetMotionEvents(DeviceIntPtr pDev, xTimecoord *buff, unsigned long start,
- unsigned long stop, ScreenPtr pScreen, BOOL core)
-{
- return GetMotionHistory(pDev, buff, start, stop, pScreen, core);
-}