Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c0d2fbd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: Move glComp/DispTimeline to SFBE"

parents 2ed931c7 73bededb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -364,7 +364,6 @@ public:
    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
+4 −4
Original line number Diff line number Diff line
@@ -1666,20 +1666,20 @@ void SurfaceFlinger::postComposition(nsecs_t refreshStartTime)
    // |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();
+3 −2
Original line number Diff line number Diff line
@@ -143,6 +143,9 @@ public:
    EGLContext mEGLContext;
    EGLDisplay mEGLDisplay;
    
    FenceTimeline mGlCompositionDoneTimeline;
    FenceTimeline mDisplayTimeline;

    // protected by mCompositorTimingLock;
    mutable std::mutex mCompositorTimingLock;
    CompositorTiming mCompositorTiming;
@@ -734,8 +737,6 @@ private:
    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