From 2c10439ea1e09f0278d63bbdfc25a6b625658ba0 Mon Sep 17 00:00:00 2001 From: Maksim Belov <45949002+artdeell@users.noreply.github.com> Date: Mon, 27 Nov 2023 20:12:30 +0300 Subject: [PATCH] Fix[build]: re-add os_misc and trace patches --- mesa-zink.diff | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/mesa-zink.diff b/mesa-zink.diff index 252f547..f8fbfbb 100644 --- a/mesa-zink.diff +++ b/mesa-zink.diff @@ -151,3 +151,94 @@ index d16e785..0652936 100644 version : '8.0.0', darwin_versions : '9.0.0', install : true, +diff --git a/src/util/os_misc.c b/src/util/os_misc.c +index 6ae97b9..6898db0 100644 +--- a/src/util/os_misc.c ++++ b/src/util/os_misc.c +@@ -128,62 +128,10 @@ os_log_message(const char *message) + #endif + } + +-#if DETECT_OS_ANDROID +-# include +-# include "c11/threads.h" +- +-/** +- * Get an option value from android's property system, as a fallback to +- * getenv() (which is generally less useful on android due to processes +- * typically being forked from the zygote. +- * +- * The option name used for getenv is translated into a property name +- * by: +- * +- * 1) convert to lowercase +- * 2) replace '_' with '.' +- * 3) if necessary, prepend "mesa." +- * +- * For example: +- * - MESA_EXTENSION_OVERRIDE -> mesa.extension.override +- * - GALLIUM_HUD -> mesa.gallium.hud +- * +- */ +-static char * +-os_get_android_option(const char *name) +-{ +- static thread_local char os_android_option_value[PROPERTY_VALUE_MAX]; +- char key[PROPERTY_KEY_MAX]; +- char *p = key, *end = key + PROPERTY_KEY_MAX; +- /* add "mesa." prefix if necessary: */ +- if (strstr(name, "MESA_") != name) +- p += strlcpy(p, "mesa.", end - p); +- p += strlcpy(p, name, end - p); +- for (int i = 0; key[i]; i++) { +- if (key[i] == '_') { +- key[i] = '.'; +- } else { +- key[i] = tolower(key[i]); +- } +- } +- +- int len = property_get(key, os_android_option_value, NULL); +- if (len > 1) { +- return os_android_option_value; +- } +- return NULL; +-} +-#endif +- + const char * + os_get_option(const char *name) + { + const char *opt = getenv(name); +-#if DETECT_OS_ANDROID +- if (!opt) { +- opt = os_get_android_option(name); +- } +-#endif + return opt; + } + +diff --git a/src/util/perf/cpu_trace.h b/src/util/perf/cpu_trace.h +index a4ba4d7..4dbc30c 100644 +--- a/src/util/perf/cpu_trace.h ++++ b/src/util/perf/cpu_trace.h +@@ -27,19 +27,6 @@ + util_perfetto_trace_end(category); \ + } while (0) + +-/* NOTE: for now disable atrace for C++ to workaround a ndk bug with ordering +- * between stdatomic.h and atomic.h. See: +- * +- * https://github.com/android/ndk/issues/1178 +- */ +-#elif defined(ANDROID) && !defined(__cplusplus) +- +-#include +- +-#define _MESA_TRACE_BEGIN(category, name) \ +- atrace_begin(ATRACE_TAG_GRAPHICS, name) +-#define _MESA_TRACE_END(category) atrace_end(ATRACE_TAG_GRAPHICS) +- + #else + + #define _MESA_TRACE_BEGIN(category, name)