2003-11-14 16:54:54 +01:00
|
|
|
/***********************************************************
|
|
|
|
|
|
|
|
Copyright 1987, 1998 The Open Group
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice 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
|
|
|
|
OPEN GROUP 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.
|
|
|
|
|
|
|
|
Except as contained in this notice, the name of The Open Group shall not be
|
|
|
|
used in advertising or otherwise to promote the sale, use or other dealings
|
|
|
|
in this Software without prior written authorization from The Open Group.
|
|
|
|
|
|
|
|
|
|
|
|
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
|
|
|
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 Digital not be
|
|
|
|
used in advertising or publicity pertaining to distribution of the
|
|
|
|
software without specific, written prior permission.
|
|
|
|
|
|
|
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
|
|
DIGITAL 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.
|
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-07-16 05:49:59 +02:00
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-07-12 02:52:48 +02:00
|
|
|
#ifdef HAVE_DMX_CONFIG_H
|
|
|
|
#include <dmx-config.h>
|
2009-09-26 05:10:54 +02:00
|
|
|
#undef MULTIBUFFER
|
|
|
|
#undef XV
|
|
|
|
#undef DBE
|
|
|
|
#undef XF86VIDMODE
|
|
|
|
#undef XFreeXDGA
|
|
|
|
#undef XF86DRI
|
|
|
|
#undef SCREENSAVER
|
|
|
|
#undef RANDR
|
|
|
|
#undef XFIXES
|
|
|
|
#undef DAMAGE
|
|
|
|
#undef COMPOSITE
|
|
|
|
#undef MITSHM
|
2005-07-12 02:52:48 +02:00
|
|
|
#endif
|
|
|
|
|
2005-07-14 05:36:44 +02:00
|
|
|
#ifdef HAVE_XNEST_CONFIG_H
|
|
|
|
#include <xnest-config.h>
|
2008-01-03 16:53:56 +01:00
|
|
|
#undef COMPOSITE
|
2005-07-14 05:36:44 +02:00
|
|
|
#undef DPMSExtension
|
|
|
|
#endif
|
|
|
|
|
2005-12-28 11:02:54 +01:00
|
|
|
#ifdef HAVE_KDRIVE_CONFIG_H
|
|
|
|
#include <kdrive-config.h>
|
|
|
|
/* there must be a better way... */
|
|
|
|
#undef XFreeXDGA
|
|
|
|
#undef XF86DRI
|
|
|
|
#undef XF86VIDMODE
|
|
|
|
#endif
|
|
|
|
|
2005-12-29 01:19:33 +01:00
|
|
|
#ifdef HAVE_XGL_CONFIG_H
|
|
|
|
#include <xgl-config.h>
|
|
|
|
#undef XFreeXDGA
|
|
|
|
#undef XF86DRI
|
|
|
|
#undef XF86VIDMODE
|
|
|
|
#endif
|
|
|
|
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "extension.h"
|
|
|
|
#include "micmap.h"
|
2006-06-08 19:11:17 +02:00
|
|
|
#include "globals.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
extern Bool noTestExtensions;
|
2004-09-14 02:51:25 +02:00
|
|
|
|
|
|
|
#ifdef COMPOSITE
|
|
|
|
extern Bool noCompositeExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
|
|
|
extern Bool noDbeExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef DPMSExtension
|
|
|
|
extern Bool noDPMSExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef GLXEXT
|
|
|
|
extern Bool noGlxExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef SCREENSAVER
|
|
|
|
extern Bool noScreenSaverExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef MITSHM
|
|
|
|
extern Bool noMITShmExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
|
|
|
extern Bool noMultibufferExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
|
|
|
extern Bool noRRExtension;
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2004-07-31 06:23:21 +02:00
|
|
|
#ifdef RENDER
|
|
|
|
extern Bool noRenderExtension;
|
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef XCSECURITY
|
|
|
|
extern Bool noSecurityExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef RES
|
|
|
|
extern Bool noResExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XF86BIGFONT
|
|
|
|
extern Bool noXFree86BigfontExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XFreeXDGA
|
|
|
|
extern Bool noXFree86DGAExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XF86DRI
|
|
|
|
extern Bool noXFree86DRIExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XF86VIDMODE
|
|
|
|
extern Bool noXFree86VidModeExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XFIXES
|
|
|
|
extern Bool noXFixesExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
extern Bool noPanoramiXExtension;
|
|
|
|
#endif
|
2007-12-21 10:24:06 +01:00
|
|
|
#ifdef INXQUARTZ
|
|
|
|
extern Bool noPseudoramiXExtension;
|
|
|
|
#endif
|
2008-03-28 19:01:34 +01:00
|
|
|
#ifdef XSELINUX
|
|
|
|
extern Bool noSELinuxExtension;
|
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef XV
|
|
|
|
extern Bool noXvExtension;
|
2004-07-31 11:14:06 +02:00
|
|
|
#endif
|
2007-04-30 05:27:42 +02:00
|
|
|
extern Bool noGEExtension;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifndef XFree86LOADER
|
|
|
|
#define INITARGS void
|
|
|
|
typedef void (*InitExtension)(INITARGS);
|
|
|
|
#else /* XFree86Loader */
|
|
|
|
#include "loaderProcs.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MITSHM
|
2009-07-15 08:51:05 +02:00
|
|
|
#include <X11/extensions/shm.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XTEST
|
2009-07-23 00:33:00 +02:00
|
|
|
#include <X11/extensions/xtestconst.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/XKB.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XCSECURITY
|
2006-06-21 03:22:51 +02:00
|
|
|
#include "securitysrv.h"
|
2009-07-15 08:51:05 +02:00
|
|
|
#include <X11/extensions/secur.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2006-09-08 21:17:01 +02:00
|
|
|
#ifdef XSELINUX
|
|
|
|
#include "xselinux.h"
|
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef PANORAMIX
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/panoramiXproto.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XF86BIGFONT
|
2005-04-20 16:16:37 +02:00
|
|
|
#include <X11/extensions/xf86bigfstr.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RES
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/XResproto.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* FIXME: this whole block of externs should be from the appropriate headers */
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef MITSHM
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void ShmExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void MultibufferExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void PanoramiXExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2007-12-21 10:24:06 +01:00
|
|
|
#ifdef INXQUARTZ
|
|
|
|
extern void PseudoramiXExtensionInit(INITARGS);
|
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XInputExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef XTEST
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XTestExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void BigReqExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef SCREENSAVER
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void ScreenSaverExtensionInit (INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XV
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XvExtensionInit(INITARGS);
|
|
|
|
extern void XvMCExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void SyncExtensionInit(INITARGS);
|
|
|
|
extern void XkbExtensionInit(INITARGS);
|
|
|
|
extern void XCMiscExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef XRECORD
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void RecordExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void DbeExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void SecurityExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2006-09-08 21:17:01 +02:00
|
|
|
#ifdef XSELINUX
|
2007-12-28 19:26:26 +01:00
|
|
|
extern void SELinuxExtensionInit(INITARGS);
|
2006-09-08 21:17:01 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XF86BIGFONT
|
|
|
|
extern void XFree86BigfontExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef XF86VIDMODE
|
|
|
|
extern void XFree86VidModeExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef XFreeXDGA
|
|
|
|
extern void XFree86DGAExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef GLXEXT
|
2006-03-12 01:11:34 +01:00
|
|
|
typedef struct __GLXprovider __GLXprovider;
|
2008-05-21 16:17:53 +02:00
|
|
|
extern __GLXprovider __glXDRISWRastProvider;
|
2007-02-17 12:47:42 +01:00
|
|
|
extern void GlxPushProvider(__GLXprovider *impl);
|
|
|
|
extern void GlxExtensionInit(INITARGS);
|
2007-11-22 04:51:14 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XF86DRI
|
|
|
|
extern void XFree86DRIExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef DPMSExtension
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void DPMSExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef RENDER
|
|
|
|
extern void RenderExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
|
|
|
extern void RRExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef RES
|
|
|
|
extern void ResExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2004-06-30 22:06:56 +02:00
|
|
|
#ifdef DMXEXT
|
|
|
|
extern void DMXExtensionInit(INITARGS);
|
|
|
|
#endif
|
2004-07-29 20:49:42 +02:00
|
|
|
#ifdef XFIXES
|
|
|
|
extern void XFixesExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef DAMAGE
|
|
|
|
extern void DamageExtensionInit(INITARGS);
|
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef COMPOSITE
|
|
|
|
extern void CompositeExtensionInit(INITARGS);
|
|
|
|
#endif
|
2007-04-30 05:27:42 +02:00
|
|
|
extern void GEExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2004-07-31 06:23:21 +02:00
|
|
|
/* The following is only a small first step towards run-time
|
|
|
|
* configurable extensions.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
char *name;
|
|
|
|
Bool *disablePtr;
|
|
|
|
} ExtensionToggle;
|
|
|
|
|
|
|
|
static ExtensionToggle ExtensionToggleList[] =
|
|
|
|
{
|
2004-09-14 02:51:25 +02:00
|
|
|
/* sort order is extension name string as shown in xdpyinfo */
|
2007-04-30 05:27:42 +02:00
|
|
|
{ "Generic Events", &noGEExtension },
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef COMPOSITE
|
|
|
|
{ "Composite", &noCompositeExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef DAMAGE
|
|
|
|
{ "DAMAGE", &noDamageExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
|
|
|
{ "DOUBLE-BUFFER", &noDbeExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef DPMSExtension
|
|
|
|
{ "DPMS", &noDPMSExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef GLXEXT
|
|
|
|
{ "GLX", &noGlxExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef SCREENSAVER
|
|
|
|
{ "MIT-SCREEN-SAVER", &noScreenSaverExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef MITSHM
|
2004-12-08 06:48:16 +01:00
|
|
|
{ SHMNAME, &noMITShmExtension },
|
2004-09-14 02:51:25 +02:00
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
|
|
|
{ "Multi-Buffering", &noMultibufferExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
|
|
|
{ "RANDR", &noRRExtension },
|
2004-07-31 06:23:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef RENDER
|
|
|
|
{ "RENDER", &noRenderExtension },
|
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef XCSECURITY
|
|
|
|
{ "SECURITY", &noSecurityExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef RES
|
|
|
|
{ "X-Resource", &noResExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XF86BIGFONT
|
|
|
|
{ "XFree86-Bigfont", &noXFree86BigfontExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XFreeXDGA
|
|
|
|
{ "XFree86-DGA", &noXFree86DGAExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XF86DRI
|
|
|
|
{ "XFree86-DRI", &noXFree86DRIExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XF86VIDMODE
|
|
|
|
{ "XFree86-VidModeExtension", &noXFree86VidModeExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XFIXES
|
|
|
|
{ "XFIXES", &noXFixesExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
{ "XINERAMA", &noPanoramiXExtension },
|
|
|
|
#endif
|
2008-10-22 13:59:54 +02:00
|
|
|
{ "XInputExtension", NULL },
|
2008-03-18 09:05:57 +01:00
|
|
|
{ "XKEYBOARD", NULL },
|
2008-03-28 19:01:34 +01:00
|
|
|
#ifdef XSELINUX
|
|
|
|
{ "SELinux", &noSELinuxExtension },
|
2004-09-14 02:51:25 +02:00
|
|
|
#endif
|
|
|
|
{ "XTEST", &noTestExtensions },
|
|
|
|
#ifdef XV
|
|
|
|
{ "XVideo", &noXvExtension },
|
2004-07-31 06:23:21 +02:00
|
|
|
#endif
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool EnableDisableExtension(char *name, Bool enable)
|
2004-07-31 06:23:21 +02:00
|
|
|
{
|
|
|
|
ExtensionToggle *ext = &ExtensionToggleList[0];
|
|
|
|
|
|
|
|
for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
|
|
|
|
if (strcmp(name, ext->name) == 0) {
|
2009-10-17 07:29:26 +02:00
|
|
|
if (ext->disablePtr != NULL) {
|
|
|
|
*ext->disablePtr = !enable;
|
|
|
|
return TRUE;
|
|
|
|
} else {
|
|
|
|
/* Extension is always on, impossible to disable */
|
|
|
|
return enable; /* okay if they wanted to enable,
|
|
|
|
fail if they tried to disable */
|
|
|
|
}
|
2004-07-31 06:23:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-31 11:14:06 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void EnableDisableExtensionError(char *name, Bool enable)
|
2004-07-31 11:14:06 +02:00
|
|
|
{
|
|
|
|
ExtensionToggle *ext = &ExtensionToggleList[0];
|
2009-10-17 07:29:26 +02:00
|
|
|
Bool found = FALSE;
|
2004-07-31 11:14:06 +02:00
|
|
|
|
2009-10-17 07:29:26 +02:00
|
|
|
for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
|
|
|
|
if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) {
|
|
|
|
ErrorF("[mi] Extension \"%s\" can not be disabled\n", name);
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (found == FALSE)
|
|
|
|
ErrorF("[mi] Extension \"%s\" is not recognized\n", name);
|
2007-12-07 10:53:36 +01:00
|
|
|
ErrorF("[mi] Only the following extensions can be run-time %s:\n",
|
2004-07-31 06:23:21 +02:00
|
|
|
enable ? "enabled" : "disabled");
|
2009-10-17 07:29:26 +02:00
|
|
|
for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
|
|
|
|
if (ext->disablePtr != NULL) {
|
|
|
|
ErrorF("[mi] %s\n", ext->name);
|
|
|
|
}
|
|
|
|
}
|
2004-07-31 06:23:21 +02:00
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifndef XFree86LOADER
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*ARGSUSED*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
InitExtensions(int argc, char *argv[])
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-04-30 05:27:42 +02:00
|
|
|
if (!noGEExtension) GEExtensionInit();
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef PANORAMIX
|
2008-05-12 20:15:11 +02:00
|
|
|
# if !defined(NO_PANORAMIX)
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!noPanoramiXExtension) PanoramiXExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
# endif
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2007-12-21 10:24:06 +01:00
|
|
|
#ifdef INXQUARTZ
|
|
|
|
if(!noPseudoramiXExtension) PseudoramiXExtensionInit();
|
|
|
|
#endif
|
2008-07-24 15:00:22 +02:00
|
|
|
ShapeExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef MITSHM
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noMITShmExtension) ShmExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noMultibufferExtension) MultibufferExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2008-10-22 13:59:54 +02:00
|
|
|
XInputExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef XTEST
|
|
|
|
if (!noTestExtensions) XTestExtensionInit();
|
|
|
|
#endif
|
2008-07-24 15:07:42 +02:00
|
|
|
BigReqExtensionInit();
|
2008-05-12 20:15:11 +02:00
|
|
|
#if defined(SCREENSAVER)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noScreenSaverExtension) ScreenSaverExtensionInit ();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XV
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXvExtension) {
|
|
|
|
XvExtensionInit();
|
|
|
|
XvMCExtensionInit();
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2008-07-24 21:28:07 +02:00
|
|
|
SyncExtensionInit();
|
2008-03-18 09:05:57 +01:00
|
|
|
XkbExtensionInit();
|
2008-07-24 21:09:05 +02:00
|
|
|
XCMiscExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef XRECORD
|
|
|
|
if (!noTestExtensions) RecordExtensionInit();
|
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noDbeExtension) DbeExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noSecurityExtension) SecurityExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2006-09-08 21:17:01 +02:00
|
|
|
#ifdef XSELINUX
|
2008-03-28 19:01:34 +01:00
|
|
|
if (!noSELinuxExtension) SELinuxExtensionInit();
|
2006-09-08 21:17:01 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noDPMSExtension) DPMSExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XF86BIGFONT
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86BigfontExtension) XFree86BigfontExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2008-05-12 20:15:11 +02:00
|
|
|
#if !defined(NO_HW_ONLY_EXTS)
|
2003-11-14 17:49:22 +01:00
|
|
|
#if defined(XF86VIDMODE)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86VidModeExtension) XFree86VidModeExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#if defined(XFreeXDGA)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86DGAExtension) XFree86DGAExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XF86DRI
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86DRIExtension) XFree86DRIExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef XFIXES
|
|
|
|
/* must be before Render to layer DisplayCursor correctly */
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFixesExtension) XFixesExtensionInit();
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef RENDER
|
2004-07-31 06:23:21 +02:00
|
|
|
if (!noRenderExtension) RenderExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noRRExtension) RRExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RES
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noResExtension) ResExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2004-06-30 22:06:56 +02:00
|
|
|
#ifdef DMXEXT
|
2004-09-14 02:51:25 +02:00
|
|
|
DMXExtensionInit(); /* server-specific extension, cannot be disabled */
|
2004-06-30 22:06:56 +02:00
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef COMPOSITE
|
2004-07-31 11:14:06 +02:00
|
|
|
if (!noCompositeExtension) CompositeExtensionInit();
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2004-08-03 07:39:19 +02:00
|
|
|
#ifdef DAMAGE
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noDamageExtension) DamageExtensionInit();
|
2004-08-03 07:39:19 +02:00
|
|
|
#endif
|
2007-10-29 23:06:41 +01:00
|
|
|
|
|
|
|
#ifdef GLXEXT
|
2008-11-07 18:36:00 +01:00
|
|
|
if (serverGeneration == 1)
|
|
|
|
GlxPushProvider(&__glXDRISWRastProvider);
|
2007-10-29 23:06:41 +01:00
|
|
|
if (!noGlxExtension) GlxExtensionInit();
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#else /* XFree86LOADER */
|
|
|
|
/* List of built-in (statically linked) extensions */
|
|
|
|
static ExtensionModule staticExtensions[] = {
|
2007-04-30 05:27:42 +02:00
|
|
|
{ GEExtensionInit, "Generic Event Extension", &noGEExtension, NULL, NULL},
|
2008-07-24 15:00:22 +02:00
|
|
|
{ ShapeExtensionInit, "SHAPE", NULL, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef MITSHM
|
2004-12-08 06:48:16 +01:00
|
|
|
{ ShmExtensionInit, SHMNAME, &noMITShmExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2008-10-22 13:59:54 +02:00
|
|
|
{ XInputExtensionInit, "XInputExtension", NULL, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XTEST
|
|
|
|
{ XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL },
|
|
|
|
#endif
|
2008-07-24 15:07:42 +02:00
|
|
|
{ BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL },
|
2008-07-24 21:28:07 +02:00
|
|
|
{ SyncExtensionInit, "SYNC", NULL, NULL, NULL },
|
2008-03-18 09:05:57 +01:00
|
|
|
{ XkbExtensionInit, XkbName, NULL, NULL, NULL },
|
2008-07-24 21:09:05 +02:00
|
|
|
{ XCMiscExtensionInit, "XC-MISC", NULL, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XCSECURITY
|
2007-08-03 16:56:18 +02:00
|
|
|
{ SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
{ PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension, NULL, NULL },
|
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef XFIXES
|
|
|
|
/* must be before Render to layer DisplayCursor correctly */
|
2004-12-08 06:48:16 +01:00
|
|
|
{ XFixesExtensionInit, "XFIXES", &noXFixesExtension, NULL, NULL },
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XF86BIGFONT
|
2004-12-08 06:48:16 +01:00
|
|
|
{ XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RENDER
|
2004-07-31 06:23:21 +02:00
|
|
|
{ RenderExtensionInit, "RENDER", &noRenderExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
2004-12-08 06:48:16 +01:00
|
|
|
{ RRExtensionInit, "RANDR", &noRRExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef COMPOSITE
|
2004-07-31 11:14:06 +02:00
|
|
|
{ CompositeExtensionInit, "COMPOSITE", &noCompositeExtension, NULL },
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2004-08-03 07:39:19 +02:00
|
|
|
#ifdef DAMAGE
|
2004-12-08 06:48:16 +01:00
|
|
|
{ DamageExtensionInit, "DAMAGE", &noDamageExtension, NULL },
|
2004-08-03 07:39:19 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
{ NULL, NULL, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*ARGSUSED*/
|
|
|
|
void
|
2008-05-28 04:57:07 +02:00
|
|
|
InitExtensions(int argc, char *argv[])
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
ExtensionModule *ext;
|
|
|
|
static Bool listInitialised = FALSE;
|
|
|
|
|
|
|
|
if (!listInitialised) {
|
|
|
|
/* Add built-in extensions to the list. */
|
|
|
|
for (i = 0; staticExtensions[i].name; i++)
|
|
|
|
LoadExtension(&staticExtensions[i], TRUE);
|
|
|
|
|
|
|
|
/* Sort the extensions according the init dependencies. */
|
|
|
|
LoaderSortExtensions();
|
|
|
|
listInitialised = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; ExtensionModuleList[i].name != NULL; i++) {
|
|
|
|
ext = &ExtensionModuleList[i];
|
|
|
|
if (ext->initFunc != NULL &&
|
|
|
|
(ext->disablePtr == NULL ||
|
|
|
|
(ext->disablePtr != NULL && !*ext->disablePtr))) {
|
|
|
|
(ext->initFunc)();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* XFree86LOADER */
|