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/core/comp_manager.cpp b/sdm/libs/core/comp_manager.cpp
index b98c74e..d1530dc 100644
--- a/sdm/libs/core/comp_manager.cpp
+++ b/sdm/libs/core/comp_manager.cpp
@@ -119,6 +119,7 @@
// resources for the added display is configured properly.
if (!display_comp_ctx->is_primary_panel) {
safe_mode_ = true;
+ max_sde_ext_layers_ = UINT32(Debug::GetExtMaxlayers());
}
DLOGV_IF(kTagCompManager, "registered display bit mask 0x%x, configured display bit mask 0x%x, " \
@@ -213,7 +214,7 @@
// Limit 2 layer SDE Comp if its not a Primary Display
if (!display_comp_ctx->is_primary_panel) {
- constraints->max_layers = 2;
+ constraints->max_layers = max_sde_ext_layers_;
}
// If a strategy fails after successfully allocating resources, then set safe mode
diff --git a/sdm/libs/core/comp_manager.h b/sdm/libs/core/comp_manager.h
index 86554b9..ebb257b 100644
--- a/sdm/libs/core/comp_manager.h
+++ b/sdm/libs/core/comp_manager.h
@@ -106,6 +106,7 @@
HWResourceInfo hw_res_info_;
ExtensionInterface *extension_intf_ = NULL;
uint32_t max_layers_ = kMaxSDELayers;
+ uint32_t max_sde_ext_layers_ = 0;
};
} // namespace sdm
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;