st/xorg: Don't try to use option values before processing options
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 12 Oct 2010 08:26:07 +0000 (10:26 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 12 Oct 2010 13:09:04 +0000 (15:09 +0200)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
src/gallium/state_trackers/xorg/xorg_driver.c

index e10ff2f95087053eb075ff222178d2178a8c90bc..835f06a73b18e5bdb12a096c46c5bb0fbacd3280 100644 (file)
@@ -402,19 +402,6 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
     if (!drv_init_drm(pScrn))
        return FALSE;
 
-    use3D = cust ? !cust->no_3d : TRUE;
-    ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
-                                   &use3D) ?
-       X_CONFIG : X_PROBED;
-
-    ms->no3D = !use3D;
-
-    if (!drv_init_resource_management(pScrn)) {
-       xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
-                                              "Gallium3D or libKMS.");
-       return FALSE;
-    }
-
     pScrn->monitor = pScrn->confScreen->monitor;
     pScrn->progClock = TRUE;
     pScrn->rgbBits = 8;
@@ -449,6 +436,19 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
     memcpy(ms->Options, drv_options, sizeof(drv_options));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
 
+    use3D = cust ? !cust->no_3d : TRUE;
+    ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
+                                   &use3D) ?
+       X_CONFIG : X_PROBED;
+
+    ms->no3D = !use3D;
+
+    if (!drv_init_resource_management(pScrn)) {
+       xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
+                                              "Gallium3D or libKMS.");
+       return FALSE;
+    }
+
     /* Allocate an xf86CrtcConfig */
     xf86CrtcConfigInit(pScrn, &crtc_config_funcs);
     xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);