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

Commit f3c07d4f authored by Dan Stoza's avatar Dan Stoza Committed by Andy McFadden
Browse files

Fix virtual display nesting

This fixes the cycling rendering loop caused by nesting virtual
displays by preventing them from recomposing if their contents
haven't changed.

(cherry-pick from master I600365c0fd5d3ad93e04295d26cf9de177ffc79b)

Bug: 12101046
Change-Id: I6182993d53537781aedb522f97a50f06eed8b80f
parent cf818ebb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -199,8 +199,8 @@ void DisplayDevice::flip(const Region& dirty) const
    mPageFlipCount++;
}

status_t DisplayDevice::beginFrame() const {
    return mDisplaySurface->beginFrame();
status_t DisplayDevice::beginFrame(bool mustRecompose) const {
    return mDisplaySurface->beginFrame(mustRecompose);
}

status_t DisplayDevice::prepareFrame(const HWComposer& hwc) const {
+3 −1
Original line number Diff line number Diff line
@@ -124,7 +124,9 @@ public:
    int32_t                 getHwcDisplayId() const { return mHwcDisplayId; }
    const wp<IBinder>&      getDisplayToken() const { return mDisplayToken; }

    status_t beginFrame() const;
    // We pass in mustRecompose so we can keep VirtualDisplaySurface's state
    // machine happy without actually queueing a buffer if nothing has changed
    status_t beginFrame(bool mustRecompose) const;
    status_t prepareFrame(const HWComposer& hwc) const;

    void swapBuffers(HWComposer& hwc) const;
+3 −1
Original line number Diff line number Diff line
@@ -33,7 +33,9 @@ public:
    // beginFrame is called at the beginning of the composition loop, before
    // the configuration is known. The DisplaySurface should do anything it
    // needs to do to enable HWComposer to decide how to compose the frame.
    virtual status_t beginFrame() = 0;
    // We pass in mustRecompose so we can keep VirtualDisplaySurface's state
    // machine happy without actually queueing a buffer if nothing has changed.
    virtual status_t beginFrame(bool mustRecompose) = 0;

    // prepareFrame is called after the composition configuration is known but
    // before composition takes place. The DisplaySurface can use the
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ FramebufferSurface::FramebufferSurface(HWComposer& hwc, int disp,
    mConsumer->setDefaultMaxBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS);
}

status_t FramebufferSurface::beginFrame() {
status_t FramebufferSurface::beginFrame(bool mustRecompose) {
    return NO_ERROR;
}

+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class FramebufferSurface : public ConsumerBase,
public:
    FramebufferSurface(HWComposer& hwc, int disp, const sp<IGraphicBufferConsumer>& consumer);

    virtual status_t beginFrame();
    virtual status_t beginFrame(bool mustRecompose);
    virtual status_t prepareFrame(CompositionType compositionType);
    virtual status_t compositionComplete();
    virtual status_t advanceFrame();
Loading