summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Xiang Wang <xwxw@google.com> 2022-04-18 21:19:17 +0000
committer Xiang Wang <xwxw@google.com> 2022-04-20 16:44:03 +0000
commit65a2e6f9f0309161849b957c9ac15d3baf713d65 (patch)
tree971619002e2aefd6df50c8396a50dbcd7cea1225
parent1527529f4eccca13d2e1f897abd881c6ffd94dfe (diff)
Add debug log on Power HAL support and connection status
Allow enabling power hint through system property Bug: 195990840 Test: manual test Change-Id: I3694eda0ab1f1474a367d02b8d61ae602c5ba993
-rw-r--r--services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp5
-rw-r--r--services/surfaceflinger/FlagManager.cpp3
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp8
3 files changed, 12 insertions, 4 deletions
diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
index cbafdd337d..659efd8636 100644
--- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
+++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
@@ -564,6 +564,7 @@ PowerAdvisor::HalWrapper* PowerAdvisor::getPowerHal() {
if (!wrapper->shouldReconnectHAL()) {
return wrapper;
}
+ ALOGD("Reconnecting Power HAL");
sHalWrapper = nullptr;
}
@@ -576,7 +577,9 @@ PowerAdvisor::HalWrapper* PowerAdvisor::getPowerHal() {
// If that didn't succeed, attempt to connect to the HIDL Power HAL
if (sHalWrapper == nullptr) {
sHalWrapper = HidlPowerHalWrapper::connect();
- } else { // if AIDL, pass on any existing hint session values
+ } else {
+ ALOGD("Successfully connecting AIDL Power HAL");
+ // if AIDL, pass on any existing hint session values
// thread ids always safe to set
sHalWrapper->setPowerHintSessionThreadIds(oldPowerHintSessionThreadIds);
// only set duration and start if duration is defined
diff --git a/services/surfaceflinger/FlagManager.cpp b/services/surfaceflinger/FlagManager.cpp
index bd3cf741f5..f8ad8f6941 100644
--- a/services/surfaceflinger/FlagManager.cpp
+++ b/services/surfaceflinger/FlagManager.cpp
@@ -96,7 +96,8 @@ int64_t FlagManager::demo_flag() const {
}
bool FlagManager::use_adpf_cpu_hint() const {
- std::optional<bool> sysPropVal = std::nullopt;
+ std::optional<bool> sysPropVal =
+ doParse<bool>(base::GetProperty("debug.sf.enable_adpf_cpu_hint", "").c_str());
return getValue("AdpfFeature__adpf_cpu_hint", sysPropVal, false);
}
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3bfc2cc2a3..d33184fe3e 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -680,8 +680,12 @@ void SurfaceFlinger::bootFinished() {
readPersistentProperties();
mPowerAdvisor->onBootFinished();
- mPowerAdvisor->enablePowerHint(mFlagManager.use_adpf_cpu_hint());
- if (mPowerAdvisor->usePowerHintSession()) {
+ const bool powerHintEnabled = mFlagManager.use_adpf_cpu_hint();
+ mPowerAdvisor->enablePowerHint(powerHintEnabled);
+ const bool powerHintUsed = mPowerAdvisor->usePowerHintSession();
+ ALOGD("Power hint is %s",
+ powerHintUsed ? "supported" : (powerHintEnabled ? "unsupported" : "disabled"));
+ if (powerHintUsed) {
std::optional<pid_t> renderEngineTid = getRenderEngine().getRenderEngineTid();
std::vector<int32_t> tidList;
tidList.emplace_back(gettid());