summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-04-20 03:27:09 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-04-20 03:27:09 +0000
commit102cb14a5d91bf074bed4c261d02434a32bf17dd (patch)
tree6f2faa0bdc0ba67900af7dac4f7aef1052e06f61
parent0d0097350fbbe12b434f625004f2fe9ed4091ee7 (diff)
Fix for http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=491XPRINT
- RFE: Need workaround for bug 467 ("Xfree86 smart scheduler breaks Xprt")
-rw-r--r--Xprint/Init.c30
-rw-r--r--Xprint/ddxInit.c6
-rw-r--r--dix/dispatch.c9
-rw-r--r--dix/main.c4
-rw-r--r--hw/darwin/darwin.c6
-rw-r--r--hw/vfb/InitOutput.c5
-rw-r--r--hw/xfree86/common/xf86Init.c5
-rw-r--r--hw/xnest/Args.c5
-rw-r--r--hw/xwin/InitOutput.c5
-rw-r--r--include/os.h4
-rw-r--r--os/utils.c13
11 files changed, 81 insertions, 11 deletions
diff --git a/Xprint/Init.c b/Xprint/Init.c
index 43647f187..d773ccf62 100644
--- a/Xprint/Init.c
+++ b/Xprint/Init.c
@@ -287,6 +287,24 @@ static char *configFileName = (char *)NULL;
static Bool freeDefaultFontPath = FALSE;
static char *origFontPath = (char *)NULL;
+static Bool xprintInitGlobalsCalled = FALSE;
+/*
+ * This function is responsible for doing initalisation of any global
+ * variables at an very early point of server startup (even before
+ * |ProcessCommandLine()|.
+ */
+void XprintInitGlobals(void)
+{
+ xprintInitGlobalsCalled = TRUE;
+
+#ifdef SMART_SCHEDULE
+ /* Somehow the XF86 "smart scheduler" completely kills the Xprint DDX
+ * (see http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=467
+ * ("Xfree86's "smart scheduler" breaks Xprt") */
+ SmartScheduleDisable = TRUE;
+#endif /* SMART_SCHEDULE */
+}
+
/*
* XprintUseMsg() prints usage for the Xprint-specific options
*/
@@ -1272,6 +1290,18 @@ PrinterInitOutput(
char **driverNames;
char *configDir;
+ /* This should NEVER happen, but... */
+ if( !xprintInitGlobalsCalled )
+ {
+ FatalError("Internal error: XprintInitGlobals() not called.");
+ }
+#ifdef SMART_SCHEDULE
+ if( SmartScheduleDisable != TRUE )
+ {
+ FatalError("Internal error: XF86 smart scheduler incompatible to Xprint DDX.");
+ }
+#endif /* SMART_SCHEDULE */
+
/*
* this little test is just a warning at startup to make sure
* that the config directory exists.
diff --git a/Xprint/ddxInit.c b/Xprint/ddxInit.c
index ee170c7a2..55b73ea0b 100644
--- a/Xprint/ddxInit.c
+++ b/Xprint/ddxInit.c
@@ -229,6 +229,12 @@ GetTimeInMillis(void)
}
#endif
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+ XprintInitGlobals();
+}
+
/****************************************
* ddxUseMsg()
*
diff --git a/dix/dispatch.c b/dix/dispatch.c
index fc8715c03..96d636d35 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.1.4.4.2.3 2004/03/08 00:36:56 alanc Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.1.4.4.2.3.6.1 2004/04/17 02:34:47 gisburn Exp $ */
/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */
/************************************************************
@@ -253,14 +253,7 @@ FlushClientCaches(id)
#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */
#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */
-#ifdef XPRINT
-/* Somehow the XF86 "smart scheduler" completely kills the Xprint DDX
- * (see http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=467
- * ("Xfree86's "smart scheduler" breaks Xprt") */
-Bool SmartScheduleDisable = TRUE;
-#else
Bool SmartScheduleDisable = FALSE;
-#endif /* XPRINT */
long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE;
diff --git a/dix/main.c b/dix/main.c
index b7aba1d8c..c327efec5 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 1.1.4.5.2.3 2004/03/04 20:16:04 kaleb Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 1.1.4.5.2.4 2004/03/08 00:36:56 alanc Exp $ */
/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.43 2003/10/30 21:21:02 herrb Exp $ */
/***********************************************************
@@ -251,6 +251,8 @@ main(int argc, char *argv[], char *envp[])
display = "0";
+ InitGlobals();
+
/* Quartz support on Mac OS X requires that the Cocoa event loop be in
* the main thread. This allows the X server main to be called again
* from another thread. */
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
index 4f1213968..3713b6e8d 100644
--- a/hw/darwin/darwin.c
+++ b/hw/darwin/darwin.c
@@ -29,7 +29,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.1.4.2.4.2 2004/04/02 21:47:13 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.1.4.2.4.1.6.2 2004/04/12 12:20:59 gisburn Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */
#include "X.h"
@@ -697,6 +697,10 @@ void OsVendorInit(void)
}
}
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
/*
* ddxProcessArgument --
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 59283bdf3..562dd611e 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -273,6 +273,11 @@ ddxUseMsg()
#endif
}
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
int
ddxProcessArgument(int argc, char *argv[], int i)
{
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 079abefd9..410a46e7c 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1295,6 +1295,11 @@ xf86SetLogVerbosity(int verb)
return save;
}
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
/*
* ddxProcessArgument --
* Process device-dependent command line args. Returns 0 if argument is
diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c
index 0da0d5006..cc9a2707f 100644
--- a/hw/xnest/Args.c
+++ b/hw/xnest/Args.c
@@ -47,6 +47,11 @@ int xnestNumScreens = 0;
Bool xnestDoDirectColormaps = False;
Window xnestParentWindow = 0;
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
int
ddxProcessArgument (int argc, char *argv[], int i)
{
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 8a2241914..68910be1a 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -394,6 +394,11 @@ ddxUseMsg (void)
/* Compare the current option with the string. */
#define IS_OPTION(name) (strcmp (argv[i], name) == 0)
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
int
ddxProcessArgument (int argc, char *argv[], int i)
{
diff --git a/include/os.h b/include/os.h
index d82652c2d..b553e06e1 100644
--- a/include/os.h
+++ b/include/os.h
@@ -231,6 +231,8 @@ extern SIGVAL GiveUp(int /*sig*/);
extern void UseMsg(void);
+extern void InitGlobals(void);
+
extern void ProcessCommandLine(int /*argc*/, char* /*argv*/[]);
extern int set_font_authorizations(
@@ -412,6 +414,8 @@ extern XID GenerateAuthorization(
extern void ExpandCommandLine(int * /*pargc*/, char *** /*pargv*/);
#endif
+extern void ddxInitGlobals(void);
+
extern int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /*i*/);
extern void ddxUseMsg(void);
diff --git a/os/utils.c b/os/utils.c
index 7724b0cfe..742dc9cb1 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/os/utils.c,v 1.1.4.6.2.5 2004/03/24 01:09:51 alanc Exp $ */
+/* $XdotOrg: xc/programs/Xserver/os/utils.c,v 1.1.4.6.2.4.6.2 2004/04/12 12:21:07 gisburn Exp $ */
/* $Xorg: utils.c,v 1.5 2001/02/09 02:05:24 xorgcvs Exp $ */
/*
@@ -576,6 +576,17 @@ VerifyDisplayName(const char *d)
}
/*
+ * This function is responsible for doing initalisation of any global
+ * variables at an very early point of server startup (even before
+ * |ProcessCommandLine()|.
+ */
+void InitGlobals(void)
+{
+ ddxInitGlobals();
+}
+
+
+/*
* This function parses the command line. Handles device-independent fields
* and allows ddx to handle additional fields. It is not allowed to modify
* argc or any of the strings pointed to by argv.