Revert "Revert "surfacefligner: revert recent BE/FE split changes""

This reverts commit 0756cdd4b9cef33107ed13763d7168bc3363fae9.

Reason for revert: b/111793219 Power regression, with urgent fix needed.

Test: run cts -m CtsDeqpTestCases, run cts -m CtsViewTestCases

Change-Id: I4f089100af6a788b5973961a214132c97597fa7e
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 2978b7f..e107f42 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -225,8 +225,6 @@
     // use to differentiate callbacks from different hardware composer
     // instances. Each hardware composer instance gets a different sequence id.
     int32_t mComposerSequenceId;
-
-    std::vector<CompositionInfo> mCompositionInfo;
 };
 
 
@@ -645,8 +643,8 @@
     void computeVisibleRegions(const sp<const DisplayDevice>& display, Region& dirtyRegion,
                                Region& opaqueRegion);
 
-    void preComposition();
-    void postComposition();
+    void preComposition(nsecs_t refreshStartTime);
+    void postComposition(nsecs_t refreshStartTime);
     void updateCompositorTiming(
             nsecs_t vsyncPhase, nsecs_t vsyncInterval, nsecs_t compositeTime,
             std::shared_ptr<FenceTime>& presentFenceTime);
@@ -664,19 +662,7 @@
     void pickColorMode(const sp<DisplayDevice>& display, ui::ColorMode* outMode,
                        ui::Dataspace* outDataSpace, ui::RenderIntent* outRenderIntent) const;
 
-    void calculateWorkingSet();
-    /*
-     * beginFrame - This function handles any pre-frame processing that needs to be
-     * prior to any CompositionInfo handling and is not dependent on data in
-     * CompositionInfo
-     */
-    void beginFrame();
-    /* prepareFrame - This function will call into the DisplayDevice to prepare a
-     * frame after CompositionInfo has been programmed.   This provides a mechanism
-     * to prepare the hardware composer
-     */
-    void prepareFrame();
-    void setUpHWComposer(const CompositionInfo& compositionInfo);
+    void setUpHWComposer();
     void doComposition();
     void doDebugFlashRegions();
     void doTracing(const char* where);
@@ -794,11 +780,6 @@
     // access must be protected by mInvalidateLock
     volatile int32_t mRepaintEverything;
 
-    // helper methods
-    void configureHwcCommonData(const CompositionInfo& compositionInfo) const;
-    void configureDeviceComposition(const CompositionInfo& compositionInfo) const;
-    void configureSidebandComposition(const CompositionInfo& compositionInfo) const;
-
     // constant members (no synchronization needed for access)
     nsecs_t mBootTime;
     bool mGpuToCpuSupported;
@@ -877,7 +858,6 @@
     Mutex mHWVsyncLock;
     bool mPrimaryHWVsyncEnabled;
     bool mHWVsyncAvailable;
-    nsecs_t mRefreshStartTime;
 
     std::atomic<bool> mRefreshPending{false};