diff options
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/Android.mk | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/os/os_misc.c | 12 | ||||
-rw-r--r-- | src/gallium/auxiliary/pipe-loader/pipe_loader.h | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 9 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug.c | 2 |
5 files changed, 24 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk index f5b5a0c..b279c3b 100644 --- a/src/gallium/auxiliary/Android.mk +++ b/src/gallium/auxiliary/Android.mk @@ -46,7 +46,7 @@ endif # We need libmesa_nir to get NIR's generated include directories. LOCAL_MODULE := libmesa_gallium -LOCAL_STATIC_LIBRARIES += libmesa_nir +LOCAL_STATIC_LIBRARIES := libmesa_nir libLLVMCore # generate sources LOCAL_MODULE_CLASS := STATIC_LIBRARIES diff --git a/src/gallium/auxiliary/os/os_misc.c b/src/gallium/auxiliary/os/os_misc.c index 09d4400..a4d9628 100644 --- a/src/gallium/auxiliary/os/os_misc.c +++ b/src/gallium/auxiliary/os/os_misc.c @@ -46,8 +46,10 @@ #endif - -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS) +#if defined(PIPE_OS_ANDROID) +# define LOG_TAG "gallium" +# include <log/log.h> +#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS) # include <unistd.h> #elif defined(PIPE_OS_APPLE) || defined(PIPE_OS_BSD) # include <sys/sysctl.h> @@ -100,6 +102,12 @@ os_log_message(const char *message) fflush(fout); } #else /* !PIPE_SUBSYSTEM_WINDOWS */ +#if defined(PIPE_OS_ANDROID) + if (fout == stderr) { + ALOGD("%s", message); + return; + } +#endif fflush(stdout); fputs(message, fout); fflush(fout); diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h index 690d088..19d269f 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h @@ -180,6 +180,9 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev); bool pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd); +struct pipe_screen * +load_pipe_screen(struct pipe_loader_device **dev, int fd); + #ifdef __cplusplus } #endif diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c index 2b7ab27..f72a94f 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -294,3 +294,12 @@ static const struct pipe_loader_ops pipe_loader_drm_ops = { .configuration = pipe_loader_drm_configuration, .release = pipe_loader_drm_release }; + +PUBLIC struct pipe_screen *load_pipe_screen(struct pipe_loader_device **dev, int fd) +{ + struct pipe_screen *pscreen = NULL; + if (pipe_loader_drm_probe_fd(dev, fd)) { + pscreen = pipe_loader_create_screen(*dev); + } + return pscreen; +} diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index dd3e167..6ccc4f6 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -55,7 +55,7 @@ void _debug_vprintf(const char *format, va_list ap) { static char buf[4096] = {'\0'}; -#if defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_EMBEDDED) +#if defined(PIPE_OS_WINDOWS) || defined(PIPE_OS_ANDROID) || defined(PIPE_SUBSYSTEM_EMBEDDED) /* We buffer until we find a newline. */ size_t len = strlen(buf); int ret = util_vsnprintf(buf + len, sizeof(buf) - len, format, ap); |