diff options
author | Joen Chen <joenchen@google.com> | 2023-05-16 21:22:50 +0000 |
---|---|---|
committer | Joen Chen <joenchen@google.com> | 2023-05-17 05:28:23 +0000 |
commit | fcbbd30ad103297adf4814f03abc9310da9be4b9 (patch) | |
tree | 90c8f9f90258c35bad515eaf58c5b621dcbed6e8 | |
parent | 90179609edfcd74b801c966d6c960ebef3354a5a (diff) | |
download | common-fcbbd30ad103297adf4814f03abc9310da9be4b9.tar.gz |
libhwc2.1: each display should have respective boot property
HWC should provide each display with a respective boot property.
Considering OTA, we keep the property string for display with
id 0, and give another property string for other displays.
Bug: 282126684
Test: VTS “run vts -m VtsHalGraphicsComposer3_TargetTest -t
PerInstance/GraphicsComposerAidlTest#GetPreferredBootDisplay
Config/0_android_hardware_graphics_composer3_IComposer_default”
Change-Id: Ieb00906bdf4ad949710e3469476cab0df734b9b4
-rw-r--r-- | libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp index fb925db..c5ead2c 100644 --- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp +++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp @@ -43,7 +43,15 @@ static const std::map<const DisplayType, const std::string> panelSysfsPath = {{DisplayType::DISPLAY_PRIMARY, "/sys/devices/platform/exynos-drm/primary-panel/"}, {DisplayType::DISPLAY_SECONDARY, "/sys/devices/platform/exynos-drm/secondary-panel/"}}; -static constexpr const char *PROPERTY_BOOT_MODE = "persist.vendor.display.primary.boot_config"; +static String8 getPropertyBootModeStr(const int32_t dispId) { + String8 str; + if (dispId == 0) { + str.appendFormat("persist.vendor.display.primary.boot_config"); + } else { + str.appendFormat("persist.vendor.display.%d.primary.boot_config", dispId); + } + return str; +} static std::string loadPanelGammaCalibration(const std::string &file) { std::ifstream ifs(file); @@ -240,13 +248,13 @@ int32_t ExynosPrimaryDisplay::setBootDisplayConfig(int32_t config) { ALOGD("%s: mode=%s (%d) vsyncPeriod=%d", __func__, modeStr, config, mode.vsyncPeriod); - ret = property_set(PROPERTY_BOOT_MODE, modeStr); + ret = property_set(getPropertyBootModeStr(mDisplayId).string(), modeStr); return !ret ? HWC2_ERROR_NONE : HWC2_ERROR_BAD_CONFIG; } int32_t ExynosPrimaryDisplay::clearBootDisplayConfig() { - auto ret = property_set(PROPERTY_BOOT_MODE, nullptr); + auto ret = property_set(getPropertyBootModeStr(mDisplayId).string(), nullptr); ALOGD("%s: clearing boot mode", __func__); return !ret ? HWC2_ERROR_NONE : HWC2_ERROR_BAD_CONFIG; @@ -254,7 +262,7 @@ int32_t ExynosPrimaryDisplay::clearBootDisplayConfig() { int32_t ExynosPrimaryDisplay::getPreferredDisplayConfigInternal(int32_t *outConfig) { char modeStr[PROPERTY_VALUE_MAX]; - auto ret = property_get(PROPERTY_BOOT_MODE, modeStr, ""); + auto ret = property_get(getPropertyBootModeStr(mDisplayId).string(), modeStr, ""); if (ret <= 0) { return mDisplayInterface->getDefaultModeId(outConfig); |