SF: Unify data types for display modes
Remove the RefreshRateConfigs::RefreshRate wrapper around DisplayMode.
Store DisplayModes as a SmallMap, so that RefreshRateConfigs uses the
same data structure for lookup by ID. Use iterators into that map for
all bookkeeping in RefreshRateConfigs.
Bug: 182939859
Bug: 185535769
Test: libsurfaceflinger_unittest
Change-Id: I7708fa997089802c45d906b17b7a073f5c82105e
diff --git a/services/surfaceflinger/fuzzer/surfaceflinger_scheduler_fuzzer.h b/services/surfaceflinger/fuzzer/surfaceflinger_scheduler_fuzzer.h
index 84b3912..1a49ead 100644
--- a/services/surfaceflinger/fuzzer/surfaceflinger_scheduler_fuzzer.h
+++ b/services/surfaceflinger/fuzzer/surfaceflinger_scheduler_fuzzer.h
@@ -22,6 +22,8 @@
#pragma once
+#include <scheduler/TimeKeeper.h>
+
#include "Clock.h"
#include "Layer.h"
#include "Scheduler/EventThread.h"
@@ -29,24 +31,9 @@
#include "Scheduler/Scheduler.h"
#include "Scheduler/VSyncTracker.h"
#include "Scheduler/VsyncModulator.h"
-#include "scheduler/TimeKeeper.h"
namespace android::fuzz {
-constexpr int64_t kVsyncPeriods[] = {static_cast<int64_t>(1e9f / 30),
- static_cast<int64_t>(1e9f / 60),
- static_cast<int64_t>(1e9f / 72),
- static_cast<int64_t>(1e9f / 90),
- static_cast<int64_t>(1e9f / 120)};
-
-android::scheduler::RefreshRateConfigs::LayerVoteType kLayerVoteTypes[] =
- {android::scheduler::RefreshRateConfigs::LayerVoteType::NoVote,
- android::scheduler::RefreshRateConfigs::LayerVoteType::Min,
- android::scheduler::RefreshRateConfigs::LayerVoteType::Max,
- android::scheduler::RefreshRateConfigs::LayerVoteType::Heuristic,
- android::scheduler::RefreshRateConfigs::LayerVoteType::ExplicitDefault,
- android::scheduler::RefreshRateConfigs::LayerVoteType::ExplicitExactOrMultiple};
-
class FuzzImplClock : public android::scheduler::Clock {
public:
nsecs_t now() const { return 1; }
@@ -168,18 +155,6 @@
namespace android::scheduler {
-DisplayModePtr createDisplayMode(DisplayModeId modeId, int32_t group, int64_t vsyncPeriod,
- ui::Size resolution = ui::Size()) {
- return DisplayMode::Builder(hal::HWConfigId(modeId.value()))
- .setId(modeId)
- .setPhysicalDisplayId(PhysicalDisplayId::fromPort(0))
- .setVsyncPeriod(int32_t(vsyncPeriod))
- .setGroup(group)
- .setHeight(resolution.height)
- .setWidth(resolution.width)
- .build();
-}
-
class ControllableClock : public TimeKeeper {
public:
nsecs_t now() const { return 1; };