Skip to content

Commit bf55489

Browse files
committed
SF: replace dont_skip_on_early flag
.. with a new flag due to a Gantry bug: b/323967908 Bug: 273702768 Change-Id: I126bc6c4927c6ae8d1cd54316babe1590d3dde28 Test: presubmit
1 parent eb3ad20 commit bf55489

6 files changed

Lines changed: 23 additions & 39 deletions

File tree

services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ ScheduleResult VSyncDispatchTimerQueueEntry::schedule(VSyncDispatch::ScheduleTim
107107
mArmedInfo && (nextVsyncTime > (mArmedInfo->mActualVsyncTime + mMinVsyncDistance));
108108
bool const wouldSkipAWakeup =
109109
mArmedInfo && ((nextWakeupTime > (mArmedInfo->mActualWakeupTime + mMinVsyncDistance)));
110-
if (FlagManager::getInstance().dont_skip_on_early()) {
110+
if (FlagManager::getInstance().dont_skip_on_early_ro()) {
111111
if (wouldSkipAVsyncTarget || wouldSkipAWakeup) {
112112
nextVsyncTime = mArmedInfo->mActualVsyncTime;
113113
} else {

services/surfaceflinger/common/FlagManager.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ void FlagManager::dump(std::string& result) const {
108108
DUMP_SERVER_FLAG(use_skia_tracing);
109109

110110
/// Trunk stable server flags ///
111-
DUMP_SERVER_FLAG(dont_skip_on_early);
112111
DUMP_SERVER_FLAG(refresh_rate_overlay_on_external_display);
113112

114113
/// Trunk stable readonly flags ///
@@ -131,6 +130,7 @@ void FlagManager::dump(std::string& result) const {
131130
DUMP_READ_ONLY_FLAG(vulkan_renderengine);
132131
DUMP_READ_ONLY_FLAG(renderable_buffer_usage);
133132
DUMP_READ_ONLY_FLAG(restore_blur_step);
133+
DUMP_READ_ONLY_FLAG(dont_skip_on_early_ro);
134134
#undef DUMP_READ_ONLY_FLAG
135135
#undef DUMP_SERVER_FLAG
136136
#undef DUMP_FLAG_INTERVAL
@@ -209,15 +209,9 @@ FLAG_MANAGER_READ_ONLY_FLAG(screenshot_fence_preservation, "debug.sf.screenshot_
209209
FLAG_MANAGER_READ_ONLY_FLAG(vulkan_renderengine, "debug.renderengine.vulkan")
210210
FLAG_MANAGER_READ_ONLY_FLAG(renderable_buffer_usage, "")
211211
FLAG_MANAGER_READ_ONLY_FLAG(restore_blur_step, "debug.renderengine.restore_blur_step")
212+
FLAG_MANAGER_READ_ONLY_FLAG(dont_skip_on_early_ro, "")
212213

213214
/// Trunk stable server flags ///
214215
FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")
215216

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

services/surfaceflinger/common/include/common/FlagManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class FlagManager {
4848
bool use_skia_tracing() const;
4949

5050
/// Trunk stable server flags ///
51-
bool dont_skip_on_early() const;
5251
bool refresh_rate_overlay_on_external_display() const;
5352

5453
/// Trunk stable readonly flags ///
@@ -71,6 +70,7 @@ class FlagManager {
7170
bool vulkan_renderengine() const;
7271
bool renderable_buffer_usage() const;
7372
bool restore_blur_step() const;
73+
bool dont_skip_on_early_ro() const;
7474

7575
protected:
7676
// overridden for unit tests

services/surfaceflinger/surfaceflinger_flags.aconfig

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ flag {
3333
is_fixed_read_only: true
3434
}
3535

36-
flag {
37-
name: "dont_skip_on_early"
38-
namespace: "core_graphics"
39-
description: "This flag is guarding the behaviour where SurfaceFlinger is trying to opportunistically present a frame when the configuration change from late to early"
40-
bug: "273702768"
41-
}
42-
4336
flag {
4437
name: "multithreaded_present"
4538
namespace: "core_graphics"
@@ -190,3 +183,14 @@ flag {
190183
purpose: PURPOSE_BUGFIX
191184
}
192185
}
186+
187+
flag {
188+
name: "dont_skip_on_early_ro"
189+
namespace: "core_graphics"
190+
description: "This flag is guarding the behaviour where SurfaceFlinger is trying to opportunistically present a frame when the configuration change from late to early"
191+
bug: "273702768"
192+
is_fixed_read_only: true
193+
metadata {
194+
purpose: PURPOSE_BUGFIX
195+
}
196+
}

services/surfaceflinger/tests/unittests/FlagManagerTest.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,4 @@ TEST_F(FlagManagerTest, readonlyReturnsValue) {
169169
}
170170
}
171171

172-
TEST_F(FlagManagerTest, dontSkipOnEarlyIsNotCached) {
173-
EXPECT_CALL(mFlagManager, getBoolProperty).WillRepeatedly(Return(std::nullopt));
174-
175-
const auto initialValue = flags::dont_skip_on_early();
176-
177-
flags::dont_skip_on_early(true);
178-
EXPECT_EQ(true, mFlagManager.dont_skip_on_early());
179-
180-
flags::dont_skip_on_early(false);
181-
EXPECT_EQ(false, mFlagManager.dont_skip_on_early());
182-
183-
flags::dont_skip_on_early(initialValue);
184-
}
185-
186172
} // namespace android

services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ TEST_F(VSyncDispatchTimerQueueTest, canMoveCallbackBackwardsInTime) {
734734

735735
// b/1450138150
736736
TEST_F(VSyncDispatchTimerQueueTest, doesNotMoveCallbackBackwardsAndSkipAScheduledTargetVSync) {
737-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, false);
737+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, false);
738738

739739
EXPECT_CALL(mMockClock, alarmAt(_, 500));
740740
CountingCallback cb(mDispatch);
@@ -754,7 +754,7 @@ TEST_F(VSyncDispatchTimerQueueTest, doesNotMoveCallbackBackwardsAndSkipASchedule
754754

755755
// b/1450138150
756756
TEST_F(VSyncDispatchTimerQueueTest, movesCallbackBackwardsAndSkipAScheduledTargetVSync) {
757-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, true);
757+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, true);
758758

759759
Sequence seq;
760760
EXPECT_CALL(mMockClock, alarmAt(_, 500)).InSequence(seq);
@@ -821,7 +821,7 @@ TEST_F(VSyncDispatchTimerQueueTest, canScheduleLargeNegativeOffset) {
821821
}
822822

823823
TEST_F(VSyncDispatchTimerQueueTest, scheduleUpdatesDoesNotAffectSchedulingState) {
824-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, false);
824+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, false);
825825

826826
EXPECT_CALL(mMockClock, alarmAt(_, 600));
827827

@@ -839,7 +839,7 @@ TEST_F(VSyncDispatchTimerQueueTest, scheduleUpdatesDoesNotAffectSchedulingState)
839839
}
840840

841841
TEST_F(VSyncDispatchTimerQueueTest, scheduleUpdatesDoesAffectSchedulingState) {
842-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, true);
842+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, true);
843843

844844
Sequence seq;
845845
EXPECT_CALL(mMockClock, alarmAt(_, 600)).InSequence(seq);
@@ -1051,7 +1051,7 @@ TEST_F(VSyncDispatchTimerQueueTest, basicAlarmSettingFutureWithReadyDuration) {
10511051
}
10521052

10531053
TEST_F(VSyncDispatchTimerQueueTest, updatesVsyncTimeForCloseWakeupTime) {
1054-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, false);
1054+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, false);
10551055

10561056
Sequence seq;
10571057
EXPECT_CALL(mMockClock, alarmAt(_, 600)).InSequence(seq);
@@ -1074,7 +1074,7 @@ TEST_F(VSyncDispatchTimerQueueTest, updatesVsyncTimeForCloseWakeupTime) {
10741074
}
10751075

10761076
TEST_F(VSyncDispatchTimerQueueTest, doesNotUpdatesVsyncTimeForCloseWakeupTime) {
1077-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, true);
1077+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, true);
10781078

10791079
Sequence seq;
10801080
EXPECT_CALL(mMockClock, alarmAt(_, 600)).InSequence(seq);
@@ -1098,7 +1098,7 @@ TEST_F(VSyncDispatchTimerQueueTest, doesNotUpdatesVsyncTimeForCloseWakeupTime) {
10981098
}
10991099

11001100
TEST_F(VSyncDispatchTimerQueueTest, skipAVsyc) {
1101-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, false);
1101+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, false);
11021102

11031103
EXPECT_CALL(mMockClock, alarmAt(_, 500));
11041104
CountingCallback cb(mDispatch);
@@ -1117,7 +1117,7 @@ TEST_F(VSyncDispatchTimerQueueTest, skipAVsyc) {
11171117
}
11181118

11191119
TEST_F(VSyncDispatchTimerQueueTest, dontskipAVsyc) {
1120-
SET_FLAG_FOR_TEST(flags::dont_skip_on_early, true);
1120+
SET_FLAG_FOR_TEST(flags::dont_skip_on_early_ro, true);
11211121

11221122
Sequence seq;
11231123
EXPECT_CALL(mMockClock, alarmAt(_, 500)).InSequence(seq);

0 commit comments

Comments
 (0)