Module: Mesa
Branch: gallium-resources
Commit: 759c1c287caddac2f9d398de8c626ca435ecb42a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=759c1c287caddac2f9d398de8c626ca435ecb42a

Author: José Fonseca <[email protected]>
Date:   Tue Mar 16 13:48:09 2010 +0000

libgl-xlib: Use a simple GALLIUM_DRIVER env var to select the pipe driver.

GALLIUM_DRIVER is being used in many other places, and it easier to
memorizing and understand than all the GALLIUM_NO_XXX.

---

 src/gallium/targets/libgl-xlib/xlib.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/gallium/targets/libgl-xlib/xlib.c 
b/src/gallium/targets/libgl-xlib/xlib.c
index eff4b47..48e79fe 100644
--- a/src/gallium/targets/libgl-xlib/xlib.c
+++ b/src/gallium/targets/libgl-xlib/xlib.c
@@ -63,6 +63,8 @@ PUBLIC const struct st_module st_module_OpenGL = {
 static struct pipe_screen *
 swrast_xlib_create_screen( Display *display )
 {
+   const char *default_driver;
+   const char *driver;
    struct sw_winsys *winsys;
    struct pipe_screen *screen = NULL;
 
@@ -73,17 +75,29 @@ swrast_xlib_create_screen( Display *display )
    if (winsys == NULL)
       return NULL;
 
+#if defined(GALLIUM_CELL)
+   default_driver = "cell";
+#elif defined(GALLIUM_LLVMPIPE)
+   default_driver = "llvmpipe";
+#elif defined(GALLIUM_SOFTPIPE)
+   default_driver = "softpipe";
+#else
+   default_driver = "";
+#endif
+
+   driver = debug_get_option("GALLIUM_DRIVER", default_driver);
+
    /* Create a software rasterizer on top of that winsys:
     */
 #if defined(GALLIUM_CELL)
    if (screen == NULL &&
-       !debug_get_bool_option("GALLIUM_NO_CELL", FALSE))
+       strcmp(driver, "cell") == 0)
       screen = cell_create_screen( winsys );
 #endif
 
 #if defined(GALLIUM_LLVMPIPE)
    if (screen == NULL &&
-       !debug_get_bool_option("GALLIUM_NO_LLVM", FALSE))
+       strcmp(driver, "llvmpipe") == 0)
       screen = llvmpipe_create_screen( winsys );
 #endif
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to