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

Commit 74faca21 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Android side of the fix for [2121211] Sholes has stutter during animations

a new method, compostionComplete() is added to the framebuffer hal, it is used by surfaceflinger to signal the driver that the composition is complete, BEFORE it releases its client. This gives a chance to the driver to
parent 1147de42
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public:

    bool isUpdateOnDemand() const { return mUpdateOnDemand; }
    status_t setUpdateRectangle(const Rect& updateRect);
    status_t compositionComplete();
    
private:
    friend class LightRefBase<FramebufferNativeWindow>;    
+3 −3
Original line number Diff line number Diff line
@@ -297,9 +297,9 @@ uint32_t DisplayHardware::getPageFlipCount() const {
    return mPageFlipCount;
}

/*
 * "Flip" the front and back buffers.
 */
status_t DisplayHardware::compositionComplete() const {
    return mNativeWindow->compositionComplete();
}

void DisplayHardware::flip(const Region& dirty) const
{
+2 −0
Original line number Diff line number Diff line
@@ -80,6 +80,8 @@ public:
    EGLDisplay getEGLDisplay() const { return mDisplay; }
    overlay_control_device_t* getOverlayEngine() const { return mOverlayEngine; }
    
    status_t compositionComplete() const;
    
    Rect bounds() const {
        return Rect(mWidth, mHeight);
    }
+3 −0
Original line number Diff line number Diff line
@@ -495,6 +495,9 @@ bool SurfaceFlinger::threadLoop()
        // repaint the framebuffer (if needed)
        handleRepaint();

        // inform the h/w that we're done compositing
        hw.compositionComplete();

        // release the clients before we flip ('cause flip might block)
        unlockClients();

+8 −0
Original line number Diff line number Diff line
@@ -158,6 +158,14 @@ status_t FramebufferNativeWindow::setUpdateRectangle(const Rect& r)
    return fbDev->setUpdateRect(fbDev, r.left, r.top, r.width(), r.height());
}

status_t FramebufferNativeWindow::compositionComplete()
{
    if (fbDev->compositionComplete) {
        return fbDev->compositionComplete(fbDev);
    }
    return INVALID_OPERATION;
}

int FramebufferNativeWindow::setSwapInterval(
        android_native_window_t* window, int interval) 
{