intel: print debug either to stdout or `logcat' depending on platform.
authorOliver McFadden <oliver.mcfadden@linux.intel.com>
Tue, 25 Sep 2012 14:47:45 +0000 (17:47 +0300)
committerOliver McFadden <oliver.mcfadden@linux.intel.com>
Fri, 12 Oct 2012 08:14:54 +0000 (11:14 +0300)
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/Android.mk
src/mesa/drivers/dri/intel/intel_context.h

index 577f66408a519be589aa8dab4ff3fe4be222fa23..d6196bb4326a553dcac5e67f6fe4e540062125c3 100644 (file)
@@ -34,7 +34,8 @@ MESA_DRI_MODULE_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/dri
 MESA_DRI_CFLAGS := \
        -DFEATURE_GL=1 \
        -DFEATURE_ES1=1 \
-       -DFEATURE_ES2=1
+       -DFEATURE_ES2=1 \
+       -DHAVE_ANDROID_PLATFORM
 
 MESA_DRI_C_INCLUDES := \
        $(addprefix $(MESA_TOP)/, $(mesa_dri_common_INCLUDES)) \
index d16101d7c17e1b428e799971eb96b7c224885df6..b732696bdafe7b1f889715607005a54cd66e0714 100644 (file)
@@ -457,19 +457,30 @@ extern int INTEL_DEBUG;
 #define DEBUG_CLIP      0x2000000
 #define DEBUG_AUB       0x4000000
 
+#ifdef HAVE_ANDROID_PLATFORM
+#define LOG_TAG "INTEL-MESA"
+#include <cutils/log.h>
+#ifndef ALOGW
+#define ALOGW LOGW
+#endif
+#define dbg_printf(...)        ALOGW(__VA_ARGS__)
+#else
+#define dbg_printf(...)        printf(__VA_ARGS__)
+#endif /* HAVE_ANDROID_PLATFORM */
+
 #define DBG(...) do {                                          \
        if (unlikely(INTEL_DEBUG & FILE_DEBUG_FLAG))            \
-               printf(__VA_ARGS__);                    \
+               dbg_printf(__VA_ARGS__);                        \
 } while(0)
 
 #define fallback_debug(...) do {                               \
        if (unlikely(INTEL_DEBUG & DEBUG_PERF))                 \
-               printf(__VA_ARGS__);                            \
+               dbg_printf(__VA_ARGS__);                        \
 } while(0)
 
 #define perf_debug(...) do {                                   \
        if (unlikely(INTEL_DEBUG & DEBUG_PERF))                 \
-               printf(__VA_ARGS__);                            \
+               dbg_printf(__VA_ARGS__);                        \
 } while(0)
 
 #define PCI_CHIP_845_G                 0x2562