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

Commit 03be681d authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Set cache dirty on layer creation/destruction

The adapter misses an edge cases where a transaction both destroys and
creates a layer. Under these conditions, assignHwc1LayerIds() is not
called. mHwc1LayerMap contains reference to destroyed layers
and ultimately lead to segfault.

Test: Angler eng device and AUPT.
Change-Id: I96bcbabf74a80cc87df796c0bc84b84e2bda8614
parent 57a67bdc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -607,6 +607,7 @@ Error HWC2On1Adapter::Display::createLayer(hwc2_layer_t* outLayerId)
    mDevice.mLayers.emplace(std::make_pair(layer->getId(), layer));
    *outLayerId = layer->getId();
    ALOGV("[%" PRIu64 "] created layer %" PRIu64, mId, *outLayerId);
    mZIsDirty = true;
    return Error::None;
}

@@ -630,6 +631,7 @@ Error HWC2On1Adapter::Display::destroyLayer(hwc2_layer_t layerId)
        }
    }
    ALOGV("[%" PRIu64 "] destroyed layer %" PRIu64, mId, layerId);
    mZIsDirty = true;
    return Error::None;
}