Mesa (master): gallium: Convert some uses of get option to static

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Fri Apr 23 20:56:15 UTC 2010


Module: Mesa
Branch: master
Commit: 1820d240cd0b517ca1d73f1e8e0a528ca8d5b092
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1820d240cd0b517ca1d73f1e8e0a528ca8d5b092

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Thu Apr 22 18:20:31 2010 +0100

gallium: Convert some uses of get option to static

---

 src/gallium/auxiliary/draw/draw_pt.c        |   13 ++++++++++---
 src/gallium/auxiliary/draw/draw_vs.c        |    4 ++--
 src/gallium/winsys/sw/xlib/xlib_sw_winsys.c |    4 +++-
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index b5876bb..c40c25d 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -37,6 +37,13 @@
 #include "util/u_math.h"
 #include "util/u_prim.h"
 
+
+DEBUG_GET_ONCE_BOOL_OPTION(draw_fse, "DRAW_FSE", FALSE);
+DEBUG_GET_ONCE_BOOL_OPTION(draw_no_fse, "DRAW_NO_FSE", FALSE);
+#ifdef HAVE_LLVM
+DEBUG_GET_ONCE_BOOL_OPTION(draw_use_llvm, "DRAW_USE_LLVM", TRUE);
+#endif
+
 static unsigned trim( unsigned count, unsigned first, unsigned incr )
 {
    if (count < first)
@@ -122,8 +129,8 @@ draw_pt_arrays(struct draw_context *draw,
 
 boolean draw_pt_init( struct draw_context *draw )
 {
-   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.test_fse = debug_get_option_draw_fse();
+   draw->pt.no_fse = debug_get_option_draw_no_fse();
 
    draw->pt.front.vcache = draw_pt_vcache( draw );
    if (!draw->pt.front.vcache)
@@ -142,7 +149,7 @@ boolean draw_pt_init( struct draw_context *draw )
       return FALSE;
 
 #if HAVE_LLVM
-   draw->use_llvm = debug_get_bool_option("DRAW_USE_LLVM", TRUE);
+   draw->use_llvm = debug_get_option_draw_use_llvm();
    if (draw->use_llvm)
       draw->pt.middle.general = draw_pt_fetch_pipeline_or_emit_llvm( draw );
 #else
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c
index cfd5154..0c05957 100644
--- a/src/gallium/auxiliary/draw/draw_vs.c
+++ b/src/gallium/auxiliary/draw/draw_vs.c
@@ -46,7 +46,7 @@
 #include "tgsi/tgsi_dump.h"
 #include "tgsi/tgsi_exec.h"
 
-
+DEBUG_GET_ONCE_BOOL_OPTION(gallium_dump_vs, "GALLIUM_DUMP_VS", FALSE);
 
 void
 draw_vs_set_constants(struct draw_context *draw,
@@ -157,7 +157,7 @@ draw_delete_vertex_shader(struct draw_context *draw,
 boolean 
 draw_vs_init( struct draw_context *draw )
 {
-   draw->dump_vs = debug_get_bool_option("GALLIUM_DUMP_VS", FALSE);
+   draw->dump_vs = debug_get_option_gallium_dump_vs();
 
    draw->vs.machine = tgsi_exec_machine_create();
    if (!draw->vs.machine)
diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
index 278a191..679af61 100644
--- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
+++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
@@ -48,6 +48,8 @@
 #include <sys/shm.h>
 #include <X11/extensions/XShm.h>
 
+DEBUG_GET_ONCE_BOOL_OPTION(xlib_no_shm, "XLIB_NO_SHM", FALSE);
+
 /**
  * Display target for Xlib winsys.
  * Low-level OS/window system memory buffer
@@ -383,7 +385,7 @@ xm_displaytarget_create(struct sw_winsys *winsys,
    xm_dt->stride = align(util_format_get_stride(format, width), alignment);
    size = xm_dt->stride * nblocksy;
 
-   if (!debug_get_bool_option("XLIB_NO_SHM", FALSE))
+   if (!debug_get_option_xlib_no_shm())
    {
       xm_dt->data = alloc_shm(xm_dt, size);
       if(!xm_dt->data) {




More information about the mesa-commit mailing list