gallium: Deprecate GETENV. Replace by debug_get_bool_option.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 9 Jun 2008 23:32:52 +0000 (08:32 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 9 Jun 2008 23:33:21 +0000 (08:33 +0900)
debug_get_bool_option will interpret "n", "no", "0", "f", or
"false" as FALSE; and everything else as TRUE. The default value
(used when the variable is not set) is received as a parameter.

src/gallium/auxiliary/draw/draw_pt.c
src/gallium/drivers/i915simple/i915_context.c
src/gallium/drivers/softpipe/sp_context.c
src/gallium/include/pipe/p_util.h

index f0d7b51ad700c083c2c55477438a40eaf199ae69..9140faeea9d187d2a6fa7c88547a49ee86f59bc7 100644 (file)
@@ -119,8 +119,8 @@ draw_pt_arrays(struct draw_context *draw,
 
 boolean draw_pt_init( struct draw_context *draw )
 {
-   draw->pt.test_fse = GETENV("DRAW_FSE") != NULL;
-   draw->pt.no_fse = GETENV("DRAW_NO_FSE") != NULL;
+   draw->pt.test_fse = debug_get_bool_option("DRAW_FSE", FALSE);
+   draw->pt.no_fse = debug_get_bool_option("DRAW_NO_FSE", FALSE);
 
    draw->pt.front.vcache = draw_pt_vcache( draw );
    if (!draw->pt.front.vcache)
index 243b4a685223d7b25e39bc3adbc184365457fd1d..4c01b8d5b17f926e1bd136f08a2265fde30fb27b 100644 (file)
@@ -161,7 +161,7 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
     */
    i915->draw = draw_create();
    assert(i915->draw);
-   if (!GETENV("I915_NO_VBUF")) {
+   if (!debug_get_bool_option("I915_NO_VBUF", FALSE)) {
       draw_set_rasterize_stage(i915->draw, i915_draw_vbuf_stage(i915));
    }
    else {
index 1e0106b86c740b1fe01a88fe069f6a7030799b09..6e14f684f1254c4210a65dce6c796265599971c6 100644 (file)
@@ -129,12 +129,12 @@ softpipe_create( struct pipe_screen *screen,
    uint i;
 
 #ifdef PIPE_ARCH_X86
-   softpipe->use_sse = GETENV( "GALLIUM_NOSSE" ) == NULL;
+   softpipe->use_sse = !debug_get_bool_option( "GALLIUM_NOSSE", FALSE );
 #else
    softpipe->use_sse = FALSE;
 #endif
 
-   softpipe->dump_fs = GETENV( "GALLIUM_DUMP_FS" ) != NULL;
+   softpipe->dump_fs = debug_get_bool_option( "GALLIUM_DUMP_FS", FALSE );
 
    softpipe->pipe.winsys = pipe_winsys;
    softpipe->pipe.screen = screen;
index 5547e57833344460891787cc798b8b304896f4c7..8b3003bcefb233f7eb94dc98a1f9f812a2855c6e 100644 (file)
@@ -140,8 +140,6 @@ REALLOC( void *old_ptr, unsigned old_size, unsigned new_size )
 
 #define CALLOC_STRUCT(T)   (struct T *) CALLOC(1, sizeof(struct T))
 
-#define GETENV( X ) debug_get_option( X, NULL )
-
 
 /**
  * Return memory on given byte alignment