summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bouyack <mbouyack@google.com>2017-06-07 22:53:37 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-06-07 22:53:37 +0000
commitf613f073b2d8a17ac65a68cf5484a44524a70d20 (patch)
treec7ff446dc7ef8a0ccb647075b9c984a756ab2498
parent21e9397776d41f6fec16bf6a35d7ce9ec5949559 (diff)
parent9e5585930a7a540ae54c6c36446d7e6e909b2301 (diff)
downloadnative-f613f073b2d8a17ac65a68cf5484a44524a70d20.tar.gz
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev
am: 9e5585930a Change-Id: I3b534f26c60bd8d6cf0736da7de807cf339a1cdd
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp6
-rw-r--r--services/surfaceflinger/SurfaceFlinger_hwc1.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 448f12ac95..b009fca6e0 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2642,7 +2642,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
@@ -2656,7 +2657,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);
diff --git a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp
index a371c76e6d..271930bdce 100644
--- a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp
+++ b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp
@@ -2558,7 +2558,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
@@ -2572,7 +2573,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);