Remove FPS calculations from userspace.

The FPS is stored in reserved[3] field of fb_var_screeninfo
structure. Read directly from this field.

Change-Id: I052dc3c20a8a38995881cd4d743c13d9522f9246
CRs-fixed: 283750
This commit is contained in:
Saurabh Shah 2011-05-06 19:13:59 -07:00 committed by Linux Build Service Account
parent 16e6f7da94
commit 16722a86d7

View File

@ -827,18 +827,6 @@ int mapFrameBufferLocked(struct private_module_t* module)
if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1)
return -errno;
int refreshRate = 1000000000000000LLU /
(
uint64_t( info.upper_margin + info.lower_margin + info.yres )
* ( info.left_margin + info.right_margin + info.xres )
* info.pixclock
);
if (refreshRate == 0) {
// bleagh, bad info from the driver
refreshRate = 60*1000; // 60 Hz
}
if (int(info.width) <= 0 || int(info.height) <= 0) {
// the driver doesn't return that information
// default to 160 dpi
@ -848,7 +836,8 @@ int mapFrameBufferLocked(struct private_module_t* module)
float xdpi = (info.xres * 25.4f) / info.width;
float ydpi = (info.yres * 25.4f) / info.height;
float fps = refreshRate / 1000.0f;
//The reserved[3] field is used to store FPS by the driver.
float fps = info.reserved[3];
LOGI( "using (fd=%d)\n"
"id = %s\n"