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

Commit 4238fc91 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "SF: replace dont_skip_on_early flag" into main

parents a51f1d63 bf55489e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ ScheduleResult VSyncDispatchTimerQueueEntry::schedule(VSyncDispatch::ScheduleTim
            mArmedInfo && (nextVsyncTime > (mArmedInfo->mActualVsyncTime + mMinVsyncDistance));
    bool const wouldSkipAWakeup =
            mArmedInfo && ((nextWakeupTime > (mArmedInfo->mActualWakeupTime + mMinVsyncDistance)));
    if (FlagManager::getInstance().dont_skip_on_early()) {
    if (FlagManager::getInstance().dont_skip_on_early_ro()) {
        if (wouldSkipAVsyncTarget || wouldSkipAWakeup) {
            nextVsyncTime = mArmedInfo->mActualVsyncTime;
        } else {
+2 −8
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ void FlagManager::dump(std::string& result) const {
    DUMP_SERVER_FLAG(use_skia_tracing);

    /// Trunk stable server flags ///
    DUMP_SERVER_FLAG(dont_skip_on_early);
    DUMP_SERVER_FLAG(refresh_rate_overlay_on_external_display);

    /// Trunk stable readonly flags ///
@@ -131,6 +130,7 @@ void FlagManager::dump(std::string& result) const {
    DUMP_READ_ONLY_FLAG(vulkan_renderengine);
    DUMP_READ_ONLY_FLAG(renderable_buffer_usage);
    DUMP_READ_ONLY_FLAG(restore_blur_step);
    DUMP_READ_ONLY_FLAG(dont_skip_on_early_ro);
#undef DUMP_READ_ONLY_FLAG
#undef DUMP_SERVER_FLAG
#undef DUMP_FLAG_INTERVAL
@@ -209,15 +209,9 @@ FLAG_MANAGER_READ_ONLY_FLAG(screenshot_fence_preservation, "debug.sf.screenshot_
FLAG_MANAGER_READ_ONLY_FLAG(vulkan_renderengine, "debug.renderengine.vulkan")
FLAG_MANAGER_READ_ONLY_FLAG(renderable_buffer_usage, "")
FLAG_MANAGER_READ_ONLY_FLAG(restore_blur_step, "debug.renderengine.restore_blur_step")
FLAG_MANAGER_READ_ONLY_FLAG(dont_skip_on_early_ro, "")

/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")

/// Exceptions ///
bool FlagManager::dont_skip_on_early() const {
    // Even though this is a server writable flag, we do call it before boot completed, but that's
    // fine since the decision is done per frame. We can't do caching though.
    return flags::dont_skip_on_early();
}

} // namespace android
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ public:
    bool use_skia_tracing() const;

    /// Trunk stable server flags ///
    bool dont_skip_on_early() const;
    bool refresh_rate_overlay_on_external_display() const;

    /// Trunk stable readonly flags ///
@@ -71,6 +70,7 @@ public:
    bool vulkan_renderengine() const;
    bool renderable_buffer_usage() const;
    bool restore_blur_step() const;
    bool dont_skip_on_early_ro() const;

protected:
    // overridden for unit tests
+11 −7
Original line number Diff line number Diff line
@@ -33,13 +33,6 @@ flag {
  is_fixed_read_only: true
}

flag {
  name: "dont_skip_on_early"
  namespace: "core_graphics"
  description: "This flag is guarding the behaviour where SurfaceFlinger is trying to opportunistically present a frame when the configuration change from late to early"
  bug: "273702768"
}

flag {
  name: "multithreaded_present"
  namespace: "core_graphics"
@@ -190,3 +183,14 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "dont_skip_on_early_ro"
  namespace: "core_graphics"
  description: "This flag is guarding the behaviour where SurfaceFlinger is trying to opportunistically present a frame when the configuration change from late to early"
  bug: "273702768"
  is_fixed_read_only: true
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+0 −14
Original line number Diff line number Diff line
@@ -169,18 +169,4 @@ TEST_F(FlagManagerTest, readonlyReturnsValue) {
    }
}

TEST_F(FlagManagerTest, dontSkipOnEarlyIsNotCached) {
    EXPECT_CALL(mFlagManager, getBoolProperty).WillRepeatedly(Return(std::nullopt));

    const auto initialValue = flags::dont_skip_on_early();

    flags::dont_skip_on_early(true);
    EXPECT_EQ(true, mFlagManager.dont_skip_on_early());

    flags::dont_skip_on_early(false);
    EXPECT_EQ(false, mFlagManager.dont_skip_on_early());

    flags::dont_skip_on_early(initialValue);
}

} // namespace android
Loading