Loading services/surfaceflinger/CompositionEngine/include/compositionengine/CompositionRefreshArgs.h +3 −6 Original line number Diff line number Diff line Loading @@ -83,12 +83,9 @@ struct CompositionRefreshArgs { // If set, causes the dirty regions to flash with the delay std::optional<std::chrono::microseconds> devOptFlashDirtyRegionsDelay; // The earliest time to send the present command to the HAL std::chrono::steady_clock::time_point earliestPresentTime; // The previous present fence. Used together with earliestPresentTime // to prevent an early presentation of a frame. std::shared_ptr<FenceTime> previousPresentFence; // Optional. // The earliest time to send the present command to the HAL. std::optional<std::chrono::steady_clock::time_point> earliestPresentTime; // The expected time for the next present nsecs_t expectedPresentTime{0}; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputCompositionState.h +2 −5 Original line number Diff line number Diff line Loading @@ -122,12 +122,9 @@ struct OutputCompositionState { bool previousDeviceRequestedSuccess = false; // Optional. // The earliest time to send the present command to the HAL std::chrono::steady_clock::time_point earliestPresentTime; // The previous present fence. Used together with earliestPresentTime // to prevent an early presentation of a frame. std::shared_ptr<FenceTime> previousPresentFence; std::optional<std::chrono::steady_clock::time_point> earliestPresentTime; // The expected time for the next present nsecs_t expectedPresentTime{0}; Loading services/surfaceflinger/CompositionEngine/src/Display.cpp +3 −9 Original line number Diff line number Diff line Loading @@ -263,7 +263,6 @@ bool Display::chooseCompositionStrategy( if (status_t result = hwc.getDeviceCompositionChanges(*halDisplayId, requiresClientComposition, getState().earliestPresentTime, getState().previousPresentFence, getState().expectedPresentTime, outChanges); result != NO_ERROR) { ALOGE("chooseCompositionStrategy failed for %s: %d (%s)", getName().c_str(), result, Loading Loading @@ -380,16 +379,11 @@ compositionengine::Output::FrameFences Display::presentAndGetFrameFences() { const TimePoint startTime = TimePoint::now(); if (isPowerHintSessionEnabled()) { if (!getCompositionEngine().getHwComposer().getComposer()->isSupported( Hwc2::Composer::OptionalFeature::ExpectedPresentTime) && getState().previousPresentFence->getSignalTime() != Fence::SIGNAL_TIME_PENDING) { mPowerAdvisor->setHwcPresentDelayedTime(mId, getState().earliestPresentTime); } if (isPowerHintSessionEnabled() && getState().earliestPresentTime) { mPowerAdvisor->setHwcPresentDelayedTime(mId, *getState().earliestPresentTime); } hwc.presentAndGetReleaseFences(*halDisplayIdOpt, getState().earliestPresentTime, getState().previousPresentFence); hwc.presentAndGetReleaseFences(*halDisplayIdOpt, getState().earliestPresentTime); if (isPowerHintSessionEnabled()) { mPowerAdvisor->setHwcPresentTiming(mId, startTime, TimePoint::now()); Loading services/surfaceflinger/CompositionEngine/src/Output.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -842,7 +842,6 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr } editState().earliestPresentTime = refreshArgs.earliestPresentTime; editState().previousPresentFence = refreshArgs.previousPresentFence; editState().expectedPresentTime = refreshArgs.expectedPresentTime; compositionengine::OutputLayer* peekThroughLayer = nullptr; Loading services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -595,7 +595,7 @@ TEST_F(DisplayChooseCompositionStrategyTest, takesEarlyOutIfGpuDisplay) { TEST_F(DisplayChooseCompositionStrategyTest, takesEarlyOutOnHwcError) { EXPECT_CALL(*mDisplay, anyLayersRequireClientComposition()).WillOnce(Return(false)); EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), false, _, _, _, _)) getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), false, _, _, _)) .WillOnce(Return(INVALID_OPERATION)); chooseCompositionStrategy(mDisplay.get()); Loading @@ -619,8 +619,8 @@ TEST_F(DisplayChooseCompositionStrategyTest, normalOperation) { .WillOnce(Return(false)); EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _, _)) .WillOnce(testing::DoAll(testing::SetArgPointee<5>(mDeviceRequestedChanges), getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _)) .WillOnce(testing::DoAll(testing::SetArgPointee<4>(mDeviceRequestedChanges), Return(NO_ERROR))); EXPECT_CALL(*mDisplay, applyChangedTypesToLayers(mDeviceRequestedChanges.changedTypes)) .Times(1); Loading Loading @@ -672,8 +672,8 @@ TEST_F(DisplayChooseCompositionStrategyTest, normalOperationWithChanges) { .WillOnce(Return(false)); EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _, _)) .WillOnce(DoAll(SetArgPointee<5>(mDeviceRequestedChanges), Return(NO_ERROR))); getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _)) .WillOnce(DoAll(SetArgPointee<4>(mDeviceRequestedChanges), Return(NO_ERROR))); EXPECT_CALL(*mDisplay, applyChangedTypesToLayers(mDeviceRequestedChanges.changedTypes)) .Times(1); EXPECT_CALL(*mDisplay, applyDisplayRequests(mDeviceRequestedChanges.displayRequests)).Times(1); Loading Loading @@ -901,7 +901,7 @@ TEST_F(DisplayPresentAndGetFrameFencesTest, returnsPresentAndLayerFences) { sp<Fence> layer1Fence = sp<Fence>::make(); sp<Fence> layer2Fence = sp<Fence>::make(); EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(HalDisplayId(DEFAULT_DISPLAY_ID), _, _)) EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(HalDisplayId(DEFAULT_DISPLAY_ID), _)) .Times(1); EXPECT_CALL(mHwComposer, getPresentFence(HalDisplayId(DEFAULT_DISPLAY_ID))) .WillOnce(Return(presentFence)); Loading Loading @@ -1078,7 +1078,7 @@ TEST_F(DisplayFunctionalTest, postFramebufferCriticalCallsAreOrdered) { mDisplay->editState().isEnabled = true; EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(_, _, _)); EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(_, _)); EXPECT_CALL(*mDisplaySurface, onFrameCommitted()); mDisplay->postFramebuffer(); Loading Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/CompositionRefreshArgs.h +3 −6 Original line number Diff line number Diff line Loading @@ -83,12 +83,9 @@ struct CompositionRefreshArgs { // If set, causes the dirty regions to flash with the delay std::optional<std::chrono::microseconds> devOptFlashDirtyRegionsDelay; // The earliest time to send the present command to the HAL std::chrono::steady_clock::time_point earliestPresentTime; // The previous present fence. Used together with earliestPresentTime // to prevent an early presentation of a frame. std::shared_ptr<FenceTime> previousPresentFence; // Optional. // The earliest time to send the present command to the HAL. std::optional<std::chrono::steady_clock::time_point> earliestPresentTime; // The expected time for the next present nsecs_t expectedPresentTime{0}; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputCompositionState.h +2 −5 Original line number Diff line number Diff line Loading @@ -122,12 +122,9 @@ struct OutputCompositionState { bool previousDeviceRequestedSuccess = false; // Optional. // The earliest time to send the present command to the HAL std::chrono::steady_clock::time_point earliestPresentTime; // The previous present fence. Used together with earliestPresentTime // to prevent an early presentation of a frame. std::shared_ptr<FenceTime> previousPresentFence; std::optional<std::chrono::steady_clock::time_point> earliestPresentTime; // The expected time for the next present nsecs_t expectedPresentTime{0}; Loading
services/surfaceflinger/CompositionEngine/src/Display.cpp +3 −9 Original line number Diff line number Diff line Loading @@ -263,7 +263,6 @@ bool Display::chooseCompositionStrategy( if (status_t result = hwc.getDeviceCompositionChanges(*halDisplayId, requiresClientComposition, getState().earliestPresentTime, getState().previousPresentFence, getState().expectedPresentTime, outChanges); result != NO_ERROR) { ALOGE("chooseCompositionStrategy failed for %s: %d (%s)", getName().c_str(), result, Loading Loading @@ -380,16 +379,11 @@ compositionengine::Output::FrameFences Display::presentAndGetFrameFences() { const TimePoint startTime = TimePoint::now(); if (isPowerHintSessionEnabled()) { if (!getCompositionEngine().getHwComposer().getComposer()->isSupported( Hwc2::Composer::OptionalFeature::ExpectedPresentTime) && getState().previousPresentFence->getSignalTime() != Fence::SIGNAL_TIME_PENDING) { mPowerAdvisor->setHwcPresentDelayedTime(mId, getState().earliestPresentTime); } if (isPowerHintSessionEnabled() && getState().earliestPresentTime) { mPowerAdvisor->setHwcPresentDelayedTime(mId, *getState().earliestPresentTime); } hwc.presentAndGetReleaseFences(*halDisplayIdOpt, getState().earliestPresentTime, getState().previousPresentFence); hwc.presentAndGetReleaseFences(*halDisplayIdOpt, getState().earliestPresentTime); if (isPowerHintSessionEnabled()) { mPowerAdvisor->setHwcPresentTiming(mId, startTime, TimePoint::now()); Loading
services/surfaceflinger/CompositionEngine/src/Output.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -842,7 +842,6 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr } editState().earliestPresentTime = refreshArgs.earliestPresentTime; editState().previousPresentFence = refreshArgs.previousPresentFence; editState().expectedPresentTime = refreshArgs.expectedPresentTime; compositionengine::OutputLayer* peekThroughLayer = nullptr; Loading
services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -595,7 +595,7 @@ TEST_F(DisplayChooseCompositionStrategyTest, takesEarlyOutIfGpuDisplay) { TEST_F(DisplayChooseCompositionStrategyTest, takesEarlyOutOnHwcError) { EXPECT_CALL(*mDisplay, anyLayersRequireClientComposition()).WillOnce(Return(false)); EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), false, _, _, _, _)) getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), false, _, _, _)) .WillOnce(Return(INVALID_OPERATION)); chooseCompositionStrategy(mDisplay.get()); Loading @@ -619,8 +619,8 @@ TEST_F(DisplayChooseCompositionStrategyTest, normalOperation) { .WillOnce(Return(false)); EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _, _)) .WillOnce(testing::DoAll(testing::SetArgPointee<5>(mDeviceRequestedChanges), getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _)) .WillOnce(testing::DoAll(testing::SetArgPointee<4>(mDeviceRequestedChanges), Return(NO_ERROR))); EXPECT_CALL(*mDisplay, applyChangedTypesToLayers(mDeviceRequestedChanges.changedTypes)) .Times(1); Loading Loading @@ -672,8 +672,8 @@ TEST_F(DisplayChooseCompositionStrategyTest, normalOperationWithChanges) { .WillOnce(Return(false)); EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _, _)) .WillOnce(DoAll(SetArgPointee<5>(mDeviceRequestedChanges), Return(NO_ERROR))); getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _)) .WillOnce(DoAll(SetArgPointee<4>(mDeviceRequestedChanges), Return(NO_ERROR))); EXPECT_CALL(*mDisplay, applyChangedTypesToLayers(mDeviceRequestedChanges.changedTypes)) .Times(1); EXPECT_CALL(*mDisplay, applyDisplayRequests(mDeviceRequestedChanges.displayRequests)).Times(1); Loading Loading @@ -901,7 +901,7 @@ TEST_F(DisplayPresentAndGetFrameFencesTest, returnsPresentAndLayerFences) { sp<Fence> layer1Fence = sp<Fence>::make(); sp<Fence> layer2Fence = sp<Fence>::make(); EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(HalDisplayId(DEFAULT_DISPLAY_ID), _, _)) EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(HalDisplayId(DEFAULT_DISPLAY_ID), _)) .Times(1); EXPECT_CALL(mHwComposer, getPresentFence(HalDisplayId(DEFAULT_DISPLAY_ID))) .WillOnce(Return(presentFence)); Loading Loading @@ -1078,7 +1078,7 @@ TEST_F(DisplayFunctionalTest, postFramebufferCriticalCallsAreOrdered) { mDisplay->editState().isEnabled = true; EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(_, _, _)); EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(_, _)); EXPECT_CALL(*mDisplaySurface, onFrameCommitted()); mDisplay->postFramebuffer(); Loading