diff options
author | Shiyong Li <shiyongli@google.com> | 2023-04-28 03:33:54 +0000 |
---|---|---|
committer | Shiyong Li <shiyongli@google.com> | 2023-04-28 04:42:57 +0000 |
commit | 1abbf939c3f289ec65a30036fb09c81f12d63f59 (patch) | |
tree | c201d3331c76199206a2d86467e9e4f4e7ac7774 | |
parent | ac2244a3bb63910006021ed3eaf3b78bd6bf6ecb (diff) | |
download | zuma-1abbf939c3f289ec65a30036fb09c81f12d63f59.tar.gz |
libhwc2.1: OperationRateManager: correct HS switching condition
Switch to desired HS immediately even if DVB delta < 10.
Bug: 277682793
Bug: 277713157
Test: auto suspend/resume, cover als, check op rate
Signed-off-by: Shiyong Li <shiyongli@google.com>
Change-Id: Iace928b73f9ec70d38a3945e2caa9e3b94b555a9
-rw-r--r-- | libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp index 48e8654..f036c45 100644 --- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp +++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp @@ -170,7 +170,7 @@ int32_t ExynosPrimaryDisplayModule::OperationRateManager::updateOperationRateLoc desiredOpRate = mDisplayNsOperationRate; } // check blocking zone - if (mDisplayLastDbv < mDisplayNsMinDbv || dbv < mDisplayNsMinDbv) { + if (dbv < mDisplayNsMinDbv) { desiredOpRate = mDisplayHsOperationRate; } @@ -195,7 +195,9 @@ int32_t ExynosPrimaryDisplayModule::OperationRateManager::updateOperationRateLoc } else if (cond == DispOpCondition::SET_DBV) { // TODO: tune brightness delta for different brightness curve and values int32_t delta = abs(dbv - mDisplayLastDbv); - if (delta > BRIGHTNESS_DELTA_THRESHOLD) effectiveOpRate = desiredOpRate; + if ((desiredOpRate == mDisplayHsOperationRate) || (delta > BRIGHTNESS_DELTA_THRESHOLD)) { + effectiveOpRate = desiredOpRate; + } mDisplayLastDbv = dbv; if (effectiveOpRate > LP_OP_RATE && (effectiveOpRate != mDisplayActiveOperationRate)) { OP_MANAGER_LOGD("brightness delta=%d", delta); @@ -204,8 +206,8 @@ int32_t ExynosPrimaryDisplayModule::OperationRateManager::updateOperationRateLoc } } - if (!mDisplay->isConfigSettingEnabled()) { - OP_MANAGER_LOGI("rate switching is disabled, skip op rate update"); + if (!mDisplay->isConfigSettingEnabled() && effectiveOpRate == mDisplayNsOperationRate) { + OP_MANAGER_LOGI("rate switching is disabled, skip NS op rate update"); return ret; } else if (effectiveOpRate > LP_OP_RATE) { ret = setOperationRate(effectiveOpRate); |