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

Commit bb117c7b authored by Rob Carr's avatar Rob Carr Committed by Automerger Merge Worker
Browse files

Merge "SurfaceFlinger: Disable early-release on multi displays" into tm-dev am: 2d54df60

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/17145712

Change-Id: Ibe4d839ec49be8cc4309ed6c7634d3db4f8517cb
parents 4ea2473e 2d54df60
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -362,6 +362,8 @@ void BufferLayer::onPostComposition(const DisplayDevice* display,
    // composition.
    if (!mBufferInfo.mFrameLatencyNeeded) return;

    mAlreadyDisplayedThisCompose = false;

    // Update mFrameEventHistory.
    {
        Mutex::Autolock lock(mFrameEventHistoryMutex);
+8 −10
Original line number Diff line number Diff line
@@ -75,17 +75,15 @@ BufferStateLayer::~BufferStateLayer() {
// -----------------------------------------------------------------------
void BufferStateLayer::onLayerDisplayed(
        std::shared_future<renderengine::RenderEngineResult> futureRenderEngineResult) {
    // If a layer has been displayed again we may need to clear
    // the mLastClientComposition fence that we use for early release in setBuffer
    // (as we now have a new fence which won't pass through the client composition path in some cases
    //  e.g. screenshot). We expect one call to onLayerDisplayed after receiving the GL comp fence
    // from a single composition cycle, and want to clear on the second call
    // (which we track with mLastClientCompositionDisplayed)
   if (mLastClientCompositionDisplayed) {
    // If we are displayed on multiple displays in a single composition cycle then we would
    // need to do careful tracking to enable the use of the mLastClientCompositionFence.
    //  For example we can only use it if all the displays are client comp, and we need
    //  to merge all the client comp fences. We could do this, but for now we just
    // disable the optimization when a layer is composed on multiple displays.
    if (mAlreadyDisplayedThisCompose) {
        mLastClientCompositionFence = nullptr;
        mLastClientCompositionDisplayed = false;
    } else if (mLastClientCompositionFence) {
        mLastClientCompositionDisplayed = true;
    } else {
        mAlreadyDisplayedThisCompose = true;
    }

    // The previous release fence notifies the client that SurfaceFlinger is done with the previous
+1 −1
Original line number Diff line number Diff line
@@ -1049,7 +1049,7 @@ protected:
    mutable bool mDrawingStateModified = false;

    sp<Fence> mLastClientCompositionFence;
    bool mLastClientCompositionDisplayed = false;
    bool mAlreadyDisplayedThisCompose = false;
private:
    virtual void setTransformHint(ui::Transform::RotationFlags) {}