[Mesa-dev] [PATCH mesa 01/10] gbm: turn GBM_ALWAYS_SOFTWARE into a boolean

Eric Engestrom eric.engestrom at imgtec.com
Fri Sep 8 12:40:47 UTC 2017


Instead of setting based on set/unset, allow users to use boolean values.

Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 src/gbm/Android.mk             | 5 ++++-
 src/gbm/Makefile.am            | 1 +
 src/gbm/backends/dri/gbm_dri.c | 6 ++++--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gbm/Android.mk b/src/gbm/Android.mk
index a3f8fbbeab..1fe5652432 100644
--- a/src/gbm/Android.mk
+++ b/src/gbm/Android.mk
@@ -32,7 +32,10 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
 LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/main
 
-LOCAL_STATIC_LIBRARIES := libmesa_loader
+LOCAL_STATIC_LIBRARIES := \
+	libmesa_util \
+	libmesa_loader
+
 LOCAL_MODULE := libgbm
 
 LOCAL_SRC_FILES := \
diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index 7a9a12f87a..f5fa81c7c9 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -26,6 +26,7 @@ libgbm_la_LDFLAGS = \
 
 libgbm_la_LIBADD = \
 	$(top_builddir)/src/loader/libloader.la \
+	$(top_builddir)/src/util/libmesautil.la \
 	$(top_builddir)/src/util/libxmlconfig.la \
 	$(DLOPEN_LIBS)
 
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 1b2cc4ce76..4628524565 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -48,6 +48,7 @@
 
 #include "gbmint.h"
 #include "loader.h"
+#include "util/debug.h"
 #include "util/macros.h"
 
 /* For importing wl_buffer */
@@ -1336,7 +1337,8 @@ static struct gbm_device *
 dri_device_create(int fd)
 {
    struct gbm_dri_device *dri;
-   int ret, force_sw;
+   int ret;
+   bool force_sw;
 
    dri = calloc(1, sizeof *dri);
    if (!dri)
@@ -1364,7 +1366,7 @@ dri_device_create(int fd)
 
    mtx_init(&dri->mutex, mtx_plain);
 
-   force_sw = getenv("GBM_ALWAYS_SOFTWARE") != NULL;
+   force_sw = env_var_as_boolean("GBM_ALWAYS_SOFTWARE", false);
    if (!force_sw) {
       ret = dri_screen_create(dri);
       if (ret)
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list