2 * Copyright © 2011 Daniel Stone
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
23 * Author: Daniel Stone <daniel@fooishbar.org>
26 #ifdef HAVE_XORG_CONFIG_H
27 #include <xorg-config.h>
30 #include "extension.h"
34 #include "xf86Config.h"
35 #include "xf86Module.h"
36 #include "xf86Extensions.h"
38 #include "optionstr.h"
45 #include <X11/extensions/xf86dgaproto.h>
49 #include <X11/extensions/xf86vmproto.h>
50 #include "vidmodeproc.h"
54 * DDX-specific extensions.
56 static const ExtensionModule extensionModules
[] = {
59 XFree86VidModeExtensionInit
,
61 &noXFree86VidModeExtension
66 XFree86DGAExtensionInit
,
68 &noXFree86DGAExtension
73 XFree86DRIExtensionInit
,
75 &noXFree86DRIExtension
88 load_extension_config(void)
90 XF86ConfModulePtr mod_con
= xf86configptr
->conf_modules
;
98 nt_list_for_each_entry(modp
, mod_con
->mod_load_lst
, list
.next
) {
101 if (strcasecmp(modp
->load_name
, "extmod") != 0)
104 /* extmod options are of the form "omit <extension-name>" */
105 nt_list_for_each_entry(opt
, modp
->load_opt
, list
.next
) {
106 const char *key
= input_option_get_key(opt
);
107 if (strncasecmp(key
, "omit", 4) != 0 || strlen(key
) < 5)
109 if (EnableDisableExtension(key
+ 4, FALSE
))
110 xf86MarkOptionUsed(opt
);
114 if ((opt
= xf86FindOption(modp
->load_opt
,
115 "SELinux mode disabled"))) {
116 xf86MarkOptionUsed(opt
);
117 selinuxEnforcingState
= SELINUX_MODE_DISABLED
;
119 if ((opt
= xf86FindOption(modp
->load_opt
,
120 "SELinux mode permissive"))) {
121 xf86MarkOptionUsed(opt
);
122 selinuxEnforcingState
= SELINUX_MODE_PERMISSIVE
;
124 if ((opt
= xf86FindOption(modp
->load_opt
,
125 "SELinux mode enforcing"))) {
126 xf86MarkOptionUsed(opt
);
127 selinuxEnforcingState
= SELINUX_MODE_ENFORCING
;
134 xf86ExtensionInit(void)
138 load_extension_config();
140 for (i
= 0; i
< ARRAY_SIZE(extensionModules
); i
++)
141 LoadExtension(&extensionModules
[i
], TRUE
);