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

Commit 87cd1151 authored by Steven Thomas's avatar Steven Thomas Committed by Android (Google) Code Review
Browse files

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

parents 02b37f75 f5a5f6e8
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.