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

Commit ad59d3ad authored by Steven Thomas's avatar Steven Thomas Committed by android-build-merger
Browse files

Merge "Fix concurrent writes to the hardware composer" into oc-dr1-dev

am: 87cd1151

Change-Id: I00d0a5267913c284eddd97bfe7eefb15b9ee403e
parents 5b7045ee 87cd1151
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1255,17 +1255,14 @@ void SurfaceFlinger::setVsyncEnabled(int disp, int enabled) {
            enabled ? HWC2::Vsync::Enable : HWC2::Vsync::Disable);
}

void SurfaceFlinger::clearHwcLayers(const LayerVector& layers) {
    for (size_t i = 0; i < layers.size(); ++i) {
        layers[i]->clearHwcLayers();
    }
}

// Note: it is assumed the caller holds |mStateLock| when this is called
void SurfaceFlinger::resetHwcLocked() {
    disableHardwareVsync(true);
    clearHwcLayers(mDrawingState.layersSortedByZ);
    clearHwcLayers(mCurrentState.layersSortedByZ);
    for (size_t disp = 0; disp < mDisplays.size(); ++disp) {
        clearHwcLayers(mDisplays[disp]->getVisibleLayersSortedByZ());
    }
    // Clear the drawing state so that the logic inside of
    // handleTransactionLocked will fire. It will determine the delta between
    // mCurrentState and mDrawingState and re-apply all changes when we make the
+6 −1
Original line number Diff line number Diff line
@@ -586,7 +586,12 @@ private:
    /* ------------------------------------------------------------------------
     * VrFlinger
     */
    void clearHwcLayers(const LayerVector& layers);
    template<typename T>
    void clearHwcLayers(const T& layers) {
        for (size_t i = 0; i < layers.size(); ++i) {
            layers[i]->clearHwcLayers();
        }
    }
    void resetHwcLocked();

    // Check to see if we should handoff to vr flinger.