libgralloc: Fix refresh rate calculation cm-12.1
authorCaio Schnepper <caioschnepper@gmail.com>
Mon, 30 Nov 2015 13:05:10 +0000 (11:05 -0200)
committerCaio Schnepper <caioschnepper@gmail.com>
Mon, 30 Nov 2015 13:13:02 +0000 (05:13 -0800)
Calculated refresh rate can be 3% off
Reference: https://code.google.com/p/android/issues/detail?id=69391

Change-Id: I3b4efefcc0aef695ba48abdfb61f6d38b9d0a79c

exynos4/hal/libgralloc_ump/framebuffer_device.cpp

index b14187827261696d1ba8b53c68bac1f0c62df1d2..814e6689b4616fc3f851ae16ef076318e51cd0b6 100644 (file)
@@ -263,8 +263,8 @@ int init_frame_buffer_locked(struct private_module_t* module)
 
     int refreshRate = 1000000000000000LLU /
     (
-        uint64_t( info.upper_margin + info.lower_margin + info.yres )
-        * ( info.left_margin  + info.right_margin + info.xres )
+        uint64_t( info.upper_margin + info.lower_margin + info.vsync_len + info.yres )
+        * ( info.left_margin  + info.right_margin + info.hsync_len + info.xres )
         * info.pixclock
     );