diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2022-04-12 06:03:34 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2022-04-12 06:03:34 -0700 |
commit | 4c1c677f971065a40a79fc7db0b81f27f3e67f7a (patch) | |
tree | e15bd90c37bafed3e557af9248ded294f27b697d | |
parent | 1edff3d455e34db835db04f60f44435f9e74dfa3 (diff) | |
parent | 6874b796df02824db541cc8f490d1efd56853eca (diff) |
Merge "sf: Reconfigure display for mode change only if resolution changes"
-rwxr-xr-x | services/surfaceflinger/SurfaceFlinger.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 80b92b2aa5..1aeb21778c 100755 --- 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); |