sdm/hwc: add display indices property for client id init
Add display indices property for aosp build without ExSurfaceFlinger,
to allow special display hwcId generated by vendor HWC for each type
of displays.
Change-Id: I389c98c3e54c6280597b2a6b7a63d624a799310f
diff --git a/sdm/libs/hwc2/Android.mk b/sdm/libs/hwc2/Android.mk
index a9052e0..9e11411 100644
--- a/sdm/libs/hwc2/Android.mk
+++ b/sdm/libs/hwc2/Android.mk
@@ -80,6 +80,10 @@
LOCAL_SHARED_LIBRARIES += vendor.display.config@1.8
endif
+ifeq ($(TARGET_BOARD_AUTO), true)
+LOCAL_CFLAGS += -DCONFIG_BASEID_FROM_PROP
+endif
+
LOCAL_SRC_FILES := hwc_session.cpp \
hwc_session_services.cpp \
hwc_display.cpp \
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index 23d2ab4..13769df 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -169,6 +169,29 @@
InitDisplaySlots();
+#if defined(DISPLAY_CONFIG_1_2) && defined(CONFIG_BASEID_FROM_PROP)
+ char indices[kPropertyMax];
+ uint32_t index_start, index_size;
+ if (Debug::Get()->GetProperty(BUILTIN_BASEID_AND_SIZE_PROP, indices) == kErrorNone) {
+ if (std::sscanf(indices, "%d,%d", &index_start, &index_size) == 2) {
+ setDisplayIndex(IDisplayConfig::DisplayTypeExt::DISPLAY_BUILTIN,
+ index_start, index_size);
+ }
+ }
+ if (Debug::Get()->GetProperty(PLUGGABLE_BASEID_AND_SIZE_PROP, indices) == kErrorNone) {
+ if (std::sscanf(indices, "%d,%d", &index_start, &index_size) == 2) {
+ setDisplayIndex(IDisplayConfig::DisplayTypeExt::DISPLAY_PLUGGABLE,
+ index_start, index_size);
+ }
+ }
+ if (Debug::Get()->GetProperty(VIRTUAL_BASEID_AND_SIZE_PROP, indices) == kErrorNone) {
+ if (std::sscanf(indices, "%d,%d", &index_start, &index_size) == 2) {
+ setDisplayIndex(IDisplayConfig::DisplayTypeExt::DISPLAY_VIRTUAL,
+ index_start, index_size);
+ }
+ }
+#endif
+
// Start QService and connect to it.
qService::QService::init();
android::sp<qService::IQService> iqservice = android::interface_cast<qService::IQService>(