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

Commit cd9b55c7 authored by Matthew Bouyack's avatar Matthew Bouyack
Browse files

Eliminate redundant changes to hardware vsync state.

When transitioning between NORMAL and DOZE power modes
we were redundantly calling resyncHardwareVsync.

Similarly, when transitioning from DOZE_SUSPEND to OFF
we were redundantly calling disableHardwareVsync.

This change eliminates those redundant calls.

Fixes bug 62235417

Change-Id: I513bbf94a7ab973ab258efe16436441ac2379b70
parent 177759a9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3210,7 +3210,8 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& hw,
            ALOGW("Couldn't set SCHED_OTHER on display off");
        }

        if (type == DisplayDevice::DISPLAY_PRIMARY) {
        if (type == DisplayDevice::DISPLAY_PRIMARY &&
            currentMode != HWC_POWER_MODE_DOZE_SUSPEND) {
            disableHardwareVsync(true); // also cancels any in-progress resync

            // FIXME: eventthread only knows about the main display right now
@@ -3224,7 +3225,8 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& hw,
               mode == HWC_POWER_MODE_NORMAL) {
        // Update display while dozing
        getHwComposer().setPowerMode(type, mode);
        if (type == DisplayDevice::DISPLAY_PRIMARY) {
        if (type == DisplayDevice::DISPLAY_PRIMARY &&
            currentMode == HWC_POWER_MODE_DOZE_SUSPEND) {
            // FIXME: eventthread only knows about the main display right now
            mEventThread->onScreenAcquired();
            resyncToHardwareVsync(true);
+4 −2
Original line number Diff line number Diff line
@@ -2869,7 +2869,8 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& hw,
            ALOGW("Couldn't set SCHED_OTHER on display off");
        }

        if (type == DisplayDevice::DISPLAY_PRIMARY) {
        if (type == DisplayDevice::DISPLAY_PRIMARY &&
            currentMode != HWC_POWER_MODE_DOZE_SUSPEND) {
            disableHardwareVsync(true); // also cancels any in-progress resync

            // FIXME: eventthread only knows about the main display right now
@@ -2883,7 +2884,8 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& hw,
               mode == HWC_POWER_MODE_NORMAL) {
        // Update display while dozing
        getHwComposer().setPowerMode(type, mode);
        if (type == DisplayDevice::DISPLAY_PRIMARY) {
        if (type == DisplayDevice::DISPLAY_PRIMARY &&
            currentMode == HWC_POWER_MODE_DOZE_SUSPEND) {
            // FIXME: eventthread only knows about the main display right now
            mEventThread->onScreenAcquired();
            resyncToHardwareVsync(true);