Remove FPS calculations from userspace.

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

CRs-fixed: 283750
(cherry picked from commit 0dec3f333db5b58c5ddd9c65fb7fd5c61cc5ef59)

Change-Id: I26632dc489ed8a95502b9071fed5b7527b33e54d
This commit is contained in:
Saurabh Shah 2011-05-06 19:13:59 -07:00 committed by Govind Surti
parent 1efe8832e9
commit fc966d1448

View File

@ -687,18 +687,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
@ -708,7 +696,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[4] field is used to store FPS by the driver.
float fps = info.reserved[4];
LOGI( "using (fd=%d)\n"
"id = %s\n"