summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-build-prod@system.gserviceaccount.com>2022-04-12 16:31:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-04-12 16:31:23 +0000
commita3996862bab999901d3682d36ca970e447980427 (patch)
tree61719eb9fb7cbc1a2881d76ae608222a874e4bfd
parentab9fd81c5e8fe736318fdf67a06d58ada737764d (diff)
parent2c69a7e738d0be214423d2d79c994c727e3c12cb (diff)
Merge "sf: Reconfigure display for mode change only if resolution changes" into s-keystone-qcom-dev
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 80b92b2aa5..1aeb21778c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -8301,8 +8301,16 @@ status_t SurfaceFlinger::setDesiredDisplayModeSpecsInternal(
// TODO(b/140204874): Leave the event in until we do proper testing with all apps that might
// be depending in this callback.
const auto activeMode = display->getActiveMode();
+ auto activeModeWidth = activeMode->getWidth();
+ auto activeModeHeight = activeMode->getHeight();
+ auto defaultModeWidth = (display->getMode(currentPolicy.defaultMode))->getWidth();
+ auto defaultModeHeight = (display->getMode(currentPolicy.defaultMode))->getHeight();
if (isDisplayActiveLocked(display)) {
- mScheduler->onPrimaryDisplayModeChanged(mAppConnectionHandle, display->getMode(currentPolicy.defaultMode));
+ if ((activeModeWidth == defaultModeWidth) && (activeModeHeight == defaultModeHeight)) {
+ mScheduler->onPrimaryDisplayModeChanged(mAppConnectionHandle, activeMode);
+ } else {
+ mScheduler->onPrimaryDisplayModeChanged(mAppConnectionHandle, display->getMode(currentPolicy.defaultMode));
+ }
toggleKernelIdleTimer();
} else {
mScheduler->onNonPrimaryDisplayModeChanged(mAppConnectionHandle, activeMode);