aidl: power-libperfmgr: Squash some of previous hidl power-libperfmgr commits
authorMichael Benedict <michaelbt@live.com>
Sun, 14 Mar 2021 05:13:43 +0000 (12:13 +0700)
committerMichael Benedict <michaelbt@live.com>
Thu, 18 Mar 2021 09:29:08 +0000 (16:29 +0700)
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 <michaelbt@live.com>
Co-authored-by: Jesse Chan <jc@lineageos.org>
Change-Id: I7034cb083bd20ec3a62ec338f5cbfb3e3ba7a0ff

13 files changed:
aidl/power-libperfmgr/Android.bp
aidl/power-libperfmgr/InteractionHandler.cpp
aidl/power-libperfmgr/Power.cpp
aidl/power-libperfmgr/Power.h
aidl/power-libperfmgr/PowerExt.cpp
aidl/power-libperfmgr/PowerExt.h
aidl/power-libperfmgr/android.hardware.power-service.pixel-libperfmgr.rc [deleted file]
aidl/power-libperfmgr/android.hardware.power-service.pixel.xml [deleted file]
aidl/power-libperfmgr/android.hardware.power-service.samsung-libperfmgr.rc [new file with mode: 0644]
aidl/power-libperfmgr/android.hardware.power-service.samsung.xml [new file with mode: 0644]
aidl/power-libperfmgr/device.mk [deleted file]
aidl/power-libperfmgr/powerhint.json.template [new file with mode: 0644]
aidl/power-libperfmgr/service.cpp

index f2f4a46b84034b6245a8685d2a6ea0a441c1884b..0c317dec80fd18fac270a45941ea44854baaf130 100644 (file)
@@ -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"
     ],
 }
index 1826958e0444f4f82ceec59d354e593ae5b8b1e1..0c28365d28599940921870b455815bc87cfa8542 100644 (file)
@@ -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 <fcntl.h>
@@ -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__);
index d944cf40a5c622336683514b3cf01dc6c81a4dd3..8bd8282ec5b6f5a2b12110501dc72571f9b0039d 100644 (file)
@@ -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 <utils/Log.h>
 #include <utils/Trace.h>
 
-#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<HintManager> hm, std::shared_ptr<DisplayLowPower> dlpw)
+Power::Power(std::shared_ptr<HintManager> 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 {
index 8b90cb48c3dd50a091744dac0f5cb03cf178312d..04e16d656a7e36b932e396c9471306c8f922e7f8 100644 (file)
@@ -23,8 +23,7 @@
 #include <aidl/android/hardware/power/BnPower.h>
 #include <perfmgr/HintManager.h>
 
-#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<HintManager> hm, std::shared_ptr<DisplayLowPower> dlpw);
+    Power(std::shared_ptr<HintManager> 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<HintManager> mHintManager;
-    std::shared_ptr<DisplayLowPower> mDisplayLowPower;
     std::unique_ptr<InteractionHandler> mInteractionHandler;
     std::atomic<bool> mVRModeOn;
     std::atomic<bool> mSustainedPerfModeOn;
index 24e855d34671b7d8961ceec822da118ba2876a43..6f854b082b91fb7d0cabdbbf173e53f6b7364f50 100644 (file)
@@ -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"
 
index 65cec2c12a044c4be412da63fc73a417a77a2af8..c24d6501b05e93db62a54e7da9dcd4a286a01eb0 100644 (file)
@@ -23,8 +23,6 @@
 #include <aidl/google/hardware/power/extension/pixel/BnPowerExt.h>
 #include <perfmgr/HintManager.h>
 
-#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<HintManager> hm, std::shared_ptr<DisplayLowPower> dlpw)
-        : mHintManager(hm), mDisplayLowPower(dlpw) {}
+    PowerExt(std::shared_ptr<HintManager> 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<HintManager> mHintManager;
-    std::shared_ptr<DisplayLowPower> mDisplayLowPower;
 };
 
 }  // namespace pixel
diff --git a/aidl/power-libperfmgr/android.hardware.power-service.pixel-libperfmgr.rc b/aidl/power-libperfmgr/android.hardware.power-service.pixel-libperfmgr.rc
deleted file mode 100644 (file)
index ef15b12..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-service vendor.power-hal-aidl /vendor/bin/hw/android.hardware.power-service.pixel-libperfmgr
-    class hal
-    user root
-    group system
-    priority -20
-
-on late-fs
-     start vendor.power-hal-aidl
-
-# restart powerHAL when framework died
-on property:init.svc.zygote=restarting && property:vendor.powerhal.state=*
-    setprop vendor.powerhal.state ""
-    setprop vendor.powerhal.audio ""
-    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}
-    setprop dalvik.vm.restore-dex2oat-threads ${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}
diff --git a/aidl/power-libperfmgr/android.hardware.power-service.pixel.xml b/aidl/power-libperfmgr/android.hardware.power-service.pixel.xml
deleted file mode 100644 (file)
index caf6ea2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<manifest version="1.0" type="device">
-    <hal format="aidl">
-        <name>android.hardware.power</name>
-        <fqname>IPower/default</fqname>
-    </hal>
-</manifest>
diff --git a/aidl/power-libperfmgr/android.hardware.power-service.samsung-libperfmgr.rc b/aidl/power-libperfmgr/android.hardware.power-service.samsung-libperfmgr.rc
new file mode 100644 (file)
index 0000000..93497c9
--- /dev/null
@@ -0,0 +1,28 @@
+service vendor.power-hal-aidl /vendor/bin/hw/android.hardware.power-service.samsung-libperfmgr
+    class hal
+    user root
+    group system radio
+    priority -20
+
+on late-fs
+     start vendor.power-hal-aidl
+
+# restart powerHAL when framework died
+on property:init.svc.zygote=restarting && property:vendor.powerhal.state=*
+    setprop vendor.powerhal.state ""
+    setprop vendor.powerhal.audio ""
+    setprop vendor.powerhal.rendering ""
+    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}
+    setprop dalvik.vm.restore-dex2oat-threads ${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.samsung.xml b/aidl/power-libperfmgr/android.hardware.power-service.samsung.xml
new file mode 100644 (file)
index 0000000..1efa5f1
--- /dev/null
@@ -0,0 +1,6 @@
+<manifest version="1.0" type="device">
+    <hal format="aidl" override="true">
+        <name>android.hardware.power</name>
+        <fqname>IPower/default</fqname>
+    </hal>
+</manifest>
diff --git a/aidl/power-libperfmgr/device.mk b/aidl/power-libperfmgr/device.mk
deleted file mode 100644 (file)
index c848597..0000000
+++ /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 (file)
index 0000000..359dad8
--- /dev/null
@@ -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"
+        }
+    ]
+}
index aeb635642241550c10179827ed5c05b885bc96d5..4634ea11b3dcb0a258770f670839ea6e430cd9aa 100644 (file)
@@ -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 <thread>
 
@@ -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<DisplayLowPower> dlpw = std::make_shared<DisplayLowPower>();
-
     // single thread
     ABinderProcess_setThreadPoolMaxThreadCount(0);
 
     // core service
-    std::shared_ptr<Power> pw = ndk::SharedRefBase::make<Power>(hm, dlpw);
+    std::shared_ptr<Power> pw = ndk::SharedRefBase::make<Power>(hm);
     ndk::SpAIBinder pwBinder = pw->asBinder();
 
     // extension service
-    std::shared_ptr<PowerExt> pwExt = ndk::SharedRefBase::make<PowerExt>(hm, dlpw);
+    std::shared_ptr<PowerExt> pwExt = ndk::SharedRefBase::make<PowerExt>(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();