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

Commit f6760786 authored by Jamie Gennis's avatar Jamie Gennis Committed by Android Git Automerger
Browse files

am a4310c8b: SurfaceFlinger: don\'t always set HWC_GEOM_CHGD

* commit 'a4310c8b':
  SurfaceFlinger: don't always set HWC_GEOM_CHGD
parents e1549fcb a4310c8b
Loading
Loading
Loading
Loading
+35 −21
Original line number Diff line number Diff line
@@ -940,7 +940,7 @@ void SurfaceFlinger::setUpHWComposer() {
    HWComposer& hwc(getHwComposer());
    if (hwc.initCheck() == NO_ERROR) {
        // build the h/w work list
        const bool workListsDirty = mHwWorkListDirty;
        if (CC_UNLIKELY(mHwWorkListDirty)) {
            mHwWorkListDirty = false;
            for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) {
                sp<const DisplayDevice> hw(mDisplays[dpy]);
@@ -949,28 +949,42 @@ void SurfaceFlinger::setUpHWComposer() {
                    const Vector< sp<LayerBase> >& currentLayers(
                        hw->getVisibleLayersSortedByZ());
                    const size_t count = currentLayers.size();
                if (hwc.createWorkList(id, count) >= 0) {
                    if (hwc.createWorkList(id, count) == NO_ERROR) {
                        HWComposer::LayerListIterator cur = hwc.begin(id);
                        const HWComposer::LayerListIterator end = hwc.end(id);
                        for (size_t i=0 ; cur!=end && i<count ; ++i, ++cur) {
                            const sp<LayerBase>& layer(currentLayers[i]);

                        if (CC_UNLIKELY(workListsDirty)) {
                            layer->setGeometry(hw, *cur);
                            if (mDebugDisableHWC || mDebugRegion) {
                                cur->setSkip(true);
                            }
                        }
                    }
                }
            }
        }

        // set the per-frame data
        for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) {
            sp<const DisplayDevice> hw(mDisplays[dpy]);
            const int32_t id = hw->getHwcDisplayId();
            if (id >= 0) {
                const Vector< sp<LayerBase> >& currentLayers(
                    hw->getVisibleLayersSortedByZ());
                const size_t count = currentLayers.size();
                HWComposer::LayerListIterator cur = hwc.begin(id);
                const HWComposer::LayerListIterator end = hwc.end(id);
                for (size_t i=0 ; cur!=end && i<count ; ++i, ++cur) {
                    /*
                     * update the per-frame h/w composer data for each layer
                     * and build the transparent region of the FB
                     */
                    const sp<LayerBase>& layer(currentLayers[i]);
                    layer->setPerFrameData(hw, *cur);
                }
            }
        }
        }

        status_t err = hwc.prepare();
        ALOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));
    }