sdm: Change idle fallback time dynamically.

- Query composition manager for an optimal
  idle time for the current draw cycle.
- Avoid setting same idle time again on sysfs.

CRs-Fixed: 2011276
Change-Id: I4afde21ad630953d5f701fb3d123435028bdfef2
diff --git a/sdm/include/utils/constants.h b/sdm/include/utils/constants.h
index 72b1bed..5efe357 100644
--- a/sdm/include/utils/constants.h
+++ b/sdm/include/utils/constants.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 met:
@@ -48,6 +48,8 @@
 #define ROUND_UP_ALIGN_UP(value, a) FLOAT(CeilToMultipleOf(UINT32(value + 0.5f), UINT32(a)))
 
 #define IDLE_TIMEOUT_DEFAULT_MS 70
+#define IDLE_TIMEOUT_ACTIVE_MS IDLE_TIMEOUT_DEFAULT_MS
+#define IDLE_TIMEOUT_INACTIVE_MS 520
 
 #define IS_RGB_FORMAT(format) (((format) < kFormatYCbCr420Planar) ? true: false)
 
diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h
index 540a25e..21805ee 100644
--- a/sdm/include/utils/debug.h
+++ b/sdm/include/utils/debug.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
@@ -64,7 +64,7 @@
   static inline DebugHandler* Get() { return debug_.debug_handler_; }
   static int GetSimulationFlag();
   static int GetHDMIResolution();
-  static uint32_t GetIdleTimeoutMs();
+  static void GetIdleTimeoutMs(uint32_t *active_ms, uint32_t *inactive_ms);
   static int GetBootAnimLayerCount();
   static bool IsRotatorDownScaleDisabled();
   static bool IsDecimationDisabled();