Commit | Line | Data |
---|---|---|
a09e091a JB |
1 | /************************************************************************** |
2 | ||
3 | Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. | |
4 | All Rights Reserved. | |
5 | ||
6 | Permission is hereby granted, free of charge, to any person obtaining a | |
7 | copy of this software and associated documentation files (the | |
8 | "Software"), to deal in the Software without restriction, including | |
9 | without limitation the rights to use, copy, modify, merge, publish, | |
10 | distribute, sub license, and/or sell copies of the Software, and to | |
11 | permit persons to whom the Software is furnished to do so, subject to | |
12 | the following conditions: | |
13 | ||
14 | The above copyright notice and this permission notice (including the | |
15 | next paragraph) shall be included in all copies or substantial portions | |
16 | of the Software. | |
17 | ||
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
19 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. | |
21 | IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR | |
22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
24 | SOFTWARE 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 | #include "extinit.h" | |
46 | #include "glx_extinit.h" | |
47 | ||
48 | static MODULESETUPPROTO(glxSetup); | |
49 | ||
50 | static const ExtensionModule GLXExt = { | |
51 | GlxExtensionInit, | |
52 | "GLX", | |
53 | &noGlxExtension | |
54 | }; | |
55 | ||
56 | static XF86ModuleVersionInfo VersRec = { | |
57 | "glx", | |
58 | MODULEVENDORSTRING, | |
59 | MODINFOSTRING1, | |
60 | MODINFOSTRING2, | |
61 | XORG_VERSION_CURRENT, | |
62 | 1, 0, 0, | |
63 | ABI_CLASS_EXTENSION, | |
64 | ABI_EXTENSION_VERSION, | |
65 | MOD_CLASS_NONE, | |
66 | {0, 0, 0, 0} | |
67 | }; | |
68 | ||
69 | _X_EXPORT XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL }; | |
70 | ||
71 | static pointer | |
72 | glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) | |
73 | { | |
74 | static Bool setupDone = FALSE; | |
75 | __GLXprovider *provider; | |
76 | ||
77 | if (setupDone) { | |
78 | if (errmaj) | |
79 | *errmaj = LDR_ONCEONLY; | |
80 | return NULL; | |
81 | } | |
82 | ||
83 | setupDone = TRUE; | |
84 | ||
85 | xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n", | |
86 | xf86Info.aiglx ? "enabled" : "disabled"); | |
87 | if (xf86Info.aiglx) { | |
88 | provider = LoaderSymbol("__glXDRI2Provider"); | |
89 | if (provider) | |
90 | GlxPushProvider(provider); | |
91 | } | |
92 | ||
93 | LoadExtension(&GLXExt, FALSE); | |
94 | ||
95 | return module; | |
96 | } |