power: Add support for EXPENSIVE_RENDERING

When background_blur is enabled, the rendering can be expensive
and many janks will occur. So, need to support the mode in power
module and pass it to perf-hal to handle.

Change-Id: I5bab53e72134d76201d9fc28b9bdae4185790deb
CRs-Fixed: 3278491
This commit is contained in:
Jun Wang
2022-08-26 11:55:12 +08:00
committed by Gerrit - the friendly Code Review server
parent 524973faef
commit e118a0b01f
3 changed files with 18 additions and 2 deletions

View File

@@ -63,7 +63,6 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
case Mode::DOUBLE_TAP_TO_WAKE:
case Mode::LOW_POWER:
case Mode::LAUNCH:
case Mode::EXPENSIVE_RENDERING:
case Mode::DEVICE_IDLE:
case Mode::DISPLAY_INACTIVE:
case Mode::AUDIO_STREAMING_LOW_LATENCY:
@@ -74,6 +73,9 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
case Mode::VR:
LOG(INFO) << "Mode " << static_cast<int32_t>(type) << "Not Supported";
break;
case Mode::EXPENSIVE_RENDERING:
set_expensive_rendering(enabled);
break;
case Mode::INTERACTIVE:
setInteractive(enabled);
power_hint(POWER_HINT_INTERACTION, NULL);
@@ -93,6 +95,7 @@ ndk::ScopedAStatus Power::isModeSupported(Mode type, bool* _aidl_return) {
LOG(INFO) << "Power isModeSupported: " << static_cast<int32_t>(type);
switch(type){
case Mode::EXPENSIVE_RENDERING:
case Mode::INTERACTIVE:
case Mode::SUSTAINED_PERFORMANCE:
case Mode::FIXED_PERFORMANCE:
@@ -121,4 +124,4 @@ ndk::ScopedAStatus Power::isBoostSupported(Boost type, bool* _aidl_return) {
} // namespace power
} // namespace hardware
} // namespace android
} // namespace aidl
} // namespace aidl