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

Commit c988ee4c authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter
Browse files

Remove redundent layer setDataspace calls.

Cache the layer's dataspace in hwc2 and only send
to the HAL when it changes. Allows HAL to optimize
use of layer.

Bug: 38396128
Test: Manually checked systraces on Pixel
Change-Id: Ia94bebe7de9f79d01ae19b9917591837d865fea9
parent a5978594
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -856,6 +856,10 @@ Error Layer::setCompositionType(Composition type)

Error Layer::setDataspace(android_dataspace_t dataspace)
{
    if (dataspace == mDataSpace) {
        return Error::None;
    }
    mDataSpace = dataspace;
    auto intDataspace = static_cast<Hwc2::Dataspace>(dataspace);
    auto intError = mDevice.mComposer->setLayerDataspace(mDisplayId,
            mId, intDataspace);
+1 −0
Original line number Diff line number Diff line
@@ -326,6 +326,7 @@ private:
    hwc2_display_t mDisplayId;
    Device& mDevice;
    hwc2_layer_t mId;
    android_dataspace mDataSpace = HAL_DATASPACE_UNKNOWN;
};

} // namespace HWC2