drm_hwcomposer: Deprecate usage of HWC2 GetDisplayVsyncPeriod
Add an interface to HwcDisplay to query which HwcDisplayConfig is
currently committed in the kernel. Use this to implement
getDisplayVsyncPeriod.
Change-Id: Ie57759f22c012ab331ad0187043a4bea598cba78
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index 51694c2..0ab43f9 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -96,6 +96,14 @@
Deinit();
};
+const HwcDisplayConfig *HwcDisplay::GetCurrentConfig() const {
+ auto config_iter = configs_.hwc_configs.find(configs_.active_config_id);
+ if (config_iter == configs_.hwc_configs.end()) {
+ return nullptr;
+ }
+ return &config_iter->second;
+}
+
void HwcDisplay::SetPipeline(std::shared_ptr<DrmDisplayPipeline> pipeline) {
Deinit();