diff options
| author | 2022-08-12 18:17:14 +0000 | |
|---|---|---|
| committer | 2022-08-12 18:17:14 +0000 | |
| commit | 0d6f11f9ee68bb96c82f58eb61b92c0848fe5423 (patch) | |
| tree | fa83c8469fa4042a35c1a7dba57d79bbd01982b5 /services/surfaceflinger/SurfaceFlinger.cpp | |
| parent | 168609b590deea4774f2e9cc6295f1e4a219c971 (diff) | |
| parent | 5b59d94a5a6739416ecd00251616c437e6c84368 (diff) | |
Merge "Disable ADPF CPU hints for SF unless active display is on" into tm-qpr-dev
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 8621d31d91..83ec4ec213 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2085,7 +2085,11 @@ bool SurfaceFlinger::commit(nsecs_t frameTime, int64_t vsyncId, nsecs_t expected } // Save this once per commit + composite to ensure consistency - mPowerHintSessionEnabled = mPowerAdvisor->usePowerHintSession(); + // TODO (b/240619471): consider removing active display check once AOD is fixed + const auto activeDisplay = + FTL_FAKE_GUARD(mStateLock, getDisplayDeviceLocked(mActiveDisplayToken)); + mPowerHintSessionEnabled = mPowerAdvisor->usePowerHintSession() && activeDisplay && + activeDisplay->getPowerMode() == hal::PowerMode::ON; if (mPowerHintSessionEnabled) { const auto& display = FTL_FAKE_GUARD(mStateLock, getDefaultDisplayDeviceLocked()).get(); // get stable vsync period from display mode |