From 787e0751c54004a10e16c18772e1526edb70afd3 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 19 Jun 2024 20:14:29 +0200 Subject: [PATCH] loader: use os_get_option() to allow android to set LIBGL_DRIVERS_PATH, GBM_BACKENDS_PATH, GALLIUM_PIPE_SEARCH_DIR Part-of: --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 2 +- src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 4 ++-- src/loader/loader.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c index aebbe763639..0e80eb95899 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -105,7 +105,7 @@ get_driver_descriptor(const char *driver_name, struct util_dl_library **plib) } return &kmsro_driver_descriptor; #else - const char *search_dir = getenv("GALLIUM_PIPE_SEARCH_DIR"); + const char *search_dir = os_get_option("GALLIUM_PIPE_SEARCH_DIR"); if (search_dir == NULL) search_dir = PIPE_SEARCH_DIR; diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c index cb7f46dca35..ebbbbac3ad0 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c @@ -136,7 +136,7 @@ pipe_loader_sw_probe_init_common(struct pipe_loader_sw_device *sdev) if (!sdev->dd) return false; #else - const char *search_dir = getenv("GALLIUM_PIPE_SEARCH_DIR"); + const char *search_dir = os_get_option("GALLIUM_PIPE_SEARCH_DIR"); if (search_dir == NULL) search_dir = PIPE_SEARCH_DIR; @@ -171,7 +171,7 @@ pipe_loader_vk_probe_init_common(struct pipe_loader_sw_device *sdev) if (!sdev->dd) return false; #else - const char *search_dir = getenv("GALLIUM_PIPE_SEARCH_DIR"); + const char *search_dir = os_get_option("GALLIUM_PIPE_SEARCH_DIR"); if (search_dir == NULL) search_dir = PIPE_SEARCH_DIR; diff --git a/src/loader/loader.c b/src/loader/loader.c index f76a18d9e3c..af41923b859 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -815,7 +815,7 @@ loader_open_driver_lib(const char *driver_name, search_paths = NULL; if (__normal_user() && search_path_vars) { for (int i = 0; search_path_vars[i] != NULL; i++) { - search_paths = getenv(search_path_vars[i]); + search_paths = os_get_option(search_path_vars[i]); if (search_paths) break; }