diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | packaging/mesa.spec | 1 | ||||
-rw-r--r-- | src/egl/main/egllog.c | 35 |
3 files changed, 36 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index ebcdc3eb20e..399c98c3520 100644 --- a/configure.ac +++ b/configure.ac @@ -1896,7 +1896,7 @@ for plat in $platforms; do ;; tizen) - PKG_CHECK_MODULES([TIZEN], [tpl-egl libtbm libtdm wayland-client]) + PKG_CHECK_MODULES([TIZEN], [tpl-egl libtbm libtdm wayland-client dlog]) DEFINES="$DEFINES -DHAVE_TIZEN_PLATFORM" ;; *) diff --git a/packaging/mesa.spec b/packaging/mesa.spec index 000fb577e48..31cea6fe688 100644 --- a/packaging/mesa.spec +++ b/packaging/mesa.spec @@ -33,6 +33,7 @@ BuildRequires: pkgconfig(tpl-egl) BuildRequires: pkgconfig(libtbm) BuildRequires: pkgconfig(libtdm) BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(dlog) %ifarch x86_64 %ix86 BuildRequires: pkgconfig(libdrm_intel) >= 2.4.24 %endif diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c index c223f49b0fe..de4bee26c0e 100644 --- a/src/egl/main/egllog.c +++ b/src/egl/main/egllog.c @@ -44,6 +44,10 @@ #include "util/macros.h" #include "egllog.h" +#ifdef HAVE_TIZEN_PLATFORM +#define LOG_TAG "MESA" +#include <dlog.h> +#endif #ifdef HAVE_ANDROID_PLATFORM #define LOG_TAG "EGL-MAIN" @@ -56,7 +60,7 @@ #endif /* HAVE_ANDROID_PLATFORM */ #define MAXSTRING 1000 -#define FALLBACK_LOG_LEVEL _EGL_WARNING +#define FALLBACK_LOG_LEVEL _EGL_FATAL static struct { @@ -78,6 +82,7 @@ static const char *level_strings[] = { }; +#ifndef HAVE_TIZEN_PLATFORM /** * The default logger. It prints the message to stderr. */ @@ -96,6 +101,7 @@ _eglDefaultLogger(EGLint level, const char *msg) fprintf(stderr, "libEGL %s: %s\n", level_strings[level], msg); #endif /* HAVE_ANDROID_PLATFORM */ } +#endif /** @@ -153,13 +159,40 @@ _eglLog(EGLint level, const char *fmtStr, ...) mtx_lock(&logging.mutex); +#ifdef HAVE_TIZEN_PLATFORM + log_priority dlog_prio; + + switch (level) { + case _EGL_FATAL: + dlog_prio = DLOG_ERROR; + break; + case _EGL_WARNING: + dlog_prio = DLOG_WARN; + break; + case _EGL_INFO: + dlog_prio = DLOG_INFO; + break; + case _EGL_DEBUG: + dlog_prio = DLOG_DEBUG; + break; + default: + return; + } +#endif + va_start(args, fmtStr); +#ifdef HAVE_TIZEN_PLATFORM + __dlog_vprint(LOG_ID_SYSTEM, dlog_prio, LOG_TAG, fmtStr, args); +#else ret = vsnprintf(msg, MAXSTRING, fmtStr, args); if (ret < 0 || ret >= MAXSTRING) strcpy(msg, "<message truncated>"); +#endif va_end(args); +#ifndef HAVE_TIZEN_PLATFORM _eglDefaultLogger(level, msg); +#endif mtx_unlock(&logging.mutex); |