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

Unverified Commit c7c7b69e authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-12.0.0_r12' into staging/lineage-19.0_merge-android-12.0.0_r12

Android 12.0.0 release 12

* tag 'android-12.0.0_r12':
  Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy
  Revert "Add ExternalTexture class into RenderEngine interface"
  Revert "Remove setFrame from BufferStateLayer"
  Revert "Remove setFrame from BufferStateLayer"
  Call apexd --unmount-all at the end of otapreopt_chroot run
  Call apexd --unmount-all at the end of otapreopt_chroot run
  Revert "Increase performance for screenshots by pre-loading the buffer"
  Set the render rate on the created surface frame instead of the old one.
  Revert "Pass in format when creating and updating BBQ."
  Revert "Pass in format when creating and updating BBQ."

Change-Id: I2644120e57ed81c699c5059e4a1aeba95cb28c94
parents 65be59a4 3984db8c
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -630,7 +630,10 @@ bool BLASTBufferQueue::maxBuffersAcquired(bool includeExtraAcquire) const {

class BBQSurface : public Surface {
private:
    std::mutex mMutex;
    sp<BLASTBufferQueue> mBbq;
    bool mDestroyed = false;

public:
    BBQSurface(const sp<IGraphicBufferProducer>& igbp, bool controlledByApp,
               const sp<IBinder>& scHandle, const sp<BLASTBufferQueue>& bbq)
@@ -650,6 +653,10 @@ public:

    status_t setFrameRate(float frameRate, int8_t compatibility,
                          int8_t changeFrameRateStrategy) override {
        std::unique_lock _lock{mMutex};
        if (mDestroyed) {
            return DEAD_OBJECT;
        }
        if (!ValidateFrameRate(frameRate, compatibility, changeFrameRateStrategy,
                               "BBQSurface::setFrameRate")) {
            return BAD_VALUE;
@@ -658,8 +665,20 @@ public:
    }

    status_t setFrameTimelineInfo(const FrameTimelineInfo& frameTimelineInfo) override {
        std::unique_lock _lock{mMutex};
        if (mDestroyed) {
            return DEAD_OBJECT;
        }
        return mBbq->setFrameTimelineInfo(frameTimelineInfo);
    }

    void destroy() override {
        Surface::destroy();

        std::unique_lock _lock{mMutex};
        mDestroyed = true;
        mBbq = nullptr;
    }
};

// TODO: Can we coalesce this with frame updates? Need to confirm
+10 −0
Original line number Diff line number Diff line
@@ -2622,4 +2622,14 @@ status_t Surface::setFrameTimelineInfo(const FrameTimelineInfo& frameTimelineInf
    return composerService()->setFrameTimelineInfo(mGraphicBufferProducer, frameTimelineInfo);
}

sp<IBinder> Surface::getSurfaceControlHandle() const {
    Mutex::Autolock lock(mMutex);
    return mSurfaceControlHandle;
}

void Surface::destroy() {
    Mutex::Autolock lock(mMutex);
    mSurfaceControlHandle = nullptr;
}

}; // namespace android
+2 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ public:
     */
    sp<IGraphicBufferProducer> getIGraphicBufferProducer() const;

    sp<IBinder> getSurfaceControlHandle() const { return mSurfaceControlHandle; }
    sp<IBinder> getSurfaceControlHandle() const;

    /* convenience function to check that the given surface is non NULL as
     * well as its IGraphicBufferProducer */
@@ -333,6 +333,7 @@ public:
    virtual int connect(
            int api, bool reportBufferRemoval,
            const sp<SurfaceListener>& sListener);
    virtual void destroy();

    // When client connects to Surface with reportBufferRemoval set to true, any buffers removed
    // from this Surface will be collected and returned here. Once this method returns, these