summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevanshi Bansal <quic_devanshi@quicinc.com>2022-04-12 14:09:22 +0530
committerThirupathi Reddy R <quic_treddyr@quicinc.com>2022-04-12 18:14:07 +0530
commit6874b796df02824db541cc8f490d1efd56853eca (patch)
tree562197c4d96d74ea56619acaf88a1f5418f08246
parentb74706e534ada99920bb5b92fa046e47cd29d0a0 (diff)
sf: Reconfigure display for mode change only if resolution changes
CRs-Fixed: 3170218 Change-Id: I9b2db0b5a047c159440ef532211c0cfaa03808da
-rwxr-xr-xservices/surfaceflinger/SurfaceFlinger.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index f08d8489cd..f3000962f4 100755
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -8305,8 +8305,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);