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

Commit 672e526d authored by Matt Buckley's avatar Matt Buckley
Browse files

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

Replace the existing implementation using getVsyncPeriodFromHWC with
vsync data from the current display mode

Bug: b/240621816
Test: manual
Change-Id: Ie70d17400481eed31595a5f1ae4296c4df9d4071
(cherry picked from commit 1151f467)
parent 9bcb646d
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -2087,11 +2087,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 =