Skip to content

Commit

Permalink
test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed Nov 20, 2023
1 parent 7b9fcbf commit 7219ef7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/android_stub/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if with_android_stub
stub_libs = []
lib_names = ['cutils', 'hardware', 'log', 'nativewindow', 'sync']
lib_names = ['hardware', 'log', 'nativewindow', 'sync']

if with_libbacktrace
lib_names += ['backtrace']
Expand Down
10 changes: 5 additions & 5 deletions src/gallium/auxiliary/target-helpers/inline_sw_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@
#ifdef GALLIUM_D3D12
#include "d3d12/d3d12_public.h"
#endif

#ifdef GALLIUM_FREEDRENO
#include "freedreno/freedreno_screen.h"
#endif

#ifdef
#if defined(GALLIUM_ASAHI) && __APPLE__
#include "asahi/agx_public.h"
#endif
Expand Down Expand Up @@ -82,6 +78,10 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver)
return screen ? debug_screen_wrap(screen) : NULL;
}

struct pipe_screen *fd_screen_create(int fd,
const struct pipe_screen_config *config,
struct renderonly *ro);

#if defined(GALLIUM_FREEDRENO)
if(screen == NULL && strcmp(driver, "freedreno") == 0) {
int kbase_device_fd = open("/dev/kgsl-3d0", O_RDWR | O_CLOEXEC | O_NONBLOCK);
Expand Down
53 changes: 0 additions & 53 deletions src/util/os_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
# define LOG_TAG "MESA"
# include <unistd.h>
# include <log/log.h>
# include <cutils/properties.h>
#elif DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || DETECT_OS_HURD
# include <unistd.h>
#elif DETECT_OS_OPENBSD || DETECT_OS_FREEBSD
Expand Down Expand Up @@ -128,62 +127,10 @@ os_log_message(const char *message)
#endif
}

#if DETECT_OS_ANDROID
# include <ctype.h>
# 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;
}

Expand Down

0 comments on commit 7219ef7

Please sign in to comment.