summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_layers.cpp
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2016-05-17 11:36:27 -0400
committerNaseer Ahmed <naseer@codeaurora.org>2016-06-02 16:25:15 -0400
commit89ff45284db081c0c7f31b7b8646b80912a91e2c (patch)
tree5a6aeb989ca6809e2dfc7784c2d0b40bae86ff7f /sdm/libs/hwc2/hwc_layers.cpp
parenta216262084894651e40b7b3dee1f2aaf6c27e22c (diff)
downloaddisplay-89ff45284db081c0c7f31b7b8646b80912a91e2c.tar.gz
hwc2: Use floating value refresh rate
Matches corresponding changes in metadata on hwc1 Change-Id: I305a4d1f47cf3854f79456584ac013d15b57e9bc CRs-Fixed: 1023652
Diffstat (limited to 'sdm/libs/hwc2/hwc_layers.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_layers.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp
index ada1cacc..25918984 100644
--- a/sdm/libs/hwc2/hwc_layers.cpp
+++ b/sdm/libs/hwc2/hwc_layers.cpp
@@ -474,19 +474,20 @@ DisplayError HWCLayer::SetIGC(IGC_t source, LayerIGC *target) {
return kErrorNone;
}
-uint32_t HWCLayer::RoundToStandardFPS(uint32_t fps) {
- static const uint32_t standard_fps[4] = {30, 24, 48, 60};
+uint32_t HWCLayer::RoundToStandardFPS(float fps) {
+ static const uint32_t standard_fps[4] = {24, 30, 48, 60};
+ uint32_t frame_rate = (uint32_t)(fps);
int count = INT(sizeof(standard_fps) / sizeof(standard_fps[0]));
for (int i = 0; i < count; i++) {
- if ((standard_fps[i] - fps) < 2) {
+ if ((standard_fps[i] - frame_rate) < 2) {
// Most likely used for video, the fps can fluctuate
// Ex: b/w 29 and 30 for 30 fps clip
return standard_fps[i];
}
}
- return fps;
+ return frame_rate;
}
void HWCLayer::SetComposition(const LayerComposition &source) {