SF: Move glComp/DispTimeline to SFBE
Move glCompositionDoneTimeline and mDisplayTimeline to the
SurfaceFlingerBE object.
Test: Build/run manually
Change-Id: I77f2cc39ecf20d5b1c93b5396e37df5b1273d613
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 9a98e1e..cf7fc50 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -364,7 +364,6 @@
void forceClientComposition(int32_t hwcId);
bool getForceClientComposition(int32_t hwcId);
virtual void setPerFrameData(const sp<const DisplayDevice>& displayDevice) = 0;
- void setUpFrameBuffer(const sp<const DisplayDevice>& displayDevice);
// callIntoHwc exists so we can update our local state and call
// acceptDisplayChanges without unnecessarily updating the device's state
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index cfabef1..54695b5 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1666,20 +1666,20 @@
// |mStateLock| not needed as we are on the main thread
const sp<const DisplayDevice> hw(getDefaultDisplayDeviceLocked());
- mGlCompositionDoneTimeline.updateSignalTimes();
+ getBE().mGlCompositionDoneTimeline.updateSignalTimes();
std::shared_ptr<FenceTime> glCompositionDoneFenceTime;
if (getBE().mHwc->hasClientComposition(HWC_DISPLAY_PRIMARY)) {
glCompositionDoneFenceTime =
std::make_shared<FenceTime>(hw->getClientTargetAcquireFence());
- mGlCompositionDoneTimeline.push(glCompositionDoneFenceTime);
+ getBE().mGlCompositionDoneTimeline.push(glCompositionDoneFenceTime);
} else {
glCompositionDoneFenceTime = FenceTime::NO_FENCE;
}
- mDisplayTimeline.updateSignalTimes();
+ getBE().mDisplayTimeline.updateSignalTimes();
sp<Fence> presentFence = getBE().mHwc->getPresentFence(HWC_DISPLAY_PRIMARY);
auto presentFenceTime = std::make_shared<FenceTime>(presentFence);
- mDisplayTimeline.push(presentFenceTime);
+ getBE().mDisplayTimeline.push(presentFenceTime);
nsecs_t vsyncPhase = mPrimaryDispSync.computeNextRefresh(0);
nsecs_t vsyncInterval = mPrimaryDispSync.getPeriod();
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 85cba98..2477bdc 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -142,6 +142,9 @@
std::unique_ptr<RenderEngine> mRenderEngine;
EGLContext mEGLContext;
EGLDisplay mEGLDisplay;
+
+ FenceTimeline mGlCompositionDoneTimeline;
+ FenceTimeline mDisplayTimeline;
// protected by mCompositorTimingLock;
mutable std::mutex mCompositorTimingLock;
@@ -734,8 +737,6 @@
std::vector<sp<Layer>> mLayersWithQueuedFrames;
sp<Fence> mPreviousPresentFence = Fence::NO_FENCE;
bool mHadClientComposition = false;
- FenceTimeline mGlCompositionDoneTimeline;
- FenceTimeline mDisplayTimeline;
// this may only be written from the main thread with mStateLock held
// it may be read from other threads with mStateLock held