sdm : Allow configurable sdm layer limit for external

In non split configurations with more available  pipes, oem
can choose to relax the restriction on number of overlays for
external displays and configure it as per their UX preference
by setting the limit with "sdm.max_external_layers".

Change-Id: I9cd24077af9681485b6816d7f0318495d5da823c
CRs-Fixed: 1024969
diff --git a/sdm/libs/utils/debug.cpp b/sdm/libs/utils/debug.cpp
index 4a8e070..e1024dd 100644
--- a/sdm/libs/utils/debug.cpp
+++ b/sdm/libs/utils/debug.cpp
@@ -31,6 +31,7 @@
 #include <utils/debug.h>
 #include <utils/constants.h>
 #include <string>
+#include <algorithm>
 
 namespace sdm {
 
@@ -178,6 +179,13 @@
   return kErrorNone;
 }
 
+int Debug::GetExtMaxlayers() {
+  int max_external_layers = 0;
+  debug_.debug_handler_->GetProperty("sdm.max_external_layers", &max_external_layers);
+
+  return std::max(max_external_layers, 2);
+}
+
 bool Debug::GetProperty(const char* property_name, char* value) {
   if (debug_.debug_handler_->GetProperty(property_name, value) != kErrorNone) {
     return false;