diff options
Diffstat (limited to 'make_usable.c')
-rw-r--r-- | make_usable.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/make_usable.c b/make_usable.c index 920a7dc..74c4ca2 100644 --- a/make_usable.c +++ b/make_usable.c @@ -35,10 +35,30 @@ #include "configProcs.h" +static void ensure_module_loaded(XConfigPtr config, char *name); static int update_device(XConfigPtr config, XConfigDevicePtr device); static void update_depth(Options *op, XConfigScreenPtr screen); static void update_display(Options *op, XConfigScreenPtr screen); +/* + * ensure_module_loaded() - make sure the given module is present + */ + +static void ensure_module_loaded(XConfigPtr config, char *name) { + XConfigLoadPtr load; + int found = FALSE; + + for (load = config->modules->loads; load && !found; load = load->next) { + if (xconfigNameCompare(name, load->name) == 0) found = TRUE; + } + + if (!found) { + config->modules->loads = + xconfigAddNewLoadDirective(config->modules->loads, + name, XCONFIG_LOAD_MODULE, + NULL, FALSE); + } +} /* ensure_module_loaded */ /* * update_modules() - make sure the glx module is present, and remove @@ -48,25 +68,16 @@ static void update_display(Options *op, XConfigScreenPtr screen); int update_modules(XConfigPtr config) { XConfigLoadPtr load, next; - int found; if (config->modules == NULL) { config->modules = xconfigAlloc(sizeof(XConfigModuleRec)); } - /* make sure glx is loaded */ - - found = FALSE; - for (load = config->modules->loads; load; load = load->next) { - if (xconfigNameCompare("glx", load->name) == 0) found = TRUE; - } - - if (!found) { - config->modules->loads = - xconfigAddNewLoadDirective(config->modules->loads, - "glx", XCONFIG_LOAD_MODULE, - NULL, FALSE); - } + /* make sure all our required modules are loaded */ + ensure_module_loaded(config, "glx"); +#if defined(NV_SUNOS) + ensure_module_loaded(config, "xtsol"); +#endif // defined(NV_SUNOS) /* make sure GLcore and dri are not loaded */ @@ -158,6 +169,10 @@ int update_extensions(Options *op, XConfigPtr config) { char *value; + /* validate the composite option against any other options specified */ + + validate_composite(op, config); + if (GET_BOOL_OPTION(op->boolean_options, COMPOSITE_BOOL_OPTION)) { /* if we don't already have the Extensions section, create it now */ |