sdm: drm: Add Atomic commit support

Add support for atomic commit, MDP comp for the peripheral display.

Change-Id: I579d3379ba97cbc73485a4434bf29126226e2f85
CRs-fixed: 1114808
diff --git a/libdrmutils/drm_logger.h b/libdrmutils/drm_logger.h
index b332ea0..d0b0773 100644
--- a/libdrmutils/drm_logger.h
+++ b/libdrmutils/drm_logger.h
@@ -38,6 +38,7 @@
  public:
   virtual ~DRMLogger() {}
   virtual void Error(const char *format, ...) = 0;
+  virtual void Warning(const char *format, ...) = 0;
   virtual void Info(const char *format, ...) = 0;
   virtual void Debug(const char *format, ...) = 0;
 
@@ -48,28 +49,21 @@
   static DRMLogger *s_instance;
 };
 
-template <typename... T>
-void DRM_LOGE(const char *format, T&&... args) {
-  if (DRMLogger::Get()) {
-    DRMLogger::Get()->Error(format, std::forward<T>(args)...);
+#define DRM_LOG(method, format, ...)                            \
+  if (drm_utils::DRMLogger::Get()) {                            \
+    drm_utils::DRMLogger::Get()->method(format, ##__VA_ARGS__); \
   }
-}
 
-template <typename... T>
-void DRM_LOGI(const char *format, T&&... args) {
-  if (DRMLogger::Get()) {
-    DRMLogger::Get()->Info(format, std::forward<T>(args)...);
-  }
-}
+#define DRM_LOG_CONTEXT(method, format, ...) \
+  DRM_LOG(method, __CLASS__ "::%s: " format, __FUNCTION__, ##__VA_ARGS__);
 
-template <typename... T>
-void DRM_LOGD_IF(bool pred, const char *format, T&&... args) {
-  if (pred && DRMLogger::Get()) {
-    DRMLogger::Get()->Debug(format, std::forward<T>(args)...);
-  }
-}
+#define DRM_LOGE(format, ...) DRM_LOG_CONTEXT(Error, format, ##__VA_ARGS__)
+#define DRM_LOGW(format, ...) DRM_LOG_CONTEXT(Warning, format, ##__VA_ARGS__)
+#define DRM_LOGI(format, ...) DRM_LOG_CONTEXT(Info, format, ##__VA_ARGS__)
+#define DRM_LOGD_IF(pred, format, ...) \
+  if (pred)                            \
+  DRM_LOG_CONTEXT(Debug, format, ##__VA_ARGS__)
 
 }  // namespace drm_utils
 
 #endif  // __DRM_LOGGER_H__
-