Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63a6a4eb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Get vsync period for ADPF CPU hints in SF using display mode"

parents 10538f4d 1151f467
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -2067,11 +2067,9 @@ bool SurfaceFlinger::commit(nsecs_t frameTime, int64_t vsyncId, nsecs_t expected
    // Save this once per commit + composite to ensure consistency
    mPowerHintSessionEnabled = mPowerAdvisor->usePowerHintSession();
    if (mPowerHintSessionEnabled) {
        nsecs_t vsyncPeriod;
        {
            Mutex::Autolock lock(mStateLock);
            vsyncPeriod = getVsyncPeriodFromHWC();
        }
        const auto& display = FTL_FAKE_GUARD(mStateLock, getDefaultDisplayDeviceLocked()).get();
        // get stable vsync period from display mode
        const nsecs_t vsyncPeriod = display->getActiveMode()->getVsyncPeriod();
        mPowerAdvisor->setCommitStart(frameTime);
        mPowerAdvisor->setExpectedPresentTime(mExpectedPresentTime);
        const nsecs_t idealSfWorkDuration =