venus: implement vn_debug_init_once with os_get_option

getenv is not working well with Android VM. Instead, use os_get_option
to read Android system property.

e.g. adb shell setprop mesa.vn.debug drm

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10112>
This commit is contained in:
Yiwei Zhang 2021-04-06 00:50:36 +00:00 committed by Marge Bot
parent 82bb90e072
commit a049cff241
2 changed files with 3 additions and 2 deletions

View file

@ -14,6 +14,7 @@
#include "util/debug.h"
#include "util/log.h"
#include "util/os_misc.h"
#include "vk_enum_to_str.h"
#if __STDC_VERSION__ >= 201112L
@ -35,7 +36,7 @@ uint64_t vn_debug;
static void
vn_debug_init_once(void)
{
vn_debug = parse_debug_string(getenv("VN_DEBUG"), vn_debug_options);
vn_debug = parse_debug_string(os_get_option("VN_DEBUG"), vn_debug_options);
}
void

View file

@ -41,7 +41,7 @@
#define VN_DEFAULT_ALIGN 8
#define VN_DEBUG(category) unlikely(vn_debug &VN_DEBUG_##category)
#define VN_DEBUG(category) unlikely(vn_debug & VN_DEBUG_##category)
#define vn_error(instance, error) \
(VN_DEBUG(RESULT) ? vn_log_result((instance), (error), __func__) : (error))