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

Commit 1151f467 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
parent 2c9b0191
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 =