[SF] Update DisplayMode::Fps with PeakFps
Update to incorporate display refresh rate on
DisplayMode
With the addition of VRR, vsync period
does not necessarily represent the
refresh rate of the display, having a
peakRefreshRate that represents the
display peak refresh rate helps with
separating the concern of vsync period
being different from the peak refresh rate
supported by the device.
Test: atest libsurfaceflinger_unittest
BUG: 286048920
BUG: 284845445
Change-Id: I9d90e4def4cf3efcd5a696a4ec43fbf7698abfe4
diff --git a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp
index 91c6239..9b46009 100644
--- a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp
+++ b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp
@@ -703,7 +703,7 @@
.setId(DisplayModeId(7))
.setVsyncPeriod(16666666)
.build();
- const Fps fps = mode->getFps() / 2;
+ const Fps fps = mode->getPeakFps() / 2;
mThread->onModeChanged({fps, ftl::as_non_null(mode)});
expectConfigChangedEventReceivedByConnection(INTERNAL_DISPLAY_ID, 7, fps.getPeriodNsecs());
@@ -717,7 +717,7 @@
.setId(DisplayModeId(5))
.setVsyncPeriod(16666666)
.build();
- const Fps fps = mode->getFps() / 2;
+ const Fps fps = mode->getPeakFps() / 2;
mThread->onModeChanged({fps, ftl::as_non_null(mode)});
expectConfigChangedEventReceivedByConnection(EXTERNAL_DISPLAY_ID, 5, fps.getPeriodNsecs());
@@ -731,7 +731,7 @@
.setId(DisplayModeId(7))
.setVsyncPeriod(16666666)
.build();
- const Fps fps = mode->getFps() / 2;
+ const Fps fps = mode->getPeakFps() / 2;
mThread->onModeChanged({fps, ftl::as_non_null(mode)});
expectConfigChangedEventReceivedByConnection(DISPLAY_ID_64BIT, 7, fps.getPeriodNsecs());
}
@@ -748,7 +748,7 @@
.setId(DisplayModeId(9))
.setVsyncPeriod(16666666)
.build();
- const Fps fps = mode->getFps() / 2;
+ const Fps fps = mode->getPeakFps() / 2;
mThread->onModeChanged({fps, ftl::as_non_null(mode)});
expectConfigChangedEventReceivedByConnection(INTERNAL_DISPLAY_ID, 9, fps.getPeriodNsecs());