gbm: turn GBM_ALWAYS_SOFTWARE into a boolean
authorEric Engestrom <eric.engestrom@imgtec.com>
Fri, 8 Sep 2017 10:39:43 +0000 (11:39 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 12 Sep 2017 12:53:11 +0000 (13:53 +0100)
Instead of setting based on set/unset, allow users to use boolean values.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gbm/Android.mk
src/gbm/Makefile.am
src/gbm/backends/dri/gbm_dri.c

index a3f8fbbeabce01e4c5215a3b6d59315db0f95316..1fe5652432261bf8760a2d2e47efa8f1c8426ad8 100644 (file)
@@ -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 := \
index 7a9a12f87a0ded4ee9e013e1335a023a729151b4..f5fa81c7c968d2e11d506e41906e77961a3bdb33 100644 (file)
@@ -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)
 
index 1b2cc4ce76533ebf7461b98d76374b218f2a26fa..462852456584ac5289775ceb4d184952230c0d1f 100644 (file)
@@ -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)