From 712b42a69d898c96dfd399f6358002e2c7f892d8 Mon Sep 17 00:00:00 2001 From: Zhaowei Yuan Date: Thu, 5 Sep 2019 09:50:06 +0800 Subject: Implement dlog for mesa main Log API for mesa main module are all implemented in file src/mesa/main/error.c, re-implement them based on dlog for debug convenience Change-Id: I8bd02b2f8705ea92da2657d0ca34f4ef1d8ae707 Signed-off-by: Zhaowei Yuan --- src/mesa/Makefile.am | 6 ++++-- src/mesa/main/errors.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am index d7daa995c5c..68a5308c607 100644 --- a/src/mesa/Makefile.am +++ b/src/mesa/Makefile.am @@ -155,7 +155,8 @@ libmesa_la_SOURCES = \ libmesa_la_LIBADD = \ $(top_builddir)/src/compiler/glsl/libglsl.la \ - $(ARCH_LIBS) + $(ARCH_LIBS) \ + $(TIZEN_LIBS) libmesagallium_la_SOURCES = \ $(MESA_GALLIUM_FILES) \ @@ -165,7 +166,8 @@ libmesagallium_la_SOURCES = \ libmesagallium_la_LIBADD = \ $(top_builddir)/src/compiler/glsl/libglsl.la \ - $(ARCH_LIBS) + $(ARCH_LIBS) \ + $(TIZEN_LIBS) libmesa_sse41_la_SOURCES = \ $(X86_SSE41_FILES) diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index a9687913627..dec24590992 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -36,6 +36,10 @@ #include "context.h" #include "debug_output.h" +#ifdef HAVE_TIZEN_PLATFORM +#define LOG_TAG "MESA" +#include +#endif static FILE *LogFile = NULL; @@ -146,7 +150,11 @@ _mesa_warning( struct gl_context *ctx, const char *fmtString, ... ) if (ctx) flush_delayed_errors( ctx ); +#ifdef HAVE_TIZEN_PLATFORM + dlog_vprint(DLOG_WARN, LOG_TAG, fmtString, args); +#else output_if_debug("Mesa warning", str, GL_TRUE); +#endif } @@ -172,9 +180,13 @@ _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) va_start( args, fmtString ); _mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args ); va_end( args ); +#ifdef HAVE_TIZEN_PLATFORM + dlog_vprint(DLOG_WARN, LOG_TAG, fmtString, args); +#else fprintf(stderr, "Mesa " PACKAGE_VERSION " implementation error: %s\n", str); fprintf(stderr, "Please report at " PACKAGE_BUGREPORT "\n"); +#endif } } @@ -316,7 +328,11 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) /* Print the error to stderr if needed. */ if (do_output) { +#ifdef HAVE_TIZEN_PLATFORM + dlog_vprint(DLOG_ERROR, LOG_TAG, fmtString, args); +#else output_if_debug("Mesa: User error", s2, GL_TRUE); +#endif } /* Log the error via ARB_debug_output if needed.*/ @@ -354,7 +370,12 @@ _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) va_start(args, fmtString); _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); va_end(args); + +#ifdef HAVE_TIZEN_PLATFORM + dlog_vprint(DLOG_DEBUG, LOG_TAG, fmtString, args); +#else output_if_debug("Mesa", s, GL_FALSE); +#endif #endif /* DEBUG */ (void) ctx; (void) fmtString; @@ -369,7 +390,11 @@ _mesa_log(const char *fmtString, ...) va_start(args, fmtString); _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); va_end(args); +#ifdef HAVE_TIZEN_PLATFORM + dlog_vprint(DLOG_INFO, LOG_TAG, fmtString, args); +#else output_if_debug("", s, GL_FALSE); +#endif } -- cgit v1.2.3