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