hwc: Add scalar tag to dynamic debug

Expand dynamic debug function to allow scalar logging.

Change-Id: Ib1fb19788902dbcc0179856e139d3e3146ae8e52
CRs-Fixed: 2063587
diff --git a/libqservice/IQService.h b/libqservice/IQService.h
index 5e327d7..8985dd6 100644
--- a/libqservice/IQService.h
+++ b/libqservice/IQService.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 The Android Open Source Project
- * Copyright (C) 2012-2014, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (C) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Not a Contribution, Apache license notifications and license are
  * retained for attribution purposes only.
@@ -93,6 +93,7 @@
         DEBUG_DRIVER_CONFIG,
         DEBUG_ROTATOR,
         DEBUG_QDCM,
+        DEBUG_SCALAR,
     };
 
     enum {
diff --git a/sdm/libs/hwc/hwc_debugger.cpp b/sdm/libs/hwc/hwc_debugger.cpp
index 0cc0501..ffbb5c5 100644
--- a/sdm/libs/hwc/hwc_debugger.cpp
+++ b/sdm/libs/hwc/hwc_debugger.cpp
@@ -98,6 +98,16 @@
   }
 }
 
+void HWCDebugHandler::DebugScalar(bool enable, int verbose_level) {
+  if (enable) {
+    debug_flags_[kTagScalar] = 1;
+    verbose_level_ = verbose_level;
+  } else {
+    debug_flags_[kTagScalar] = 0;
+    verbose_level_ = 0;
+  }
+}
+
 void HWCDebugHandler::DebugQdcm(bool enable, int verbose_level) {
   if (enable) {
     debug_flags_[kTagQDCM] = 1;
diff --git a/sdm/libs/hwc/hwc_debugger.h b/sdm/libs/hwc/hwc_debugger.h
index 01319ab..9790413 100644
--- a/sdm/libs/hwc/hwc_debugger.h
+++ b/sdm/libs/hwc/hwc_debugger.h
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2014 - 2016, The Linux Foundation. All rights reserved.
+* Copyright (c) 2014 - 2017, 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
@@ -50,6 +50,7 @@
   static void DebugCompManager(bool enable, int verbose_level);
   static void DebugDriverConfig(bool enable, int verbose_level);
   static void DebugRotator(bool enable, int verbose_level);
+  static void DebugScalar(bool enable, int verbose_level);
   static void DebugQdcm(bool enable, int verbose_level);
   static int  GetIdleTimeoutMs();
 
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index 2bf7d4d..71aa574 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -1293,6 +1293,10 @@
       HWCDebugHandler::DebugQdcm(enable, verbose_level);
       break;
 
+    case qService::IQService::DEBUG_SCALAR:
+      HWCDebugHandler::DebugScalar(enable, verbose_level);
+      break;
+
     default:
       DLOGW("type = %d is not supported", type);
   }