diff --git a/Power.cpp b/Power.cpp index 260ad4c..4ab9e83 100644 --- a/Power.cpp +++ b/Power.cpp @@ -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(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(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 \ No newline at end of file +} // namespace aidl diff --git a/config/neo/powerhint.xml b/config/neo/powerhint.xml index 406f053..362e71a 100644 --- a/config/neo/powerhint.xml +++ b/config/neo/powerhint.xml @@ -375,30 +375,20 @@ - - - - - - + + + Resources="0x40400000, 0x1, 0x40C00000, 0x1, 0x40804000, 0XFFFF, 0x40800000, 0XFFFF"/> - - - - - - + + + Resources="0x40400000, 0x1, 0x40C00000, 0x1, 0x40804000, 0XFFFF, 0x40800000, 0XFFFF"/> diff --git a/config/parrot/powerhint.xml b/config/parrot/powerhint.xml index 3cc06ae..4984277 100644 --- a/config/parrot/powerhint.xml +++ b/config/parrot/powerhint.xml @@ -62,6 +62,7 @@ + @@ -69,7 +70,7 @@ @@ -78,7 +79,7 @@ - + @@ -86,58 +87,65 @@ + + Resources="0x40C68100, -10, 0x40C68000, -10, 0x43034000, 0x21, 0x40804100, 1497, + 0x40CE0000, 0x0023001E, 0x40CF4000, 0x0023001E, 0x41000000, 0x4, 0x43048000, 0x32, + 0x43020000, 100"/> + + 0x40804100, 1497, 0x40CE0000, 0x0023001E, 0x40CF4000, 0x0023001E, 0x41000000, 0x4, + 0x43020000, 100"/> + + + 0x40804100, 1497, 0x41000000, 0x4, 0x43020000, 100"/> - + + + 0x40800100, 1113, 0x40804100, 1497, 0x41000000, 0x4, 0x43048000, 0x32, 0x43020000, 100"/> @@ -308,26 +316,26 @@ - - - - + + + + + Resources="0x40400000, 0x1, 0x40C00000, 0x1, 0x40804000, 0X834, 0x40800000, 0X834, + 0x40804100, 0X708, 0x40800100, 0X708"/> - - - - + + + + + Resources="0x40400000, 0x1, 0x40C00000, 0x1, 0x40804000, 0X834, 0x40800000, 0X834, + 0x40804100, 0X708, 0x40800100, 0X708"/> diff --git a/config/taro/powerhint.xml b/config/taro/powerhint.xml index 31009ff..1308996 100644 --- a/config/taro/powerhint.xml +++ b/config/taro/powerhint.xml @@ -40,6 +40,10 @@ Id="0x00001203" Enable="true" Target="cape" Resources="" /> + + + + + + + + @@ -91,6 +107,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -115,6 +137,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -139,6 +167,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -163,6 +197,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -187,6 +227,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -211,6 +257,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -235,6 +287,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -259,6 +317,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -283,6 +347,12 @@ 0x40800200, 0x399, 0x40804200, 0x840, 0x42804000, 0x9, 0x42808000, 0x5, 0x41000000, 0x3, 0x41000200, 0x1"/> + + @@ -307,6 +377,12 @@ Resources="0x4183C000, 0x21, 0x41834000, 0x64, 0x41838000, 0, 0x43034000, 0x21, 0x43020000, 0x64, 0x43024000, 0, 0x41444100, 0, 0x41440100, 0x63, 0x40804100, 0x2B3, 0x41008000, 0, 0x41008100, 0, 0x41008200, 0"/> + + + @@ -337,6 +413,13 @@ 0x43020000, 0x64, 0x43024000, 0, 0x4303C000, 0x858B8 ,0x40804100, 0x420, 0x41444100, 0, 0x41444000, 0, 0x41440000, 0x63, 0x40CE0000, 0x0032000A, 0x40CE0200, 0x00550055, 0x41008000, 0, 0x41008100, 0, 0x41008200, 0"/> + + + @@ -367,6 +450,13 @@ 0x43020000, 0x64, 0x43024000, 0, 0x4303C000, 0x17BA38, 0x40804100, 0x420, 0x41444100, 0, 0x41444000, 0, 0x41440000, 0x63, 0x40CE0000, 0x0032000A, 0x40CE0200, 0x00550055, 0x41008000, 0, 0x41008100, 0, 0x41008200, 0"/> + + + @@ -396,6 +486,13 @@ 0x43020000, 0x64, 0x43024000, 0, 0x40804100, 0x420, 0x41444100, 0, 0x41444000, 0, 0x41440000, 0x63, 0x40CE0000, 0x0028000A, 0x40CE0200, 0x00550055, 0x41008000, 0, 0x41008100, 0, 0x41008200, 0"/> + + + @@ -415,6 +512,11 @@ Resources="0x40400000, 0x1, 0x40800100, 0x40C, 0x40800000, 0x4CC, 0x40C20000, 0x14, 0x40C1C000, 0x1E, 0x41820000, 0x0A, 0x41808000, 0x50, 0x4180C000, 0"/> + + @@ -432,6 +534,10 @@ Id="0x00001337" Enable="true" Timeout="0" Target="cape" Resources="0x40400000, 0x1, 0x40C00000, 0x1, 0x40804000, 0XFFF, 0x40800000, 0XFFF, 0x40804100, 0XFFF, 0x40800100, 0XFFF, 0x40800200, 0XFFF, 0x40804200, 0XFFF"/> + @@ -450,6 +556,10 @@ Id="0x00001338" Enable="true" Timeout="0" Target="cape" Resources="0x40400000, 0x1, 0x40C00000, 0x1, 0x40804000, 0XFFF, 0x40800000, 0XFFF, 0x40804100, 0XFFF, 0x40800100, 0XFFF, 0x40800200, 0XFFF, 0x40804200, 0XFFF"/> + @@ -467,6 +577,11 @@ Resources="0x40400000, 0x1, 0x40800100, 0x46C, 0x40800000, 0x52C, 0x40C20000, 0X14, 0x40C1C000, 0X1E"/> + + 0) { + release_request(handleER); + } +} + int __attribute__ ((weak)) set_interactive_override(int on) { return HINT_NONE; diff --git a/power-common.h b/power-common.h index 697302a..b95ea22 100644 --- a/power-common.h +++ b/power-common.h @@ -49,6 +49,8 @@ extern "C" { #define HINT_HANDLED (0) #define HINT_NONE (-1) +#define PERF_HINT_EXPENSIVE_RENDERING 0x000010A5 + #include enum CPU_GOV_CHECK { @@ -60,6 +62,7 @@ enum CPU_GOV_CHECK { void power_init(void); void power_hint(power_hint_t hint, void *data); +void set_expensive_rendering(bool enabled); void set_interactive(int on); #ifdef __cplusplus