1/************************************************************************** 2 3Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. 4All Rights Reserved. 5 6Permission is hereby granted, free of charge, to any person obtaining a 7copy of this software and associated documentation files (the 8"Software"), to deal in the Software without restriction, including 9without limitation the rights to use, copy, modify, merge, publish, 10distribute, sub license, and/or sell copies of the Software, and to 11permit persons to whom the Software is furnished to do so, subject to 12the following conditions: 13 14The above copyright notice and this permission notice (including the 15next paragraph) shall be included in all copies or substantial portions 16of the Software. 17 18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR 22ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 26**************************************************************************/ 27 28/* 29 * Authors: 30 * Kevin E. Martin <kevin@precisioninsight.com> 31 * 32 */ 33 34#ifdef HAVE_XORG_CONFIG_H 35#include <xorg-config.h> 36#endif 37 38#include "xf86Module.h" 39#include "xf86Priv.h" 40#include "xf86.h" 41#include "colormap.h" 42#include "micmap.h" 43#include "globals.h" 44#include "glxserver.h" 45 46static MODULESETUPPROTO(glxSetup); 47 48static const char *initdeps[] = { "DOUBLE-BUFFER", "COMPOSITE", NULL }; 49 50static ExtensionModule GLXExt = 51{ 52 GlxExtensionInit, 53 "GLX", 54 &noGlxExtension, 55 NULL, 56 initdeps 57}; 58 59static XF86ModuleVersionInfo VersRec = 60{ 61 "glx", 62 MODULEVENDORSTRING, 63 MODINFOSTRING1, 64 MODINFOSTRING2, 65 XORG_VERSION_CURRENT, 66 1, 0, 0, 67 ABI_CLASS_EXTENSION, 68 ABI_EXTENSION_VERSION, 69 MOD_CLASS_NONE, 70 {0,0,0,0} 71}; 72 73_X_EXPORT XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL }; 74 75static pointer 76glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) 77{ 78 static Bool setupDone = FALSE; 79 __GLXprovider *provider; 80 81 if (setupDone) { 82 if (errmaj) *errmaj = LDR_ONCEONLY; 83 return NULL; 84 } 85 86 setupDone = TRUE; 87 88 provider = LoaderSymbol("__glXDRISWRastProvider"); 89 if (provider == NULL) 90 return NULL; 91 GlxPushProvider(provider); 92 93 xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n", 94 xf86Info.aiglx ? "enabled" : "disabled"); 95 if (xf86Info.aiglx) { 96 provider = LoaderSymbol("__glXDRIProvider"); 97 if (provider) 98 GlxPushProvider(provider); 99 provider = LoaderSymbol("__glXDRI2Provider"); 100 if (provider) 101 GlxPushProvider(provider); 102 } 103 104 LoadExtension(&GLXExt, FALSE); 105 106 return module; 107} 108