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

Commit ce3a0a54 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

don't call hwc with non-empty layer lists for blanked displays

we now make sure to take the blanked state of a display into
account when we build its list of visible layers, this ensures
that we won't call prepare/set with a non-empty list when the
display is blanked.

Possibly fixes 7075380, 7103553, 7130187, 7016215

Bug: 7075380
Change-Id: I9fdd2e73d1b7621eaeca3d4ac2ae60d9fb1b3631
parent 2c7c8ba5
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -753,18 +753,19 @@ void SurfaceFlinger::rebuildLayerStacks() {
        ATRACE_CALL();
        mVisibleRegionsDirty = false;
        invalidateHwcGeometry();

        const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
        for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) {
            Region opaqueRegion;
            Region dirtyRegion;
            Vector< sp<LayerBase> > layersSortedByZ;
            const sp<DisplayDevice>& hw(mDisplays[dpy]);
            const Transform& tr(hw->getTransform());
            const Rect bounds(hw->getBounds());

            Region opaqueRegion;
            Region dirtyRegion;
            computeVisibleRegions(currentLayers,
            if (hw->canDraw()) {
                SurfaceFlinger::computeVisibleRegions(currentLayers,
                        hw->getLayerStack(), dirtyRegion, opaqueRegion);

            Vector< sp<LayerBase> > layersSortedByZ;
                const size_t count = currentLayers.size();
                for (size_t i=0 ; i<count ; i++) {
                    const sp<LayerBase>& layer(currentLayers[i]);
@@ -777,6 +778,7 @@ void SurfaceFlinger::rebuildLayerStacks() {
                        }
                    }
                }
            }
            hw->setVisibleLayersSortedByZ(layersSortedByZ);
            hw->undefinedRegion.set(bounds);
            hw->undefinedRegion.subtractSelf(tr.transform(opaqueRegion));
@@ -1776,6 +1778,7 @@ void SurfaceFlinger::onScreenReleased() {
        mEventThread->onScreenReleased();
        hw->releaseScreen();
        getHwComposer().release();
        mVisibleRegionsDirty = true;
        // from this point on, SF will stop drawing
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -351,8 +351,8 @@ private:
     * Compositing
     */
    void invalidateHwcGeometry();
    void computeVisibleRegions(const LayerVector& currentLayers,
            uint32_t layerStack,
    static void computeVisibleRegions(
            const LayerVector& currentLayers, uint32_t layerStack,
            Region& dirtyRegion, Region& opaqueRegion);

    void preComposition();