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

Commit bd624fb2 authored by Ady Abraham's avatar Ady Abraham Committed by Automerger Merge Worker
Browse files

Merge "SF: turn off kernel idle timer when refresh rate switching is disabled"...

Merge "SF: turn off kernel idle timer when refresh rate switching is disabled" into sc-dev am: 26953ee2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15028263

Change-Id: I809d6ac0bd847488041d691891d99b7834bcc255
parents 7e8e1a0d 26953ee2
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -867,11 +867,6 @@ RefreshRateConfigs::KernelIdleTimerAction RefreshRateConfigs::getIdleTimerAction
        return RefreshRateConfigs::KernelIdleTimerAction::TurnOff;
        return RefreshRateConfigs::KernelIdleTimerAction::TurnOff;
    }
    }
    if (minByPolicy == maxByPolicy) {
    if (minByPolicy == maxByPolicy) {
        // Do not sent the call to toggle off kernel idle timer if the device min and policy min and
        // max are all the same. This saves us extra unnecessary calls to sysprop.
        if (deviceMin == minByPolicy) {
            return RefreshRateConfigs::KernelIdleTimerAction::NoChange;
        }
        return RefreshRateConfigs::KernelIdleTimerAction::TurnOff;
        return RefreshRateConfigs::KernelIdleTimerAction::TurnOff;
    }
    }
    // Turn on the timer in all other cases.
    // Turn on the timer in all other cases.
+0 −1
Original line number Original line Diff line number Diff line
@@ -318,7 +318,6 @@ public:
    // Class to enumerate options around toggling the kernel timer on and off. We have an option
    // Class to enumerate options around toggling the kernel timer on and off. We have an option
    // for no change to avoid extra calls to kernel.
    // for no change to avoid extra calls to kernel.
    enum class KernelIdleTimerAction {
    enum class KernelIdleTimerAction {
        NoChange, // Do not change the idle timer.
        TurnOff,  // Turn off the idle timer.
        TurnOff,  // Turn off the idle timer.
        TurnOn    // Turn on the idle timer.
        TurnOn    // Turn on the idle timer.
    };
    };
+0 −2
Original line number Original line Diff line number Diff line
@@ -5811,8 +5811,6 @@ void SurfaceFlinger::toggleKernelIdleTimer() {
                mKernelIdleTimerEnabled = true;
                mKernelIdleTimerEnabled = true;
            }
            }
            break;
            break;
        case KernelIdleTimerAction::NoChange:
            break;
    }
    }
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -1897,10 +1897,10 @@ TEST_F(RefreshRateConfigsTest, testKernelIdleTimerAction) {
              0);
              0);
    EXPECT_EQ(KernelIdleTimerAction::TurnOn, refreshRateConfigs->getIdleTimerAction());
    EXPECT_EQ(KernelIdleTimerAction::TurnOn, refreshRateConfigs->getIdleTimerAction());


    // SetPolicy(60, 60), current 60Hz => NoChange, avoid extra calls.
    // SetPolicy(60, 60), current 60Hz => TurnOff
    ASSERT_GE(refreshRateConfigs->setDisplayManagerPolicy({HWC_CONFIG_ID_60, {Fps(60), Fps(60)}}),
    ASSERT_GE(refreshRateConfigs->setDisplayManagerPolicy({HWC_CONFIG_ID_60, {Fps(60), Fps(60)}}),
              0);
              0);
    EXPECT_EQ(KernelIdleTimerAction::NoChange, refreshRateConfigs->getIdleTimerAction());
    EXPECT_EQ(KernelIdleTimerAction::TurnOff, refreshRateConfigs->getIdleTimerAction());


    // SetPolicy(90, 90), current 90Hz => TurnOff.
    // SetPolicy(90, 90), current 90Hz => TurnOff.
    ASSERT_GE(refreshRateConfigs->setDisplayManagerPolicy({HWC_CONFIG_ID_90, {Fps(90), Fps(90)}}),
    ASSERT_GE(refreshRateConfigs->setDisplayManagerPolicy({HWC_CONFIG_ID_90, {Fps(90), Fps(90)}}),