SF: Initialize all displays on boot/restart
Generalize SF::initializeDisplays (called on boot and restart) to: - Apply the transaction that clears DisplayState to all displays. - Power on all displays. The first change removes a special case for the primary display, setting the stage for multi-display boot animation. Each display is assigned its own LayerStack, and set up with a projection to its active resolution. The second change fixes a bug where DisplayCapability::BRIGHTNESS was not detected for secondary displays present during boot. SF queries capabilities when a display is first powered on, but DM asks SF about brightness when the display is hotplugged, regardless of power mode. The general fix (covering external displays) is for DM to defer its query, but this stopgap covers internal displays. Revert I3a2eae4efc4a5c6113700a9ca9e9b261e364a878, which let the initial power mode be std::nullopt. This effectively forced DM's first request to setPowerMode(<rear display>, OFF), which would otherwise be ignored because OFF had been the default power mode on DisplayDevice creation. However, that special case confusingly took the same branch as the OFF to ON transition, and is no longer needed now that all displays are ON (from SF's perspective, not just HWC's) until the boot animation ends. Fixes: 267633741 Fixes: 150889228 Bug: 269510347 Test: Boot unfolded and folded. Test: Induce system_server crash. Test: InitializeDisplaysTest.initializesDisplays Change-Id: I5277a629f39b3b285452aa84d49ff84e3dc957ca
Showing
- libs/gui/include/gui/LayerState.h 21 additions, 4 deletionslibs/gui/include/gui/LayerState.h
- services/surfaceflinger/CompositionEngine/include/compositionengine/Display.h 1 addition, 1 deletion...ger/CompositionEngine/include/compositionengine/Display.h
- services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h 1 addition, 1 deletion...ompositionEngine/include/compositionengine/impl/Display.h
- services/surfaceflinger/CompositionEngine/src/Display.cpp 5 additions, 6 deletionsservices/surfaceflinger/CompositionEngine/src/Display.cpp
- services/surfaceflinger/DisplayDevice.cpp 8 additions, 15 deletionsservices/surfaceflinger/DisplayDevice.cpp
- services/surfaceflinger/DisplayDevice.h 5 additions, 6 deletionsservices/surfaceflinger/DisplayDevice.h
- services/surfaceflinger/SurfaceFlinger.cpp 25 additions, 28 deletionsservices/surfaceflinger/SurfaceFlinger.cpp
- services/surfaceflinger/SurfaceFlinger.h 2 additions, 1 deletionservices/surfaceflinger/SurfaceFlinger.h
- services/surfaceflinger/tests/unittests/ActiveDisplayRotationFlagsTest.cpp 4 additions, 29 deletions...linger/tests/unittests/ActiveDisplayRotationFlagsTest.cpp
- services/surfaceflinger/tests/unittests/DisplayTransactionTestHelpers.h 24 additions, 10 deletions...ceflinger/tests/unittests/DisplayTransactionTestHelpers.h
- services/surfaceflinger/tests/unittests/DualDisplayTransactionTest.h 57 additions, 0 deletions...rfaceflinger/tests/unittests/DualDisplayTransactionTest.h
- services/surfaceflinger/tests/unittests/SurfaceFlinger_FoldableTest.cpp 4 additions, 30 deletions...ceflinger/tests/unittests/SurfaceFlinger_FoldableTest.cpp
- services/surfaceflinger/tests/unittests/SurfaceFlinger_InitializeDisplaysTest.cpp 25 additions, 42 deletions...tests/unittests/SurfaceFlinger_InitializeDisplaysTest.cpp
- services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h 4 additions, 7 deletions...s/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
Loading
Please register or sign in to comment