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

Commit 06b0211a authored by Ram Indani's avatar Ram Indani Committed by Android (Google) Code Review
Browse files

Merge changes from topic "fipresentOrValidate" into main

* changes:
  [VTS] Update validateDisplay with frameIntervalNs
  Update ComposerClientWriter::validateDisplay with frameInterval
  Update ComposerClientWriter::presentOrValidate with frameInterval
parents a541cf20 cdcfcafc
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -98,17 +98,21 @@ class ComposerClientWriter final {
    }
    }


    void validateDisplay(int64_t display,
    void validateDisplay(int64_t display,
                         std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
                         std::optional<ClockMonotonicTimestamp> expectedPresentTime,
                         int32_t frameIntervalNs) {
        auto& command = getDisplayCommand(display);
        auto& command = getDisplayCommand(display);
        command.expectedPresentTime = expectedPresentTime;
        command.expectedPresentTime = expectedPresentTime;
        command.validateDisplay = true;
        command.validateDisplay = true;
        command.frameIntervalNs = frameIntervalNs;
    }
    }


    void presentOrvalidateDisplay(int64_t display,
    void presentOrvalidateDisplay(int64_t display,
                                  std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
                                  std::optional<ClockMonotonicTimestamp> expectedPresentTime,
                                  int32_t frameIntervalNs) {
        auto& command = getDisplayCommand(display);
        auto& command = getDisplayCommand(display);
        command.expectedPresentTime = expectedPresentTime;
        command.expectedPresentTime = expectedPresentTime;
        command.presentOrValidateDisplay = true;
        command.presentOrValidateDisplay = true;
        command.frameIntervalNs = frameIntervalNs;
    }
    }


    void acceptDisplayChanges(int64_t display) {
    void acceptDisplayChanges(int64_t display) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -197,6 +197,7 @@ class VtsComposerClient {
    std::vector<RefreshRateChangedDebugData> takeListOfRefreshRateChangedDebugData();
    std::vector<RefreshRateChangedDebugData> takeListOfRefreshRateChangedDebugData();


    static constexpr int32_t kMaxFrameIntervalNs = 50000000;  // 20fps
    static constexpr int32_t kMaxFrameIntervalNs = 50000000;  // 20fps
    static constexpr int32_t kNoFrameIntervalNs = 0;


  private:
  private:
    void addDisplayConfigs(VtsDisplay*, const std::vector<DisplayConfiguration>&);
    void addDisplayConfigs(VtsDisplay*, const std::vector<DisplayConfiguration>&);
+42 −21
Original line number Original line Diff line number Diff line
@@ -220,7 +220,8 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        // if hwc cannot handle and asks for composition change,
        // if hwc cannot handle and asks for composition change,
        // just succeed the test
        // just succeed the test
@@ -279,7 +280,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();


        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
@@ -338,7 +340,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
                                      getDisplayHeight(), mPixelFormat, mDataspace);
                                      getDisplayHeight(), mPixelFormat, mDataspace);
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());


        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();


        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
@@ -465,7 +468,8 @@ TEST_P(GraphicsCompositionTest, ClientComposition) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();


        auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
        auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
@@ -498,7 +502,8 @@ TEST_P(GraphicsCompositionTest, ClientComposition) {
            mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
            mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
                                     clientDataspace, std::vector<common::Rect>(1, damage));
                                     clientDataspace, std::vector<common::Rect>(1, damage));
            layer->setToClientComposition(*mWriter);
            layer->setToClientComposition(*mWriter);
            mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
            mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                     VtsComposerClient::kNoFrameIntervalNs);
            execute();
            execute();
            changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
            changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
            ASSERT_TRUE(changedCompositionTypes.empty());
            ASSERT_TRUE(changedCompositionTypes.empty());
@@ -575,7 +580,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) {
        clientLayer->setDisplayFrame(clientFrame);
        clientLayer->setDisplayFrame(clientFrame);
        clientLayer->setZOrder(0);
        clientLayer->setZOrder(0);
        clientLayer->write(*mWriter);
        clientLayer->write(*mWriter);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();


        auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
        auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
@@ -604,7 +610,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) {
        mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
        mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
                                 clientDataspace, std::vector<common::Rect>(1, clientFrame));
                                 clientDataspace, std::vector<common::Rect>(1, clientFrame));
        clientLayer->setToClientComposition(*mWriter);
        clientLayer->setToClientComposition(*mWriter);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
        changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
        ASSERT_TRUE(changedCompositionTypes.empty());
        ASSERT_TRUE(changedCompositionTypes.empty());
@@ -652,7 +659,8 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -680,7 +688,8 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
        ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
@@ -721,7 +730,8 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -785,7 +795,8 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -843,7 +854,8 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -865,7 +877,8 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
        ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
@@ -930,7 +943,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) {


        writeLayers(layers);
        writeLayers(layers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED()
            GTEST_SUCCEED()
@@ -1065,7 +1079,8 @@ TEST_P(GraphicsBlendModeCompositionTest, None) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -1110,7 +1125,8 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -1150,7 +1166,8 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) {
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
        writeLayers(mLayers);
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -1234,7 +1251,8 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) {


        writeLayers(mLayers);
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -1280,7 +1298,8 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) {


        writeLayers(mLayers);
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -1326,7 +1345,8 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) {


        writeLayers(mLayers);
        writeLayers(mLayers);
        ASSERT_TRUE(mReader.takeErrors().empty());
        ASSERT_TRUE(mReader.takeErrors().empty());
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                 VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED();
            GTEST_SUCCEED();
@@ -1419,7 +1439,8 @@ TEST_P(GraphicsColorManagementCompositionTest, ColorConversion) {
            EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
            EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());


            ASSERT_TRUE(mReader.takeErrors().empty());
            ASSERT_TRUE(mReader.takeErrors().empty());
            mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
            mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                                     VtsComposerClient::kNoFrameIntervalNs);
            execute();
            execute();
            if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
                continue;
                continue;
+22 −11
Original line number Original line Diff line number Diff line
@@ -1479,7 +1479,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
                                  /*acquireFence*/ -1);
                                  /*acquireFence*/ -1);
            writer.setLayerDataspace(display.getDisplayId(), layer, common::Dataspace::UNKNOWN);
            writer.setLayerDataspace(display.getDisplayId(), layer, common::Dataspace::UNKNOWN);


            writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
            writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
                                   VtsComposerClient::kNoFrameIntervalNs);
            execute();
            execute();
            ASSERT_TRUE(mReader.takeErrors().empty());
            ASSERT_TRUE(mReader.takeErrors().empty());


@@ -1496,7 +1497,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
                                  /*acquireFence*/ -1);
                                  /*acquireFence*/ -1);
            writer.setLayerSurfaceDamage(display.getDisplayId(), layer,
            writer.setLayerSurfaceDamage(display.getDisplayId(), layer,
                                         std::vector<Rect>(1, {0, 0, 10, 10}));
                                         std::vector<Rect>(1, {0, 0, 10, 10}));
            writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
            writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
                                   VtsComposerClient::kNoFrameIntervalNs);
            execute();
            execute();
            ASSERT_TRUE(mReader.takeErrors().empty());
            ASSERT_TRUE(mReader.takeErrors().empty());


@@ -1510,7 +1512,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
    sp<::android::Fence> presentAndGetFence(
    sp<::android::Fence> presentAndGetFence(
            std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
            std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
        auto& writer = getWriter(getPrimaryDisplayId());
        auto& writer = getWriter(getPrimaryDisplayId());
        writer.validateDisplay(getPrimaryDisplayId(), expectedPresentTime);
        writer.validateDisplay(getPrimaryDisplayId(), expectedPresentTime,
                               VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        EXPECT_TRUE(mReader.takeErrors().empty());
        EXPECT_TRUE(mReader.takeErrors().empty());


@@ -1852,20 +1855,23 @@ TEST_P(GraphicsComposerAidlCommandTest, SetOutputBuffer) {


TEST_P(GraphicsComposerAidlCommandTest, ValidDisplay) {
TEST_P(GraphicsComposerAidlCommandTest, ValidDisplay) {
    auto& writer = getWriter(getPrimaryDisplayId());
    auto& writer = getWriter(getPrimaryDisplayId());
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                           VtsComposerClient::kNoFrameIntervalNs);
    execute();
    execute();
}
}


TEST_P(GraphicsComposerAidlCommandTest, AcceptDisplayChanges) {
TEST_P(GraphicsComposerAidlCommandTest, AcceptDisplayChanges) {
    auto& writer = getWriter(getPrimaryDisplayId());
    auto& writer = getWriter(getPrimaryDisplayId());
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                           VtsComposerClient::kNoFrameIntervalNs);
    writer.acceptDisplayChanges(getPrimaryDisplayId());
    writer.acceptDisplayChanges(getPrimaryDisplayId());
    execute();
    execute();
}
}


TEST_P(GraphicsComposerAidlCommandTest, PresentDisplay) {
TEST_P(GraphicsComposerAidlCommandTest, PresentDisplay) {
    auto& writer = getWriter(getPrimaryDisplayId());
    auto& writer = getWriter(getPrimaryDisplayId());
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                           VtsComposerClient::kNoFrameIntervalNs);
    writer.presentDisplay(getPrimaryDisplayId());
    writer.presentDisplay(getPrimaryDisplayId());
    execute();
    execute();
}
}
@@ -1904,7 +1910,8 @@ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) {
        writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle,
        writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle,
                              /*acquireFence*/ -1);
                              /*acquireFence*/ -1);
        writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
        writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
        writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
        writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                               VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
        if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
            GTEST_SUCCEED() << "Composition change requested, skipping test";
            GTEST_SUCCEED() << "Composition change requested, skipping test";
@@ -1946,7 +1953,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) {
                   (float)getPrimaryDisplay().getDisplayHeight()};
                   (float)getPrimaryDisplay().getDisplayHeight()};
    configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect);
    configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect);
    writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
    writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                           VtsComposerClient::kNoFrameIntervalNs);


    execute();
    execute();


@@ -1961,7 +1969,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) {
    execute();
    execute();


    writer.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 0, /*y*/ 0);
    writer.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 0, /*y*/ 0);
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
    writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
                           VtsComposerClient::kNoFrameIntervalNs);
    writer.presentDisplay(getPrimaryDisplayId());
    writer.presentDisplay(getPrimaryDisplayId());
    execute();
    execute();
}
}
@@ -2160,7 +2169,8 @@ TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) {
        auto& writer = getWriter(display.getDisplayId());
        auto& writer = getWriter(display.getDisplayId());
        writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle,
        writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle,
                              /*acquireFence*/ -1);
                              /*acquireFence*/ -1);
        writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
        writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
                               VtsComposerClient::kNoFrameIntervalNs);
        execute();
        execute();
        if (support) {
        if (support) {
            ASSERT_TRUE(mReader.takeErrors().empty());
            ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2864,7 +2874,8 @@ TEST_P(GraphicsComposerAidlCommandTest, MultiThreadedPresent) {
        auto& reader = readers.at(displayId);
        auto& reader = readers.at(displayId);
        lock.unlock();
        lock.unlock();


        writer.validateDisplay(displayId, ComposerClientWriter::kNoTimestamp);
        writer.validateDisplay(displayId, ComposerClientWriter::kNoTimestamp,
                               VtsComposerClient::kNoFrameIntervalNs);
        execute(writer, reader);
        execute(writer, reader);


        threads.emplace_back([this, displayId, &readers, &readersMutex]() {
        threads.emplace_back([this, displayId, &readers, &readersMutex]() {