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

Commit 773ee029 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [9734022, 9734337, 9733748, 9733749, 9734338, 9734339,...

Merge cherrypicks of [9734022, 9734337, 9733748, 9733749, 9734338, 9734339, 9734401, 9734402, 9734403, 9734404, 9734405, 9734023, 9734456, 9734340, 9733750, 9733999, 9733853, 9734000, 9734117, 9734341, 9734342, 9734049, 9734343, 9734458, 9734001] into rvc-release

Change-Id: Ie612ab344b756049fff7d647ac9b4ce6de84ca20
parents 57da32a1 72268f17
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -551,6 +551,10 @@ void Output::updateAndWriteCompositionState(
    ATRACE_CALL();
    ALOGV(__FUNCTION__);

    if (!getState().isEnabled) {
        return;
    }

    for (auto* layer : getOutputLayersOrderedByZ()) {
        layer->updateCompositionState(refreshArgs.updatingGeometryThisFrame,
                                      refreshArgs.devOptForceClientComposition);
+25 −0
Original line number Diff line number Diff line
@@ -482,6 +482,31 @@ TEST_F(OutputTest, getOutputLayerForLayerWorks) {
    EXPECT_EQ(nullptr, mOutput->getOutputLayerForLayer(&layer));
}

/*
 * Output::updateAndWriteCompositionState()
 */

TEST_F(OutputTest, updateAndWriteCompositionState_takesEarlyOutIfNotEnabled) {
    mOutput->editState().isEnabled = false;

    CompositionRefreshArgs args;
    mOutput->updateAndWriteCompositionState(args);
}

TEST_F(OutputTest, updateAndWriteCompositionState_updatesLayers) {
    mOutput->editState().isEnabled = true;
    mock::OutputLayer* outputLayer = new StrictMock<mock::OutputLayer>();
    mOutput->injectOutputLayerForTest(std::unique_ptr<OutputLayer>(outputLayer));

    EXPECT_CALL(*outputLayer, updateCompositionState(true, true)).Times(1);
    EXPECT_CALL(*outputLayer, writeStateToHWC(true)).Times(1);

    CompositionRefreshArgs args;
    args.updatingGeometryThisFrame = true;
    args.devOptForceClientComposition = true;
    mOutput->updateAndWriteCompositionState(args);
}

/*
 * Output::prepareFrame()
 */
+46 −34
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ public:

    std::unordered_set<HWC2::Capability> mDefaultCapabilities = {HWC2::Capability::SidebandStream};

    bool mDisplayOff = false;
    TestableSurfaceFlinger mFlinger;
    sp<DisplayDevice> mDisplay;
    sp<DisplayDevice> mExternalDisplay;
@@ -534,6 +535,7 @@ struct BaseLayerProperties {
    }

    static void setupHwcSetGeometryCallExpectations(CompositionTest* test) {
        if (!test->mDisplayOff) {
            // TODO: Coverage of other values
            EXPECT_CALL(*test->mComposer,
                        setLayerBlendMode(HWC_DISPLAY, HWC_LAYER, LayerProperties::BLENDMODE))
@@ -555,10 +557,12 @@ struct BaseLayerProperties {
            // These expectations retire on saturation as the code path these
            // expectations are for appears to make an extra call to them.
            // TODO: Investigate this extra call
        EXPECT_CALL(*test->mComposer, setLayerTransform(HWC_DISPLAY, HWC_LAYER, DEFAULT_TRANSFORM))
            EXPECT_CALL(*test->mComposer,
                        setLayerTransform(HWC_DISPLAY, HWC_LAYER, DEFAULT_TRANSFORM))
                    .Times(AtLeast(1))
                    .RetiresOnSaturation();
        }
    }

    static void setupHwcSetSourceCropBufferCallExpectations(CompositionTest* test) {
        EXPECT_CALL(*test->mComposer,
@@ -585,7 +589,9 @@ struct BaseLayerProperties {
    }

    static void setupHwcSetPerFrameColorCallExpectations(CompositionTest* test) {
        EXPECT_CALL(*test->mComposer, setLayerSurfaceDamage(HWC_DISPLAY, HWC_LAYER, _)).Times(1);
        if (!test->mDisplayOff) {
            EXPECT_CALL(*test->mComposer, setLayerSurfaceDamage(HWC_DISPLAY, HWC_LAYER, _))
                    .Times(1);

            // TODO: use COLOR
            EXPECT_CALL(*test->mComposer,
@@ -593,6 +599,7 @@ struct BaseLayerProperties {
                                      IComposerClient::Color({0xff, 0xff, 0xff, 0xff})))
                    .Times(1);
        }
    }

    static void setupHwcSetPerFrameBufferCallExpectations(CompositionTest* test) {
        EXPECT_CALL(*test->mComposer, setLayerSurfaceDamage(HWC_DISPLAY, HWC_LAYER, _)).Times(1);
@@ -940,10 +947,12 @@ struct KeepCompositionTypeVariant {
    static constexpr HWC2::Composition TYPE = static_cast<HWC2::Composition>(CompositionType);

    static void setupHwcSetCallExpectations(CompositionTest* test) {
        if (!test->mDisplayOff) {
            EXPECT_CALL(*test->mComposer,
                        setLayerCompositionType(HWC_DISPLAY, HWC_LAYER, CompositionType))
                    .Times(1);
        }
    }

    static void setupHwcGetCallExpectations(CompositionTest* test) {
        EXPECT_CALL(*test->mComposer, getChangedCompositionTypes(HWC_DISPLAY, _, _)).Times(1);
@@ -1341,6 +1350,7 @@ TEST_F(CompositionTest, captureScreenCursorLayer) {
 */

TEST_F(CompositionTest, displayOffHWCComposedNormalBufferLayerWithDirtyGeometry) {
    mDisplayOff = true;
    displayRefreshCompositionDirtyGeometry<CompositionCase<
            PoweredOffDisplaySetupVariant, BufferLayerVariant<DefaultLayerProperties>,
            KeepCompositionTypeVariant<IComposerClient::Composition::DEVICE>,
@@ -1348,6 +1358,7 @@ TEST_F(CompositionTest, displayOffHWCComposedNormalBufferLayerWithDirtyGeometry)
}

TEST_F(CompositionTest, displayOffHWCComposedNormalBufferLayerWithDirtyFrame) {
    mDisplayOff = true;
    displayRefreshCompositionDirtyFrame<CompositionCase<
            PoweredOffDisplaySetupVariant, BufferLayerVariant<DefaultLayerProperties>,
            KeepCompositionTypeVariant<IComposerClient::Composition::DEVICE>,
@@ -1355,6 +1366,7 @@ TEST_F(CompositionTest, displayOffHWCComposedNormalBufferLayerWithDirtyFrame) {
}

TEST_F(CompositionTest, displayOffREComposedNormalBufferLayer) {
    mDisplayOff = true;
    displayRefreshCompositionDirtyFrame<CompositionCase<
            PoweredOffDisplaySetupVariant, BufferLayerVariant<DefaultLayerProperties>,
            ChangeCompositionTypeVariant<IComposerClient::Composition::DEVICE,