sde: Snapdragon Display Engine (SDE) implementation skeleton.
Define classes and files required for SDE implementation.
Change-Id: Ic2d8572699b895f1980c7c127301e9ce0d4c8b03
diff --git a/displayengine/libs/utils/Android.mk b/displayengine/libs/utils/Android.mk
new file mode 100644
index 0000000..d5ba512
--- /dev/null
+++ b/displayengine/libs/utils/Android.mk
@@ -0,0 +1,13 @@
+LOCAL_PATH := $(call my-dir)
+include hardware/qcom/display/displayengine/libs/common.mk
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libsdeutils
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes)
+LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"SDE\"
+LOCAL_SHARED_LIBRARIES := $(common_libs)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
+LOCAL_SRC_FILES := debug_android.cpp
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/displayengine/libs/utils/debug_android.cpp b/displayengine/libs/utils/debug_android.cpp
new file mode 100644
index 0000000..09b32fe
--- /dev/null
+++ b/displayengine/libs/utils/debug_android.cpp
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2014, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification, are permitted
+* provided that the following conditions are met:
+* * Redistributions of source code must retain the above copyright notice, this list of
+* conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright notice, this list of
+* conditions and the following disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of The Linux Foundation nor the names of its contributors may be used to
+* endorse or promote products derived from this software without specific prior written
+* permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+#include <utils/debug.h>
+#include <cutils/log.h>
+#include <cutils/properties.h>
+
+namespace sde {
+
+Debug Debug::debug_;
+
+Debug::Debug() : virtual_driver_(false) {
+ char property[PROPERTY_VALUE_MAX];
+ if (property_get("displaycore.virtualdriver", property, NULL) > 0) {
+ virtual_driver_ = (atoi(property) == 1);
+ }
+}
+
+void Debug::Error(const LogTag & /*tag*/, const char *format, ...) {
+ va_list list;
+ va_start(list, format);
+ __android_log_vprint(ANDROID_LOG_ERROR, LOG_TAG, format, list);
+}
+
+void Debug::Warning(const LogTag & /*tag*/, const char *format, ...) {
+ va_list list;
+ va_start(list, format);
+ __android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, format, list);
+}
+
+void Debug::Info(const LogTag & /*tag*/, const char *format, ...) {
+ va_list list;
+ va_start(list, format);
+ __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, list);
+}
+
+void Debug::Verbose(const LogTag & /*tag*/, const char *format, ...) {
+ va_list list;
+ va_start(list, format);
+ __android_log_vprint(ANDROID_LOG_VERBOSE, LOG_TAG, format, list);
+}
+
+} // namespace sde
+