From a049cff2414c772d4bc03012ff4e0ee0247c64e2 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 6 Apr 2021 00:50:36 +0000 Subject: [PATCH] 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 Reviewed-by: Chia-I Wu Part-of: --- src/virtio/vulkan/vn_common.c | 3 ++- src/virtio/vulkan/vn_common.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/virtio/vulkan/vn_common.c b/src/virtio/vulkan/vn_common.c index 61aea98c41b..9d6be361b57 100644 --- a/src/virtio/vulkan/vn_common.c +++ b/src/virtio/vulkan/vn_common.c @@ -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 diff --git a/src/virtio/vulkan/vn_common.h b/src/virtio/vulkan/vn_common.h index ca2195b1d83..40d08b2049e 100644 --- a/src/virtio/vulkan/vn_common.h +++ b/src/virtio/vulkan/vn_common.h @@ -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))