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

Commit 33371b12 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reapply Avoid sending powerhint right after GPU composition."

parents 53d23fb8 a76ce46c
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -788,6 +788,7 @@ std::optional<base::unique_fd> Output::composeSurfaces(const Region& debugRegion
                                                      outputState.usesClientComposition};
    base::unique_fd readyFence;
    if (!hasClientComposition) {
        setExpensiveRenderingExpected(false);
        return readyFence;
    }

@@ -871,10 +872,6 @@ std::optional<base::unique_fd> Output::composeSurfaces(const Region& debugRegion
                                                     new Fence(dup(readyFence.get()))));
    }

    if (expensiveRenderingExpected) {
        setExpensiveRenderingExpected(false);
    }

    return readyFence;
}

+3 −0
Original line number Diff line number Diff line
@@ -700,6 +700,9 @@ TEST_F(DisplayTest, finishFrameDoesNotSkipCompositionIfNotDirtyOnHwcDisplay) {
    // We expect no calls to queueBuffer if composition was skipped.
    EXPECT_CALL(*renderSurface, queueBuffer(_)).Times(1);

    // Expect a call to signal no expensive rendering since there is no client composition.
    EXPECT_CALL(mPowerAdvisor, setExpensiveRenderingExpected(DEFAULT_DISPLAY_ID, false));

    mDisplay->editState().isEnabled = true;
    mDisplay->editState().usesClientComposition = false;
    mDisplay->editState().viewport = Rect(0, 0, 1, 1);
+3 −2
Original line number Diff line number Diff line
@@ -2842,9 +2842,11 @@ const HdrCapabilities OutputComposeSurfacesTest::
                         OutputComposeSurfacesTest::kDefaultAvgLuminance,
                         OutputComposeSurfacesTest::kDefaultMinLuminance};

TEST_F(OutputComposeSurfacesTest, doesNothingIfNoClientComposition) {
TEST_F(OutputComposeSurfacesTest, doesNothingButSignalNoExpensiveRenderingIfNoClientComposition) {
    mOutput.mState.usesClientComposition = false;

    EXPECT_CALL(mOutput, setExpensiveRenderingExpected(false));

    verify().execute().expectAFenceWasReturned();
}

@@ -3163,7 +3165,6 @@ TEST_F(OutputComposeSurfacesTest_SetsExpensiveRendering, IfExepensiveOutputDatas

    EXPECT_CALL(mOutput, setExpensiveRenderingExpected(true));
    EXPECT_CALL(mRenderEngine, drawLayers(_, _, _, true, _, _)).WillOnce(Return(NO_ERROR));
    EXPECT_CALL(mOutput, setExpensiveRenderingExpected(false));

    mOutput.composeSurfaces(kDebugRegion);
}