From 3d431189e5f181aa6ada5ed569e0a69c0657312c Mon Sep 17 00:00:00 2001 From: Michael Benedict Date: Sun, 14 Mar 2021 12:13:43 +0700 Subject: [PATCH] aidl: power-libperfmgr: Squash some of previous hidl power-libperfmgr commits These commits are adapted for aidl counterpart. power-libperfmgr: adapt and rebrand for hardware/samsung power-libperfmgr: simply wait if idle state node is not present power-libperfmgr: remove Google-specific display LPM control power-libperfmgr: remove Google-specific camera and audio hints power-libperfmgr: Give access to radio group power-libperfmgr: initialize powerHAL when boot is completed power-libperfmgr: declare override="true" in manifest power-libperfmgr: add a Power Hint template with common nodes Notes: * Interactive, DT2W, and Lineage perf hint will be re-implemented outside of this commit. Signed-off-by: Michael Benedict Co-authored-by: Jesse Chan Change-Id: I7034cb083bd20ec3a62ec338f5cbfb3e3ba7a0ff --- aidl/power-libperfmgr/Android.bp | 62 +-- aidl/power-libperfmgr/InteractionHandler.cpp | 27 +- aidl/power-libperfmgr/Power.cpp | 8 +- aidl/power-libperfmgr/Power.h | 6 +- aidl/power-libperfmgr/PowerExt.cpp | 2 +- aidl/power-libperfmgr/PowerExt.h | 7 +- ...dware.power-service.samsung-libperfmgr.rc} | 13 +- ...ndroid.hardware.power-service.samsung.xml} | 2 +- aidl/power-libperfmgr/device.mk | 5 - aidl/power-libperfmgr/powerhint.json.template | 448 ++++++++++++++++++ aidl/power-libperfmgr/service.cpp | 10 +- 11 files changed, 492 insertions(+), 98 deletions(-) rename aidl/power-libperfmgr/{android.hardware.power-service.pixel-libperfmgr.rc => android.hardware.power-service.samsung-libperfmgr.rc} (77%) rename aidl/power-libperfmgr/{android.hardware.power-service.pixel.xml => android.hardware.power-service.samsung.xml} (78%) delete mode 100644 aidl/power-libperfmgr/device.mk create mode 100644 aidl/power-libperfmgr/powerhint.json.template diff --git a/aidl/power-libperfmgr/Android.bp b/aidl/power-libperfmgr/Android.bp index f2f4a46b..0c317dec 100644 --- a/aidl/power-libperfmgr/Android.bp +++ b/aidl/power-libperfmgr/Android.bp @@ -20,59 +20,11 @@ soong_namespace { ], } -cc_library { - name: "libdisppower-pixel", - proprietary: true, - srcs: [ - "disp-power/DisplayLowPower.cpp", - "disp-power/InteractionHandler.cpp", - ], - shared_libs: [ - "libbase", - "libcutils", - "liblog", - "libperfmgr", - "libutils", - ], -} - -cc_library_headers { - name: "pixel_power_headers", - vendor: true, - export_include_dirs: ["hidl"], -} - -cc_binary { - name: "android.hardware.power@1.3-service.pixel-libperfmgr", - relative_install_path: "hw", - vintf_fragments: ["hidl/android.hardware.power@1.3-service.pixel.xml"], - init_rc: ["hidl/android.hardware.power@1.3-service.pixel-libperfmgr.rc"], - srcs: ["hidl/service.cpp", "hidl/Power.cpp"], - cflags: [ - "-Wall", - "-Werror", - ], - shared_libs: [ - "libbase", - "libhidlbase", - "liblog", - "libutils", - "libcutils", - "android.hardware.power@1.0", - "android.hardware.power@1.1", - "android.hardware.power@1.2", - "android.hardware.power@1.3", - "libdisppower-pixel", - "libperfmgr", - ], - proprietary: true, -} - cc_binary { - name: "android.hardware.power-service.pixel-libperfmgr", + name: "android.hardware.power-service.samsung-libperfmgr", relative_install_path: "hw", - init_rc: ["aidl/android.hardware.power-service.pixel-libperfmgr.rc"], - vintf_fragments: ["aidl/android.hardware.power-service.pixel.xml"], + init_rc: ["android.hardware.power-service.samsung-libperfmgr.rc"], + vintf_fragments: ["android.hardware.power-service.samsung.xml"], vendor: true, shared_libs: [ "android.hardware.power-ndk_platform", @@ -81,13 +33,13 @@ cc_binary { "liblog", "libutils", "libbinder_ndk", - "libdisppower-pixel", "libperfmgr", "pixel-power-ext-ndk_platform", ], srcs: [ - "aidl/service.cpp", - "aidl/Power.cpp", - "aidl/PowerExt.cpp", + "service.cpp", + "Power.cpp", + "PowerExt.cpp", + "InteractionHandler.cpp" ], } diff --git a/aidl/power-libperfmgr/InteractionHandler.cpp b/aidl/power-libperfmgr/InteractionHandler.cpp index 1826958e..0c28365d 100644 --- a/aidl/power-libperfmgr/InteractionHandler.cpp +++ b/aidl/power-libperfmgr/InteractionHandler.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.power@-service.pixel-libperfmgr" +#define LOG_TAG "android.hardware.power@-service.samsung-libperfmgr" #define ATRACE_TAG (ATRACE_TAG_POWER | ATRACE_TAG_HAL) #include @@ -65,15 +65,14 @@ bool InteractionHandler::Init() { if (mState != INTERACTION_STATE_UNINITIALIZED) return true; - int fd = fb_idle_open(); - if (fd < 0) - return false; - mIdleFd = fd; + mIdleFd = fb_idle_open(); mEventFd = eventfd(0, EFD_NONBLOCK); if (mEventFd < 0) { ALOGE("Unable to create event fd (%d)", errno); - close(mIdleFd); + if (mIdleFd >= 0) { + close(mIdleFd); + } return false; } @@ -96,7 +95,9 @@ void InteractionHandler::Exit() { mThread->join(); close(mEventFd); - close(mIdleFd); + if (mIdleFd >= 0) { + close(mIdleFd); + } } void InteractionHandler::PerfLock() { @@ -212,6 +213,18 @@ void InteractionHandler::WaitForIdle(int32_t wait_ms, int32_t timeout_ms) { return; } + if (mIdleFd < 0) { + ret = poll(pfd, 1, timeout_ms); + if (ret > 0) { + ALOGV("%s: wait for duration aborted", __func__); + return; + } else if (ret < 0) { + ALOGE("%s: Error on waiting for duration (%zd)", __func__, ret); + return; + } + return; + } + ret = pread(mIdleFd, data, sizeof(data), 0); if (!ret) { ALOGE("%s: Unexpected EOF!", __func__); diff --git a/aidl/power-libperfmgr/Power.cpp b/aidl/power-libperfmgr/Power.cpp index d944cf40..8bd8282e 100644 --- a/aidl/power-libperfmgr/Power.cpp +++ b/aidl/power-libperfmgr/Power.cpp @@ -15,7 +15,7 @@ */ #define ATRACE_TAG (ATRACE_TAG_POWER | ATRACE_TAG_HAL) -#define LOG_TAG "android.hardware.power-service.pixel-libperfmgr" +#define LOG_TAG "android.hardware.power-service.samsung-libperfmgr" #include "Power.h" @@ -30,8 +30,6 @@ #include #include -#include "disp-power/DisplayLowPower.h" - namespace aidl { namespace google { namespace hardware { @@ -43,9 +41,8 @@ constexpr char kPowerHalStateProp[] = "vendor.powerhal.state"; constexpr char kPowerHalAudioProp[] = "vendor.powerhal.audio"; constexpr char kPowerHalRenderingProp[] = "vendor.powerhal.rendering"; -Power::Power(std::shared_ptr hm, std::shared_ptr dlpw) +Power::Power(std::shared_ptr hm) : mHintManager(hm), - mDisplayLowPower(dlpw), mInteractionHandler(nullptr), mVRModeOn(false), mSustainedPerfModeOn(false) { @@ -91,7 +88,6 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) { ATRACE_INT(toString(type).c_str(), enabled); switch (type) { case Mode::LOW_POWER: - mDisplayLowPower->SetDisplayLowPower(enabled); if (enabled) { mHintManager->DoHint(toString(type)); } else { diff --git a/aidl/power-libperfmgr/Power.h b/aidl/power-libperfmgr/Power.h index 8b90cb48..04e16d65 100644 --- a/aidl/power-libperfmgr/Power.h +++ b/aidl/power-libperfmgr/Power.h @@ -23,8 +23,7 @@ #include #include -#include "disp-power/DisplayLowPower.h" -#include "disp-power/InteractionHandler.h" +#include "InteractionHandler.h" namespace aidl { namespace google { @@ -40,7 +39,7 @@ using ::android::perfmgr::HintManager; class Power : public ::aidl::android::hardware::power::BnPower { public: - Power(std::shared_ptr hm, std::shared_ptr dlpw); + Power(std::shared_ptr hm); ndk::ScopedAStatus setMode(Mode type, bool enabled) override; ndk::ScopedAStatus isModeSupported(Mode type, bool *_aidl_return) override; ndk::ScopedAStatus setBoost(Boost type, int32_t durationMs) override; @@ -49,7 +48,6 @@ class Power : public ::aidl::android::hardware::power::BnPower { private: std::shared_ptr mHintManager; - std::shared_ptr mDisplayLowPower; std::unique_ptr mInteractionHandler; std::atomic mVRModeOn; std::atomic mSustainedPerfModeOn; diff --git a/aidl/power-libperfmgr/PowerExt.cpp b/aidl/power-libperfmgr/PowerExt.cpp index 24e855d3..6f854b08 100644 --- a/aidl/power-libperfmgr/PowerExt.cpp +++ b/aidl/power-libperfmgr/PowerExt.cpp @@ -15,7 +15,7 @@ */ #define ATRACE_TAG (ATRACE_TAG_POWER | ATRACE_TAG_HAL) -#define LOG_TAG "android.hardware.power-service.pixel.ext-libperfmgr" +#define LOG_TAG "android.hardware.power-service.samsung.ext-libperfmgr" #include "PowerExt.h" diff --git a/aidl/power-libperfmgr/PowerExt.h b/aidl/power-libperfmgr/PowerExt.h index 65cec2c1..c24d6501 100644 --- a/aidl/power-libperfmgr/PowerExt.h +++ b/aidl/power-libperfmgr/PowerExt.h @@ -23,8 +23,6 @@ #include #include -#include "disp-power/DisplayLowPower.h" - namespace aidl { namespace google { namespace hardware { @@ -36,8 +34,8 @@ using ::android::perfmgr::HintManager; class PowerExt : public ::aidl::google::hardware::power::extension::pixel::BnPowerExt { public: - PowerExt(std::shared_ptr hm, std::shared_ptr dlpw) - : mHintManager(hm), mDisplayLowPower(dlpw) {} + PowerExt(std::shared_ptr hm) + : mHintManager(hm) {} ndk::ScopedAStatus setMode(const std::string &mode, bool enabled) override; ndk::ScopedAStatus isModeSupported(const std::string &mode, bool *_aidl_return) override; ndk::ScopedAStatus setBoost(const std::string &boost, int32_t durationMs) override; @@ -45,7 +43,6 @@ class PowerExt : public ::aidl::google::hardware::power::extension::pixel::BnPow private: std::shared_ptr mHintManager; - std::shared_ptr mDisplayLowPower; }; } // namespace pixel diff --git a/aidl/power-libperfmgr/android.hardware.power-service.pixel-libperfmgr.rc b/aidl/power-libperfmgr/android.hardware.power-service.samsung-libperfmgr.rc similarity index 77% rename from aidl/power-libperfmgr/android.hardware.power-service.pixel-libperfmgr.rc rename to aidl/power-libperfmgr/android.hardware.power-service.samsung-libperfmgr.rc index ef15b123..93497c9d 100644 --- a/aidl/power-libperfmgr/android.hardware.power-service.pixel-libperfmgr.rc +++ b/aidl/power-libperfmgr/android.hardware.power-service.samsung-libperfmgr.rc @@ -1,7 +1,7 @@ -service vendor.power-hal-aidl /vendor/bin/hw/android.hardware.power-service.pixel-libperfmgr +service vendor.power-hal-aidl /vendor/bin/hw/android.hardware.power-service.samsung-libperfmgr class hal user root - group system + group system radio priority -20 on late-fs @@ -14,11 +14,6 @@ on property:init.svc.zygote=restarting && property:vendor.powerhal.state=* setprop vendor.powerhal.rendering "" restart vendor.power-hal-aidl -# restart powerHAL when audioHAL died -on property:init.svc.vendor.audio-hal-2-0=restarting && property:vendor.powerhal.audio=AUDIO_STREAMING_LOW_LATENCY - setprop vendor.powerhal.audio "" - restart vendor.power-hal-aidl - # Clean up after b/163539793 resolved on property:vendor.powerhal.dalvik.vm.dex2oat-threads=* setprop dalvik.vm.dex2oat-threads ${vendor.powerhal.dalvik.vm.dex2oat-threads} @@ -27,3 +22,7 @@ on property:vendor.powerhal.dalvik.vm.dex2oat-threads=* on property:vendor.powerhal.dalvik.vm.dex2oat-cpu-set=* setprop dalvik.vm.dex2oat-cpu-set ${vendor.powerhal.dalvik.vm.dex2oat-cpu-set} setprop dalvik.vm.restore-dex2oat-cpu-set ${vendor.powerhal.dalvik.vm.dex2oat-cpu-set} + +# initialize powerHAL when boot is completed +on property:sys.boot_completed=1 + setprop vendor.powerhal.init 1 diff --git a/aidl/power-libperfmgr/android.hardware.power-service.pixel.xml b/aidl/power-libperfmgr/android.hardware.power-service.samsung.xml similarity index 78% rename from aidl/power-libperfmgr/android.hardware.power-service.pixel.xml rename to aidl/power-libperfmgr/android.hardware.power-service.samsung.xml index caf6ea2d..1efa5f1d 100644 --- a/aidl/power-libperfmgr/android.hardware.power-service.pixel.xml +++ b/aidl/power-libperfmgr/android.hardware.power-service.samsung.xml @@ -1,5 +1,5 @@ - + android.hardware.power IPower/default diff --git a/aidl/power-libperfmgr/device.mk b/aidl/power-libperfmgr/device.mk deleted file mode 100644 index c8485975..00000000 --- a/aidl/power-libperfmgr/device.mk +++ /dev/null @@ -1,5 +0,0 @@ -BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/power-libperfmgr - -# power HAL -PRODUCT_PACKAGES += \ - android.hardware.power-service.pixel-libperfmgr diff --git a/aidl/power-libperfmgr/powerhint.json.template b/aidl/power-libperfmgr/powerhint.json.template new file mode 100644 index 00000000..359dad82 --- /dev/null +++ b/aidl/power-libperfmgr/powerhint.json.template @@ -0,0 +1,448 @@ +{ + "Nodes": [ + { + "Name": "CPULittleClusterMaxFreq", + "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", + "Values": [ + "9999999", + "1113600" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "CPULittleClusterMinFreq", + "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", + "Values": [ + "9999999", + "1113600", + "576000" + ], + "ResetOnInit": true + }, + { + "Name": "CPUBigClusterMaxFreq", + "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq", + "Values": [ + "9999999", + "2016000", + "1497600", + "1401600" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "CPUBigClusterMinFreq", + "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq", + "Values": [ + "9999999", + "1497600", + "1401600", + "1286400", + "0" + ], + "ResetOnInit": true + }, + { + "Name": "CPUBigPlusClusterMaxFreq", + "Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq", + "Values": [ + "9999999", + "2016000", + "1497600", + "1401600" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "CPUBigPlusClusterMinFreq", + "Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq", + "Values": [ + "9999999", + "1497600", + "1401600", + "1286400", + "0" + ], + "ResetOnInit": true + }, + { + "Name": "GPUMaxFreq", + "Path": "/sys/class/kgsl/kgsl-3d0/devfreq/max_freq", + "Values": [ + "585000000", + "427000000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "GPUMinFreq", + "Path": "/sys/class/kgsl/kgsl-3d0/devfreq/min_freq", + "Values": [ + "585000000", + "427000000", + "345000000", + "257000000" + ], + "ResetOnInit": true + }, + { + "Name": "TASchedtuneBoost", + "Path": "/dev/stune/top-app/schedtune.boost", + "Values": [ + "30", + "10" + ], + "ResetOnInit": true + }, + { + "Name": "PMQoSCpuDmaLatency", + "Path": "/dev/cpu_dma_latency", + "Values": [ + "44", + "100" + ], + "HoldFd": true + }, + { + "Name": "TouchscreenEnable", + "Path": "/sys/class/input/input3/enabled", + "Values": [ + "0", + "1" + ], + "ResetOnInit": true + }, + { + "Name": "DoubleTapToWakeEnable", + "Path": "/sys/class/sec/tsp/cmd", + "Values": [ + "aot_enable,0", + "aot_enable,1" + ], + "DefaultIndex": 0, + }, + { + "Name": "PowerHALMainState", + "Path": "vendor.powerhal.state", + "Values": [ + "CAMERA_STREAMING", + "SUSTAINED_PERFORMANCE", + "VR_MODE", + "VR_SUSTAINED_PERFORMANCE", + "" + ], + "Type": "Property" + }, + { + "Name": "PowerHALAudioState", + "Path": "vendor.powerhal.audio", + "Values": [ + "AUDIO_LOW_LATENCY", + "" + ], + "Type": "Property" + }, + { + "Name": "PowerHALRenderingState", + "Path": "vendor.powerhal.rendering", + "Values": [ + "EXPENSIVE_RENDERING", + "" + ], + "Type": "Property" + }, + { + "Name": "PowerHALPerfProfileState", + "Path": "vendor.powerhal.perf_profile", + "Values": [ + "POWER_SAVE", + "BIAS_POWER_SAVE", + "BIAS_PERFORMANCE", + "HIGH_PERFORMANCE" + ], + "Type": "Property" + } + ], + "Actions": [ + { + "PowerHint": "INTERACTION", + "Node": "CPUBigClusterMinFreq", + "Duration": 0, + "Value": "1286400" + }, + { + "PowerHint": "INTERACTION", + "Node": "CPUBigPlusClusterMinFreq", + "Duration": 0, + "Value": "1286400" + }, + { + "PowerHint": "INTERACTION", + "Node": "CPULittleClusterMinFreq", + "Duration": 0, + "Value": "1113600" + }, + { + "PowerHint": "INTERACTION", + "Node": "TASchedtuneBoost", + "Duration": 0, + "Value": "30" + }, + { + "PowerHint": "LAUNCH", + "Node": "CPUBigClusterMaxFreq", + "Duration": 5000, + "Value": "9999999" + }, + { + "PowerHint": "LAUNCH", + "Node": "CPUBigPlusClusterMaxFreq", + "Duration": 5000, + "Value": "9999999" + }, + { + "PowerHint": "LAUNCH", + "Node": "CPUBigClusterMinFreq", + "Duration": 5000, + "Value": "9999999" + }, + { + "PowerHint": "LAUNCH", + "Node": "CPUBigPlusClusterMinFreq", + "Duration": 5000, + "Value": "9999999" + }, + { + "PowerHint": "LAUNCH", + "Node": "CPULittleClusterMinFreq", + "Duration": 5000, + "Value": "9999999" + }, + { + "PowerHint": "LAUNCH", + "Node": "PMQoSCpuDmaLatency", + "Duration": 5000, + "Value": "44" + }, + { + "PowerHint": "CAMERA_LAUNCH", + "Node": "CPUBigClusterMaxFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_LAUNCH", + "Node": "CPUBigPlusClusterMaxFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_LAUNCH", + "Node": "CPUBigClusterMinFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_LAUNCH", + "Node": "CPUBigPlusClusterMinFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_LAUNCH", + "Node": "CPULittleClusterMaxFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_LAUNCH", + "Node": "CPULittleClusterMinFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_LAUNCH", + "Node": "PMQoSCpuDmaLatency", + "Duration": 1000, + "Value": "44" + }, + { + "PowerHint": "CAMERA_STREAMING", + "Node": "PowerHALMainState", + "Duration": 0, + "Value": "CAMERA_STREAMING" + }, + { + "PowerHint": "CAMERA_STREAMING", + "Node": "CPUBigClusterMaxFreq", + "Duration": 0, + "Value": "2016000" + }, + { + "PowerHint": "CAMERA_STREAMING", + "Node": "CPUBigPlusClusterMaxFreq", + "Duration": 0, + "Value": "2016000" + }, + { + "PowerHint": "CAMERA_SHOT", + "Node": "CPUBigClusterMaxFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_SHOT", + "Node": "CPUBigPlusClusterMaxFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_SHOT", + "Node": "CPUBigClusterMinFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_SHOT", + "Node": "CPUBigPlusClusterMinFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_SHOT", + "Node": "CPULittleClusterMaxFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_SHOT", + "Node": "CPULittleClusterMinFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "CAMERA_SHOT", + "Node": "PMQoSCpuDmaLatency", + "Duration": 1000, + "Value": "44" + }, + { + "PowerHint": "AUDIO_STREAMING", + "Node": "PMQoSCpuDmaLatency", + "Duration": 2000, + "Value": "44" + }, + { + "PowerHint": "AUDIO_LOW_LATENCY", + "Node": "PowerHALAudioState", + "Duration": 0, + "Value": "AUDIO_LOW_LATENCY" + }, + { + "PowerHint": "AUDIO_LOW_LATENCY", + "Node": "PMQoSCpuDmaLatency", + "Duration": 0, + "Value": "44" + }, + { + "PowerHint": "SUSTAINED_PERFORMANCE", + "Node": "PowerHALMainState", + "Duration": 0, + "Value": "SUSTAINED_PERFORMANCE" + }, + { + "PowerHint": "SUSTAINED_PERFORMANCE", + "Node": "CPUBigClusterMaxFreq", + "Duration": 0, + "Value": "1401600" + }, + { + "PowerHint": "SUSTAINED_PERFORMANCE", + "Node": "CPUBigPlusClusterMaxFreq", + "Duration": 0, + "Value": "1401600" + }, + { + "PowerHint": "SUSTAINED_PERFORMANCE", + "Node": "CPULittleClusterMaxFreq", + "Duration": 0, + "Value": "1113600" + }, + { + "PowerHint": "SUSTAINED_PERFORMANCE", + "Node": "GPUMaxFreq", + "Duration": 0, + "Value": "427000000" + }, + { + "PowerHint": "VR_MODE", + "Node": "PowerHALMainState", + "Duration": 0, + "Value": "VR_MODE" + }, + { + "PowerHint": "VR_SUSTAINED_PERFORMANCE", + "Node": "PowerHALMainState", + "Duration": 0, + "Value": "VR_SUSTAINED_PERFORMANCE" + }, + { + "PowerHint": "EXPENSIVE_RENDERING", + "Node": "PowerHALRenderingState", + "Duration": 0, + "Value": "EXPENSIVE_RENDERING" + }, + { + "PowerHint": "EXPENSIVE_RENDERING", + "Node": "GPUMinFreq", + "Duration": 0, + "Value": "427000000" + }, + { + "PowerHint": "EXPENSIVE_RENDERING", + "Node": "GPUMaxFreq", + "Duration": 0, + "Value": "585000000" + }, + { + "PowerHint": "NOT_INTERACTIVE", + "Node": "TouchscreenEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "DOUBLE_TAP_TO_WAKE", + "Node": "DoubleTapToWakeEnable", + "Duration": 0, + "Value": "aot_enable,1" + }, + { + "PowerHint": "PROFILE_POWER_SAVE", + "Node": "PowerHALPerfProfileState", + "Duration": 0, + "Value": "POWER_SAVE" + }, + { + "PowerHint": "PROFILE_BIAS_POWER_SAVE", + "Node": "PowerHALPerfProfileState", + "Duration": 0, + "Value": "BIAS_POWER_SAVE" + }, + { + "PowerHint": "PROFILE_BIAS_PERFORMANCE", + "Node": "PowerHALPerfProfileState", + "Duration": 0, + "Value": "BIAS_PERFORMANCE" + }, + { + "PowerHint": "PROFILE_HIGH_PERFORMANCE", + "Node": "PowerHALPerfProfileState", + "Duration": 0, + "Value": "HIGH_PERFORMANCE" + } + ] +} diff --git a/aidl/power-libperfmgr/service.cpp b/aidl/power-libperfmgr/service.cpp index aeb63564..4634ea11 100644 --- a/aidl/power-libperfmgr/service.cpp +++ b/aidl/power-libperfmgr/service.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.power-service.pixel-libperfmgr" +#define LOG_TAG "android.hardware.power-service.samsung-libperfmgr" #include @@ -25,7 +25,6 @@ #include "Power.h" #include "PowerExt.h" -#include "disp-power/DisplayLowPower.h" using aidl::google::hardware::power::impl::pixel::Power; using aidl::google::hardware::power::impl::pixel::PowerExt; @@ -43,17 +42,15 @@ int main() { LOG(FATAL) << "Invalid config: " << kPowerHalConfigPath; } - std::shared_ptr dlpw = std::make_shared(); - // single thread ABinderProcess_setThreadPoolMaxThreadCount(0); // core service - std::shared_ptr pw = ndk::SharedRefBase::make(hm, dlpw); + std::shared_ptr pw = ndk::SharedRefBase::make(hm); ndk::SpAIBinder pwBinder = pw->asBinder(); // extension service - std::shared_ptr pwExt = ndk::SharedRefBase::make(hm, dlpw); + std::shared_ptr pwExt = ndk::SharedRefBase::make(hm); // attach the extension to the same binder we will be registering CHECK(STATUS_OK == AIBinder_setExtension(pwBinder.get(), pwExt->asBinder().get())); @@ -66,7 +63,6 @@ int main() { std::thread initThread([&]() { ::android::base::WaitForProperty(kPowerHalInitProp, "1"); hm->Start(); - dlpw->Init(); }); initThread.detach();