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

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

Merge changes from topic "fipresentOrValidate" into main

* changes:
  [SF] Add frameIntervalNs for validate command
  [SF] Add frameIntervalNs for presentOrValidate command
parents 73985c5c 09acbb8c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -96,6 +96,9 @@ struct CompositionRefreshArgs {
    // The expected time for the next present
    nsecs_t expectedPresentTime{0};

    // The frameInterval for the next present
    Fps frameInterval{};

    // If set, a frame has been scheduled for that time.
    std::optional<std::chrono::steady_clock::time_point> scheduledFrameTime;

+3 −0
Original line number Diff line number Diff line
@@ -127,6 +127,9 @@ struct OutputCompositionState {
    // The expected time for the next present
    nsecs_t expectedPresentTime{0};

    // The frameInterval for the next present
    Fps frameInterval{};

    // Current display brightness
    float displayBrightnessNits{-1.f};

+4 −4
Original line number Diff line number Diff line
@@ -255,10 +255,10 @@ bool Display::chooseCompositionStrategy(

    const TimePoint hwcValidateStartTime = TimePoint::now();

    if (status_t result =
                hwc.getDeviceCompositionChanges(*halDisplayId, requiresClientComposition,
    if (status_t result = hwc.getDeviceCompositionChanges(*halDisplayId, requiresClientComposition,
                                                          getState().earliestPresentTime,
                                                getState().expectedPresentTime, outChanges);
                                                          getState().expectedPresentTime,
                                                          getState().frameInterval, outChanges);
        result != NO_ERROR) {
        ALOGE("chooseCompositionStrategy failed for %s: %d (%s)", getName().c_str(), result,
              strerror(-result));
+1 −0
Original line number Diff line number Diff line
@@ -836,6 +836,7 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr

    editState().earliestPresentTime = refreshArgs.earliestPresentTime;
    editState().expectedPresentTime = refreshArgs.expectedPresentTime;
    editState().frameInterval = refreshArgs.frameInterval;
    editState().powerCallback = refreshArgs.powerCallback;

    compositionengine::OutputLayer* peekThroughLayer = nullptr;
+5 −5
Original line number Diff line number Diff line
@@ -582,7 +582,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());
@@ -606,8 +606,8 @@ TEST_F(DisplayChooseCompositionStrategyTest, normalOperation) {
            .WillOnce(Return(false));

    EXPECT_CALL(mHwComposer,
                getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _))
            .WillOnce(testing::DoAll(testing::SetArgPointee<4>(mDeviceRequestedChanges),
                getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _, _))
            .WillOnce(testing::DoAll(testing::SetArgPointee<5>(mDeviceRequestedChanges),
                                     Return(NO_ERROR)));
    EXPECT_CALL(*mDisplay, applyChangedTypesToLayers(mDeviceRequestedChanges.changedTypes))
            .Times(1);
@@ -659,8 +659,8 @@ TEST_F(DisplayChooseCompositionStrategyTest, normalOperationWithChanges) {
            .WillOnce(Return(false));

    EXPECT_CALL(mHwComposer,
                getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _))
            .WillOnce(DoAll(SetArgPointee<4>(mDeviceRequestedChanges), Return(NO_ERROR)));
                getDeviceCompositionChanges(HalDisplayId(DEFAULT_DISPLAY_ID), true, _, _, _, _))
            .WillOnce(DoAll(SetArgPointee<5>(mDeviceRequestedChanges), Return(NO_ERROR)));
    EXPECT_CALL(*mDisplay, applyChangedTypesToLayers(mDeviceRequestedChanges.changedTypes))
            .Times(1);
    EXPECT_CALL(*mDisplay, applyDisplayRequests(mDeviceRequestedChanges.displayRequests)).Times(1);
Loading