SF: Introduce a configure stage
Decouple hotplug processing from commit of display transactions, as a
step toward per-display commit/composite. The configure stage will be
responsible for mode setting as well.
Bug: 241285876
Test: libsurfaceflinger_unittest
Change-Id: I72b7223760fa5896debb046f158845a0b4f4599a
diff --git a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
index 7dd9935..42585b5 100644
--- a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
+++ b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
@@ -317,8 +317,15 @@
* Forwarding for functions being tested
*/
- TimePoint commit(TimePoint frameTime, VsyncId vsyncId, TimePoint expectedVSyncTime) {
- mFlinger->commit(frameTime, vsyncId, expectedVSyncTime);
+ void configure() { mFlinger->configure(); }
+
+ void configureAndCommit() {
+ configure();
+ commitTransactionsLocked(eDisplayTransactionNeeded);
+ }
+
+ TimePoint commit(TimePoint frameTime, VsyncId vsyncId, TimePoint expectedVsyncTime) {
+ mFlinger->commit(frameTime, vsyncId, expectedVsyncTime);
return frameTime;
}
@@ -362,19 +369,15 @@
dispSurface, producer);
}
- auto commitTransactionsLocked(uint32_t transactionFlags) {
+ void commitTransactionsLocked(uint32_t transactionFlags) {
Mutex::Autolock lock(mFlinger->mStateLock);
- return mFlinger->commitTransactionsLocked(transactionFlags);
+ mFlinger->commitTransactionsLocked(transactionFlags);
}
void onComposerHalHotplug(hal::HWDisplayId hwcDisplayId, hal::Connection connection) {
mFlinger->onComposerHalHotplug(hwcDisplayId, connection);
}
- void processDisplayHotplugEvents() {
- FTL_FAKE_GUARD(mFlinger->mStateLock, mFlinger->processDisplayHotplugEventsLocked());
- }
-
auto setDisplayStateLocked(const DisplayState& s) {
Mutex::Autolock lock(mFlinger->mStateLock);
return mFlinger->setDisplayStateLocked(s);