2) SF-DM Generalization of Refresh Rates: Adding config variable and getter methods
Test: Logs. Unittest.
Bug: 142507213
Change-Id: Ibf93cfc2d88c4dd7764ba62d1b2c948fec534da8
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index caeb022..5f1580b 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -386,6 +386,17 @@
void traverseInReverseZOrder(const LayerVector::Visitor& visitor) const;
};
+ struct DesiredDisplayConfigSpecs {
+ int32_t defaultModeId;
+ float minRefreshRate;
+ float maxRefreshRate;
+
+ bool operator==(const DesiredDisplayConfigSpecs& other) const {
+ return defaultModeId == other.defaultModeId && minRefreshRate == other.minRefreshRate &&
+ maxRefreshRate == other.maxRefreshRate;
+ }
+ };
+
/* ------------------------------------------------------------------------
* IBinder interface
*/
@@ -475,6 +486,9 @@
std::vector<int32_t>* outAllowedConfigs) override;
status_t setDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken, int32_t displayModeId,
float minRefreshRate, float maxRefreshRate) override;
+ status_t getDesiredDisplayConfigSpecs(const sp<IBinder>& displayToken,
+ int32_t* outDefaultModeId, float* outMinRefreshRate,
+ float* outMaxRefreshRate) override;
status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken,
bool* outSupport) const override;
status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) const override;
@@ -1124,6 +1138,7 @@
// All configs are allowed if the set is empty.
using DisplayConfigs = std::set<int32_t>;
DisplayConfigs mAllowedDisplayConfigs GUARDED_BY(mStateLock);
+ DesiredDisplayConfigSpecs mDesiredDisplayConfigSpecs GUARDED_BY(mStateLock);
std::mutex mActiveConfigLock;
// This bit is set once we start setting the config. We read from this bit during the