hwc: Cache refresh rate requested by client.
Switch to min fps upon idle fallback and reset to
previous fps as and when display updates.
CRs-Fixed: 2645241
Change-Id: I028c12425c132449ebcd41411844a1e36e5d4c25
diff --git a/composer/hwc_display_builtin.cpp b/composer/hwc_display_builtin.cpp
index 45d9db8..6aa1c66 100644
--- a/composer/hwc_display_builtin.cpp
+++ b/composer/hwc_display_builtin.cpp
@@ -154,6 +154,15 @@
DLOGI("Window rect : [%f %f %f %f]", window_rect_.left, window_rect_.top,
window_rect_.right, window_rect_.bottom);
}
+
+ uint32_t config_index = 0;
+ GetActiveDisplayConfig(&config_index);
+ DisplayConfigVariableInfo attr = {};
+ GetDisplayAttributesForConfig(INT(config_index), &attr);
+ active_refresh_rate_ = attr.fps;
+
+ DLOGI("active_refresh_rate: %d", active_refresh_rate_);
+
return status;
}
@@ -823,7 +832,8 @@
return metadata_refresh_rate_;
}
- return max_refresh_rate_;
+ DLOGI("active_refresh_rate_: %d", active_refresh_rate_);
+ return active_refresh_rate_;
}
void HWCDisplayBuiltIn::SetIdleTimeoutMs(uint32_t timeout_ms) {