summaryrefslogtreecommitdiff
path: root/power-libperfmgr/Power.cpp
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2019-04-02 21:30:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-02 21:30:18 +0000
commit161280fd42fa96fc7576ff061059a390020c682a (patch)
treedf4ac6bb5df4bb68c858c4ccd5b1958af76d8dca /power-libperfmgr/Power.cpp
parent2f5b7f6916cde0633e0276c4ff5fe3d1f84d1d21 (diff)
parent3f27076303bbcff6483e0974a40b84545ac8a4b9 (diff)
downloadpixel-161280fd42fa96fc7576ff061059a390020c682a.tar.gz
Merge "Expose TPU hints through AudioStreaming.h"
Diffstat (limited to 'power-libperfmgr/Power.cpp')
-rw-r--r--power-libperfmgr/Power.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/power-libperfmgr/Power.cpp b/power-libperfmgr/Power.cpp
index bafd8399..84a0648a 100644
--- a/power-libperfmgr/Power.cpp
+++ b/power-libperfmgr/Power.cpp
@@ -28,6 +28,7 @@
#include <utils/Log.h>
#include <utils/Trace.h>
+#include "AudioStreaming.h"
#include "Power.h"
#include "display-helper.h"
@@ -43,13 +44,6 @@ using ::android::hardware::Void;
using ::android::hardware::power::V1_0::Feature;
using ::android::hardware::power::V1_0::Status;
-// Keep sync with darwinn HAL
-constexpr size_t kTpuBoostStop = 1000;
-constexpr size_t kTpuBoostShort = 1001;
-constexpr size_t kTpuBoostLong = 1002;
-constexpr size_t kTpuBoostDurationShortMs = 200;
-constexpr size_t kTpuBoostDurationLongMs = 2000;
-
Power::Power()
: mHintManager(nullptr),
mInteractionHandler(nullptr),
@@ -248,17 +242,18 @@ Return<void> Power::powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) {
if (mVRModeOn || mSustainedPerfModeOn) {
ALOGV("%s: ignoring due to other active perf hints", __func__);
} else {
- if (data == 1) {
+ if (data == static_cast<int32_t>(AUDIO_STREAMING_HINT::AUDIO_STREAMING_ON)) {
mHintManager->DoHint("AUDIO_STREAMING");
- } else if (data == 0) {
+ } else if (data ==
+ static_cast<int32_t>(AUDIO_STREAMING_HINT::AUDIO_STREAMING_OFF)) {
mHintManager->EndHint("AUDIO_STREAMING");
- } else if (data == kTpuBoostShort) {
+ } else if (data == static_cast<int32_t>(AUDIO_STREAMING_HINT::TPU_BOOST_SHORT)) {
mHintManager->DoHint("TPU_BOOST",
- std::chrono::milliseconds(kTpuBoostDurationShortMs));
- } else if (data == kTpuBoostLong) {
+ std::chrono::milliseconds(TPU_HINT_DURATION_MS::SHORT));
+ } else if (data == static_cast<int32_t>(AUDIO_STREAMING_HINT::TPU_BOOST_LONG)) {
mHintManager->DoHint("TPU_BOOST",
- std::chrono::milliseconds(kTpuBoostDurationLongMs));
- } else if (data == kTpuBoostStop) {
+ std::chrono::milliseconds(TPU_HINT_DURATION_MS::LONG));
+ } else if (data == static_cast<int32_t>(AUDIO_STREAMING_HINT::TPU_BOOST_OFF)) {
mHintManager->EndHint("TPU_BOOST");
} else {
ALOGE("AUDIO STREAMING INVALID DATA: %d", data);