summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Arthur Hung <arthurhung@google.com> 2019-03-22 16:10:56 +0800
committer Arthur Hung <arthurhung@google.com> 2019-03-27 10:37:29 +0800
commitf8b7d1f37ab9a24b53f76f37521e5ed417cc4fce (patch)
treef1123a4b43a1dcf98063ef7a76a90f58e03bacc8
parent3c2ffd9770b384722f0f41f92bd1b9fe918e6556 (diff)
Fix no output on second physical display
The RefreshRateConfigs only store the configs of default display when init. But setAllowedDisplayConfigs would get NPE while getting these configs from secondary display. We need to cache the configs of external physical display when hotplug. Bug: 127868178 Test: build and flash mojave device. Change-Id: Ie1b598e8f77b28a444097deb0e05dda10d197db5
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 945f6fa6ac..a5f025d973 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2519,6 +2519,9 @@ void SurfaceFlinger::processDisplayHotplugEventsLocked() {
state.displayName = info->name;
mCurrentState.displays.add(mPhysicalDisplayTokens[info->id], state);
mInterceptor->saveDisplayCreation(state);
+ // TODO(b/123715322): Removes the per-display state that was added to the scheduler.
+ mRefreshRateConfigs[info->id] = std::make_shared<scheduler::RefreshRateConfigs>(
+ getHwComposer().getConfigs(info->id));
}
} else {
ALOGV("Removing display %s", to_string(info->id).c_str());
@@ -2530,6 +2533,7 @@ void SurfaceFlinger::processDisplayHotplugEventsLocked() {
mCurrentState.displays.removeItemsAt(index);
}
mPhysicalDisplayTokens.erase(info->id);
+ mRefreshRateConfigs.erase(info->id);
}
processDisplayChangesLocked();