Hi David,

After upgrading to xserver-xorg-core 1.3, some applications started to
complain that the GLX extension was missing. The cause was that the
"glx" module was not loaded while it was with -rc5. The problem is that
I don't have any Module section anymore at all (I almost removed
everything from my xorg.conf).

With your patch 05_module_defaults.diff, when you have an *empty* module
section, default modules are loaded fine. However, if there is no such
section at all (as in my xorg.conf), no default module is loaded.

Maybe you'll find an easier way to fix this, but at least the attached
patch seems to work fine here. What it does is:
* add all default/TRUE modules to the list of load directives when there
is no Module section
* move the counting of modules to load after the if(there is a module
section)then{}else{} so that we also count in the above case too

Brice

PS: Thanks to Michel for helping.

--- b/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c	2007-04-20 18:49:48.000000000 +0200
@@ -310,6 +310,15 @@
 	            ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
             }
          }
+    } else {
+	xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec));
+	for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
+	    if (ModuleDefaults[i].toLoad == TRUE) {
+		XF86ConfModulePtr ptr = xf86configptr->conf_modules;
+		ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
+	    }
+	}
+    }
 
 	    /*
 	     * Walk the list of modules in the "Module" section to determine how
@@ -325,9 +340,6 @@
 	            count++;
 	        modp = (XF86LoadPtr) modp->list.next;
 	    }
-    } else {
-	    xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec));
-    }
 
     /*
      * allocate the memory and walk the list again to fill in the pointers

Reply via email to